Log in

View Full Version : YouTube recommended upload encoder settings for H.264?


orion44
2nd March 2017, 14:21
YouTube has a recommended upload encoder settings for H.264 which you can find here:

https://support.google.com/youtube/answer/1722171?hl=en

It states, among other things, that H.264 encoder should use:

• 2 consecutive b-frames
• Closed GOP
• GOP of half the frame rate

If I understand correctly, x264 uses closed GOP by default, and 2 consecutive b-frames is set with "-b 2" switch.

How do I set GOP of half the frame rate in x264 for an SD video that has a frame rate of 48 fps?

What is the purpose of these settings? What do they improve?

Cary Knoop
2nd March 2017, 16:55
...an SD video that has a frame rate of 48 fps?

That's very unusual.

Every quality H.264 based encoder should have a parameter where you can specify the GOP length. For instance ffmpeg has a -g option while x264 has -keyint.

They improve the number of frames that are independently encoded as opposed to being encoded in terms of difference from neighboring frames.

sneaker_ger
2nd March 2017, 17:04
How do I set GOP of half the frame rate in x264 for an SD video that has a frame rate of 48 fps?
--keyint 24

What is the purpose of these settings? What do they improve?
That is an excellent question. From my experience Youtube can convert just about anything x264 encoded just fine irregardless of the settings used. Maybe closed gop helps a bit with distributing the encoding by making it possible to split the input into many small parts and avoid any (de)muxing issues. And IMHO 1/2 framerate GOP is overkill. I wouldn't worry about it.