Log in

View Full Version : Looking for Codec Tweaking Hints


kilg0r3
14th May 2002, 14:33
hi neo and all other xvid pros,

found this post in http://forum.doom9.org/showthread.php?s=&threadid=23339

Originally posted by Neo Neko


I set I frame quantizers to 1-6 and the P frame quantizers to 1-12 and the resulting video comes out super sharp slick and with minimal quantization errors! [...] Also the alt-curve compression is very usefull as well. [...] I just live the Xvid features. I use them EVERY DAY!

i was very glad to read some tips how to get even better quality out of this great codec which gave the idea to collect some tips and hints from very experienced users/developers. the info should be in a form which enable 'normal users' to use them. for example it would be very interesting how to use the alt-cc. however, frankly said, i have immense difficulties to understand what people in the relevant thread are talking about.

Issues which i'd like to see addressed here are: How to tweak the codec for
1cd vs. 2 cd rips for 90-120min playing time
few action, continual action, dramatic/dynamic action
clean sources, noisy sources, dark sources,

Eventually, the information could perhaps be condensed into one of the doom9 guides (get well soon!!!).

well, tell me what you think and have a really nice day!

kvs
14th May 2002, 16:37
Well this is like asking those 1000 engineers about coming up with a solution to a complicated problem, you'll get 1000 different answers..

And if you're having immense difficulties understanding what the people are discussing in some threads here, maybe you should just take that as a hint and do things in a more simple manner, or just lay off? I mean, if I was interested in making bombs and stuff, and could not understand what the people disussing the creation of an atomic bomb were on at, I would simply give it up and try something simpler. Not that difficult a concept, is it?

And frankly, a good few posts in the altcc-thread should give you a simple idea of what to use for what type of source.. and if you look at the graph and read the first 3 or so pages a few times over, you _should_ be able to grasp it. I simply don't think you're trying hard enough, I gave up on the graph first time over too, but after a little while I realized it wasn't that compicated at all if you just put a little effort into reading the thread.

As for the rest, noise removal and 1cd vs 2cd etc.. Again, I don't think you're putting too much effort into this. What do you think we do all day long on this board? We discuss things and become smarter (when it comes to encoding anyway). Do you really expect to be magically enlightened in this thread or something? Do the only right thing, search around this board, read it daily, study the guides.. that's the only good way. Getting some recommendations while not having a clue will not help much, as applying them in the wrong manner on wrong material won't do much good.

Oh yeah, and you'll find tons of posts regarding noise removal, 1cd vs 2cd.. in fact everything. Sorry for sounding harsh, but this is just the way things are.

Neo Neko
24th May 2002, 07:42
Everyone does have their favorite settings for encoding. As well as favorite software. There is nothing anyone can tell you to make you an expert or a pro. There is just alot of trial and error. A few rules of thumb though.

The smaller the rez the smaller your quantizers should be. On large frames quantizer noise is a bit harder to see. But it gets more and more noticable the smaller the frame size gets.

2+ CD rips are easy to do. Not much skill required. But when it comes to 1CD rips there are sacrifices to be made. Running Virtualdub Filters like Temporal Smoother or Smart Smoother can help to make the video more compressable. Also if you are not using PAL sorces IVTC is often necessary and can save you on file size. But NTSC or PAL you almost always need to deinterlace to get good quality. It is a rare occasion when you get true progressive sources.

2-pass is your friend. Learn it. Love it. Live it.

Always use the best tools for the job. And never become satisfied. ATM I like Gordian Knot, AVISynth, and Virtualdub for my video processing. Flask or XMPEG may be easy. But the results show the lack of effort. If you are using Divx 3 never use anything but Nandub. Divx3 is about defunct and can only produce good results in Nandub.

Other people may have some other good rules to follow. But as for specific quantization settings and size, bitrate, and compression curve settings. Well these are offten unique to the source material. So it is impossible to say use these settings for the best results on everything.

Didée
24th May 2002, 11:30
Originally posted by Neo Neko
[...]
2+ CD rips are easy to do. Not much skill required.
[...]

What about 4-hours-movies, like Dancing with the wolf? (Don´t know the correct title name in English. You know, Kevin Kostner.)
Though I didn´t try this particular one myself yet ...

Nevertheless, I agree with the above:
You can´t be teached to become a wise man ... the way is the goal ...

Koepi
24th May 2002, 12:27
Dancing with wolfes should be easy to do, only some motion scenes, a lot of "still scenes". While I think of it, this would be one movie I'd like to tweak for 1CD, I think it should be possible (at least when I have the space of XCD) ;)

