View Full Version : H.264 Encoding Questions
Asrial
30th May 2010, 22:07
I'll start this post with a joke: I'm making the transition from XviD to H.264.
Now, the backstory into the joke...
~8 or 9 years ago I was somewhat active in the encoding scene. However, I ran out of having the time available for projects (mostly anime) and so dropped out of it.
I've still always encoded, but only 3:2 pulldown sources because they're so easy. My process involves creating a simple AviSynth script (telecide, decimate, undot, crop), encode it to XviD using a full quality "twopass - first pass" (so it's a quant 2 on important frames and quant 4 on the rest), and toss it (and the audio) into a Matroska container.
My settings in XviD (the latest Koepi build) are all at default except for one (changing VHQ from 1 to 4).
So as you can see.. it's very basic. I don't care about filesize or encoding speed on these encodes. The point is to just get it done and get a result that doesn't make me want to claw my eyes out.
So now.. the questions..
.
1) It sounds like x264 is one of the best to use these days. How does it compare to Nero now? Years ago I heard Nero was one of the best to use.
2) Assuming that x264 is the best one to use. What's a good command line for what I'm wanting? Again.. no fuss, or multiple encodes to tweak it just the way you want, just use this as your standard command line for each encode and enjoy the quality (the goal of which is to be BETTER and SMALLER than XviD on quant 2/4 settings).
3) I was poking at x264vfw (since I use VirtualDub for XviD (I know that I can feed my AVS script into x264.exe)) and then read in a thread here that AVI isn't a great container to use for h.264 (which I'd have to do for x264vfw). Can someone explain this more?
.
I think that covers my questions for the moment.
ajp_anton
30th May 2010, 23:16
1) You started good by saying "one of the best", but then you ruined it with "IS x264 the best", which is against the rules... =)
2) --crf [choose quality] --preset [choose speed] --tune [choose video content]
video_magic
30th May 2010, 23:33
Visit this help page:
http://mewiki.project357.com/wiki/X264_Settings#Presets
I think you should especially look at the categories under presets (profile, preset, tune), it will basically save you looking too much into complicated settings - that work is mostly done for you.
Asrial
30th May 2010, 23:37
2) --crf [choose quality] --preset [choose speed] --tune [choose video content]The default CRF is 23. How does this compare to the XviD quants?
Asrial
30th May 2010, 23:46
I think you should especially look at the categories under presets (profile, preset, tune), it will basically save you looking too much into complicated settings - that work is mostly done for you.How does the PROFILE setting work on the grand scheme of things?
If I set the profile to HIGH, will it change the ratecontrol or will it stay the default CRF 23?
Will setting the profile to high also change the preset (default is medium)?
Blue_MiSfit
31st May 2010, 00:17
The H.264 profile is independent from rate control. You should leave it on the default of high profile, since this will remove any restrictions on which features can be used. Take a look at the wikipedia entry on H.264 for more info about baseline/main/high profiles. The profile restriction is also independent from the preset and tuning.
CRF23 is a good place to start. H.264 uses a very different quantization scale from Xvid (QP ranges from 0 to 51, with 0 being mathematically lossless), so direct comparisons are difficult. However, usual ranges for "good" CRF are between 18 and 24. It all depends on the source and the eyeballs viewing it :)
For SD sources, I usually use a lower CRF, since any encoding artifacts will be more visible after upscaling. So, I usually start at 18 or 19 and work up if the size is too big.
You should adjust the preset so that the following conditions are met:
1) You are using 100% (or close to 100%) of your CPU power
2) You are satisfied with the encoding speed/quality ratio
This takes some experimentation / experience to get comfortable, but no worries. The default "medium" is a really well chosen balance. Anything between "faster" and "slower" is a good choice for typical offline encoding when you care somewhat about speed. For example, I usually use "slower" or "veryslow" for 1080p encodes at home, because I start them at night and want them to be done before I get home the following day. That means I usually have about 18 hours to spend. Your situation may be different :)
To address your questions:
1)When it comes to most general applications, x264 absolutely wipes the floor with any other video encoder, period. It's also extremely good when it comes to broadcast, capture, editing, streaming, and archival, though in some cases there may be better options for these tasks.
2) I would suggest using x264 outside of VFW in most cases. There are plenty of valid technical reasons for this. Regardless, it does work and hey - at least you're still using x264 :devil:!
If you're capturing video and are used to doing this within virtualdub, then x264vfw is a WONDERFUL tool. For usual offline tasks, you should consider learning some new tools. Ideally you should just dig into the CLI. It's really not difficult at all, but some folks simply despise working on the command line. If you're one of those folks, there are plenty of wonderful GUIs. I personally prefer Lord_Mulder's simple GUI. Staxrip, Ripbot264, and MeGUI are all excellent choices that I've used at one point or another. There are tons of other nice GUIs out there as well.
Good luck!
Derek
LoRd_MuldeR
31st May 2010, 00:18
The default CRF is 23. How does this compare to the XviD quants?
It doesn't compare with Xvid quantizers, as CRF mode uses variable quantizers.
Simplifying, CRF mode will raise quantizers in "fast" scenes in order to not waste too many bits there and lowers quantizers in "static" scenes in order to retain good quality.
Now with MB-Tree (enabled by default) x264 even adjusts the quantizers based on the "complexity" of single blocks instead of entire frames.
Xvid doesn't have anything that works similar to CRF mode. With a constant quantizers (i.e. Xvid) you'll either have to accept inferior quality or bitrate squandering...
Blue_MiSfit
31st May 2010, 00:21
Excellent point, Lord_Mulder.
CQ2 in Xvid would be sort of like CQ16-CQ18 in x264... sort of :p
Derek
Asrial
31st May 2010, 01:02
Awesome. Thanks for the input guys!
D3C0D3R
21st June 2010, 10:14
hi, check this
x264 beats everyone with crushing score - thanx for akupenguin and especially Dark Shikari's hard work (VAQ, MB-tree and tons of patches)
http://www.compression.ru/video/codec_comparison/h264_2010/
>>AVI isn't a great container to use for h.264 (which I'd have to do for x264vfw). Can someone explain this more?
early were tons flame about x264+vfw and as i know here its forbidden subj
x264vfw use a hacky ugly way dealing with B-frames - option VDub Hack, but i use it about 5 years - it's no bugs or something wrong with it
IMHO you free to use it espesially if you like edit your encodes directly via VDub
Asrial
21st June 2010, 20:10
Thanks D3C0D3R :)
To give an update...
I went the route of using the x264 CLI and just use VirtualDub for the editing. It wasn't a painful transition at all (I just like to be aware of what's going on before jumping into it).
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.