PDA

View Full Version : Encode with Quantizer


Djon
3rd January 2009, 23:54
Hi, sorry for my English, I'll try to be clear.
With Avidemux, you can choose to encode in XviD with a fixed Quantizer (2 for me).
It allows me to have a 30K+ bitrate in my video.
How can I do the same with Virtualdub(mod) ?
Thanks for answer :)

LoRd_MuldeR
4th January 2009, 00:51
First of all install the Xvid VfW encoder, as required by VirtualDub, if not done yet:
http://koepi.info/xvid.html

Then in VirtualDub goto "Video" -> "Compression", choose "Xvid MPEG-4 Codec" from the list and press the "Configure" button.
Set "Encoding Type" to "Single Pass" and choose "Target Quantizer" plus "2.00" in the field below. Then hit "OK" and "OK".

BTW: Any particular reason why you use Xvid with CQ mode instead of x264 with CRF mode ???

Djon
4th January 2009, 01:49
Hey, sorry for such an easy question, I should have found it alone...
For the XviD/x264, no particular reason. Maybe i'm more used to XviD because it's older, and it can be read by my DVDPlayer, plus it's more CPU-friendly than x264 (I think ?).
But if you have some reason to give me, I see a lot of videos, and it's more and more x264, maybe for a good reason :)
PS : x264 CRF : ?
Thank you for the help.

LoRd_MuldeR
4th January 2009, 01:58
But if you have some reason to give me, I see a lot of videos, and it's more and more x264, maybe for a good reason :)

H.264 (e.g. x264) offers much better compression than MPEG-4 ASP (Xvid, DivX , etc). That is either "better quality at same size" or "same quality at smaller size".

Compare "Big Buck Bunny" at 500 kbps:
* Xvid: http://mirror05.x264.nl/Dark/website/xvid_57.png
* x264: http://mirror05.x264.nl/Dark/website/x264_57.png

Compare "300" at 1000 kbps:
* Xvid: http://mirror05.x264.nl/Dark/website/xvid_1260.png
* x264: http://mirror05.x264.nl/Dark/website/x264_1260.png

PS : x264 CRF : ?

CRF = "Constant Rate Factor", also known as "Average Quantizer" mode, also known as "Constant Quality" mode.

The "CRF" mode of x264 gets much closer to a "Constant Perceived Quality" mode than any "Constant Quantizer" mode. Xvid does not have an equivalent to CRF.
Usually you can find the highest CRF value that still gives satisfactory quality for your eyes and use that CRF value for all future encodes...

Djon
4th January 2009, 13:20
Wow, I see...
I found this http://www.xvidvideo.ru/content/category/1/30/28/
Is this good for VDub ?
Another thing ; Encoder features : Lossless mode. Is this the "Quantizer = 0" mode ?
Thank you.

Edit : Hmm, I need the VFW, but it seems that x264 doesn't support this method anymore. Should I use MeGui instead of VDub ?

chornobyl
4th January 2009, 15:28
vfw is not recomendet for x264, but you can find it here
http://sourceforge.net/projects/x264vfw

LoRd_MuldeR
4th January 2009, 15:35
Wow, I see...
I found this http://www.xvidvideo.ru/content/category/1/30/28/
Is this good for VDub ?

Nope. This is the CLI (Commandline Interface) encoder. VirtualDub requires the VfW Codec, but uisng x264 through VfW is frowned upon!

If you don't case, see the link provided by chornobyl.

Another thing ; Encoder features : Lossless mode. Is this the "Quantizer = 0" mode ?

Yes. "QP=0" means true lossless for x264. Note that you should turn off B-Frames for lossless mode.

Also note that you need a very recent version of ffdshow (past few weeks) or CoreAVC to decode lossless H.264 properly!

Should I use MeGui instead of VDub ?

Either MeGUI or one of the various other GUI's. Or simply use Avidemux (http://forum.doom9.org/showthread.php?t=126164) if you prefer a VirtualDub-like application :)

Djon
4th January 2009, 16:16
I use Avidemux because it's simple and fast, but I have this color problem (I mentioned it in the forum), so I have to use VDub.
Here, if you want to take a look : http://files.filefront.com/Sample+colors+problemrar/;12298001;/fileinfo.html

Edit : Nevermind, it works now with rev4508. But I still have this white "veil".
.
Note that you should turn off B-Frames for lossless mode.
Where shoud I do that ?

LoRd_MuldeR
4th January 2009, 18:01
Note that you should turn off B-Frames for lossless mode.Where shoud I do that ?

For the CLI encoder you simply do not specify "--bframes". In a GUI front end there should be an option like "Maximum number of consecutive B-Frames", which you can set to "0" in order to disable b-frames. And don't forget: Disabling b-frames is only good for the "lossless" mode (CQP=0). For all other modes (including CRF and 2-Pass) you should enable b-frames!

Djon
4th January 2009, 18:16
Okay, thank you :)
So for a "regular" encoding, the default value (2) is good enough.

LoRd_MuldeR
4th January 2009, 19:54
Okay, thank you :)
So for a "regular" encoding, the default value (2) is good enough.

More than 3 or 4 B-Frames rarely improve the output and only increase encoding time! At least when "--b-adapt 2" is used (which is highly recommended to use).