I already successfully did "Contact" (~ >3hrs) as 1 CD, back with nandub/divx3.11.

But easy to do for 2CDs anyhow because of it's nature.

To be honest, I can't tell _how_ to tweak it, I'd try myself with the facts which are known (playing with curve aggression etc).

So you have really to try and learn yourself. This is why I usually get upset when some posts show the attitude of "I don't wanna learn, give me that pill to take after which I know everything". Well, and even knowing doesn't help you much if you don't understand what that stuff means.

All in all again, you should read that alt. curve thread some more times, print out the graph and think it over and over again, until you get the idea how it works (this is a usual mathematical problem which can't be easier explained as by it's graph IMHO).

I hope this helps,

regards,
Koepi

Didée
24th May 2002, 14:20
Hi Koepi,

by the time you squeezed that Dance onto 1 CD, let us know along with the settings.
This movie has very little motion, indeed - but I´m not too optimistic it will fit on 1 disk.
BTW, I prefer rips that are hard to distuingish from the original DVD ... and when that means two, I´ll take two. (Waiting for DVD burning getting affordable and/or Blue Ray Disks :cool: )

Ooops: we got totally OT, it seems ... sorry

Teegedeck
24th May 2002, 19:23
As Koepi said, it's all about playing around with the things you know - Gordian Knot and its compressiblity-check are indispensable tools at least for me. Choosing the right resolution still is the basics.

Tweaking is not as hard/important with XviD though as it was with Nandub, so no need to worry. You can't, for example, go wrong with low curve-aggression & hi-distance:300 while the other curve-types could have more risks than possible gain for you. Low aggression works fine for anime, too. So you can be very lazy and still have nice results. Also, personally I'd give lumi-masking in both 1st and 2nd pass a try (Koepi will disagree on that) also on 2-CD-rips. It can improve compressibility considerably and has less dangers the lower the quantizers are that you use. The only thing that comes out ugly from my experience is solid red. It's a tough question whether to accept that setback. Hope you find some comments helpful in this thread.

kilg0r3
24th May 2002, 20:50
hey wow. after the initial reproval and the following silence, i no longer hoped for any kind attention.

Thank you very much everybody for your patience and effort! you are cool and kind people!

A bunch of thanks from the Trout!

morello12
25th May 2002, 03:37
Pay attention to what your source uses in the video if you're deinterlacing. A quick way to screw up a lot of detail is to use a deinterlacer (no joke). Stuff like Area Based Deinterlacer or the standard one can wreck detail in scenes where there are SUPPOSED to be scanlines (like a tv being show with scanlines in a cartoon/anime, small text, sharp edges, etc). Run Area Based Deinterlacer on the default settings and you'll see right away the the scanlines will turn into utter garbage, where in the source video, they look like scanlines. Changing the Edge Detect if you use Area Base Deinterlacer to a higher setting in such cases (ie 50 instead of 25) will keep them intact. But such efforts are not always necessary, it depends on what the source contains in it. Sometimes you want heavy deinterlacing, and if it mixes around, you may have to isolate frames for not using strong deinterlacing from frames where you really need it.

Another very important tip if you are using Decomb/Telecide (avisynth) to IVTC (or anything else), is to NOT use the default settings. Post-processing (image cleaning) is turned on by default, and it just is awful. I've seen it in action and it causes text to flicker, and other bad things, it also slows things down a lot. Turn this off by adding the line "Telecide(post=false)"

So in summary just try to know what you're doing. It sounds simple in theory, but really isn't. Almost every show/movie is different, so it's best to investigate a bunch of different scenes and see if the results are satisfactory, and if not, figure out what is causing the problems.

grug2k
2nd June 2002, 08:30
But NTSC or PAL you almost always need to deinterlace to get good quality. It is a rare occasion when you get true progressive sources.


Correct me if I'm wrong, but isn't it RARE that you'd need to deinterlace a PAL video stream? Most PAL video streams are progressive (regardless of what DVD2AVI says. :P), except for non-film based sources of course.

Teegedeck
2nd June 2002, 13:24
This is true indeed. If you're not dealing with TV-material, you usually don't have to deinterlace.

Neo Neko
3rd June 2002, 05:37
Originally posted by grug2k


Correct me if I'm wrong, but isn't it RARE that you'd need to deinterlace a PAL video stream? Most PAL video streams are progressive (regardless of what DVD2AVI says. :P), except for non-film based sources of course.

