Page 1 of 1

x264 & Youtube's Adv. specs for H.264 encoding

Posted: 06 Feb 2012 18:20
by MechWarrior001
Hey, new here; kinda new to video encoding and for the most part I've only used Theora up until now. I Hope I'm not posting this in the wrong section.

Recently I've attempted coding in H.264 utilizing x264. I looked up Youtubes advanced specs for encoding but I'm a bit confused on which command line parameters to use to achieve them. For example the specs recommend a closed GOP with a size of half the frame-rate. I've looked at the built-in documentation and from what I can tell the keyint commands control the GOP, but I don't see a command for closed GOP; is it closed by default? And do I only need to specify the minimum GOP or the maximum or both? Also Youtube recommends a color space of 4.2.0; which command controls that? Is CABAC enabled by default? Last but not least Youtube recommends the MP4 container have no edit lists and to "moov atom at the front of the file." How do I go about doing that? I don't know if the MP4 container auto-generated by x264 have these parameters setup by default or not. In addition unlike Theora I've noticed x264 does not mux audio into the container from the source file; therefore how would I go about this manually?

Also I've tried encoding in the supposed "lossless" mode but have encountered difficulties during playback; perhaps I'm not encoding it right? To my knowledge all I need to use is --qp 0 but it doesn't playback in the player.

Re: x264 & Youtube's Adv. specs for H.264 encoding

Posted: 07 Feb 2012 12:20
by Lotesdelere
From my own experience, I just encode using the x264 preset "Slower" and the x264 tune setting "Film" but with both B-pyramids and Weight-P disabled, and I never got any problems on Youtube.

I'm encoding with Avidemux most of the time, with H.264 and AAC into MP4, sometimes remuxed with YAMB+MP4Box and I don't touch the GOP, keyint and other settings like that which usually are format specific (e.g. Blu-ray).

If you are using a 8-bit build of x264 then 4.2.0 is the default color space. By default x264 is also using High profile therefore CABAC is enabled but, as said before, it's not a problem for Youtube.

Re: x264 & Youtube's Adv. specs for H.264 encoding

Posted: 07 Feb 2012 13:02
by Jean-Baptiste Kempf
I agree...

Re: x264 & Youtube's Adv. specs for H.264 encoding

Posted: 18 Feb 2012 22:16
by MechWarrior001
Thanks for the help. I've recorded some test footage using Fraps and the "Loss-less RGB" mode. According to my knowledge this encodes the videos in a bgr24 color-space; I heard that if you convert to rgb24 there isn't any loss in quality; How would I get Avidemux to encode in rgb24?