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

Just have a drink and chat
MechWarrior001
New Cone
New Cone
Posts: 2
Joined: 06 Feb 2012 17:57
Operating System: Windows
Contact:

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

Postby MechWarrior001 » 06 Feb 2012 18:20

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.

Lotesdelere
Cone Master
Cone Master
Posts: 9974
Joined: 08 Sep 2006 04:39
Location: Europe

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

Postby Lotesdelere » 07 Feb 2012 12:20

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.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

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

Postby Jean-Baptiste Kempf » 07 Feb 2012 13:02

I agree...
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

MechWarrior001
New Cone
New Cone
Posts: 2
Joined: 06 Feb 2012 17:57
Operating System: Windows
Contact:

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

Postby MechWarrior001 » 18 Feb 2012 22:16

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?


Return to “Coffee Corner”

Who is online

Users browsing this forum: No registered users and 45 guests