Whoops! My bad. Total PAL material encoded 0%. And I do mostly NTSC caps mysef. Plus all the DVD I have encoded needed deinterlace for good results. Though not alot of DVD. Jut a hullofalot of TV caps. :)

kilg0r3
3rd June 2002, 11:19
hi there,

i made a little NONREPRESENTATIVE comparisson between xvid and divx. for this prupose i encoded full length feature film. the data is given below.


'The Curse of the Jade Scorpion (Woody Allen)'

length: 97min, res: 576x320, video filesize/bitrate: 629926kbyte/ca.885kbit per sec
method: Smartripper, DVD2AVI, AviSynth, VirtualDub 1.4.10 (two-pass)


XviD Koepi-22052002-1
---------------
global: msp:6 - q-type:h.263 - lumi:yes
quantization: minQ I:2 - maxQ I:16 - minQ P:2 - maxQ P:18
two pass: all at default - hinted me: no
altcc: medium - high:200 - low:45 - strength:50

DIVX Pro 5.02
---------------
gmc, b-frames, psych:strong, maxQ:12, minQ:2

to my eyes and surprise, the divx codec seems to provide more details and less artifacts with these settings. you can check out some screenshots taken in virtualdub (=> no postprocessing) here (http://members.fortunecity.de/kilg0r3/index.html) (ca. 1mb, rar 3.0 - sorry for the pop-ups). looked at it again, in dark scenes, lumi seems to allow xvid to surpass dvix in quality. in other scenes the oppostie is true, e.g. look at the glass door on the right in the first picture.

again, this is not meant to be a general statement for or against any one of the codecs. I rather hope you tell me what i possibly did wrong in my xvid encode. for i believe i have quiet probabely screwed the encode by using some stupid altcc setting.

UPDATE

hi! i've updated the 'site'. there are now two archives which also contain the screenshots from the sourceframes.

libredr
3rd June 2002, 12:36
By the way, that would be a nice idea to put a button in the GUI that would generate a txt file with a listing of all the settings used to encode. It would make it easier for people to exchange the settings they use for a movie.
Cheers

Stabmaster-Arson
6th June 2002, 05:40
Libredr, there is. In vdub click file>save processing settings. This will output a txt file with .vcf extension with all the settings in there.

kilg0r3
6th June 2002, 08:43
@ Stabmaster- Arson
i treid that but the output looks something like this:

---------------------------------------------------------------------
VirtualDub.audio.SetSource(1);
VirtualDub.audio.SetMode(0);
VirtualDub.audio.SetInterleave(1,500,1,0,0);
VirtualDub.audio.SetClipMode(1,1);
VirtualDub.audio.SetConversion(0,0,0,0,0);
VirtualDub.audio.SetVolume();
VirtualDub.audio.SetCompression();
VirtualDub.video.SetDepth(24,24);
VirtualDub.video.SetMode(1);
VirtualDub.video.SetFrameRate(0,1);
VirtualDub.video.SetIVTC(0,0,-1,0);
VirtualDub.video.SetRange(0,0);
VirtualDub.video.SetCompression(0x64697678,0,10000,0);
VirtualDub.video.SetCompData(1124,"BQAAACBOAAC+mAkAWjpcenp6VEVNUFxSaXBfMVx4dmlkLTAyLnN0YXRzAABcAHgAdgBpAGQALQAwADIALgBzAHQAYQB0AHMAAAAA [... ];
VirtualDub.video.filters.Clear();
VirtualDub.subset.Delete();
-----------------------------------------------------------------

unfortunately i can't read that.

libredr
6th June 2002, 18:18
Originally posted by Stabmaster-Arson
Libredr, there is. In vdub click file>save processing settings. This will output a txt file with .vcf extension with all the settings in there.

Thanks, didn't know that. But the problem is that the settings are encoded to make them easy to handle by the software, but are not human-readable. Maybe there is an option ?

sprit
6th June 2002, 20:11
Originally posted by libredr
But the problem is that the settings are encoded to make them easy to handle by the software, but are not human-readable. Maybe there is an option ?
Even worse, from time to time when switching to a newer build of XviD, the string-"thing" messes everything up - it's like a value gets inserted in the middle, so for instance the FourCC in the xvid GUI looks ok but all the quants get set to 1277217 and things like that :-)

libredr
6th June 2002, 20:44
Since Virtualdub is a GPL software, the encoding of the settings might be documented. BTW, I think it is the way Gordian Knot passes settings to Virtualdub for encoding.
No, I think that a simle button that would generate a text file with all the parameters would be a nice tool, especially to compare our parameters on this forum. Is that possible to see that in a future build ?