Number of x264 reference frames beyond H.264 level setting

Started by madada, October 14, 2019, 09:49:03 PM

Previous topic - Next topic

madada

Hello,

I've been busy encoding low-resolution footage with good encoding efficiency, and I noticed that some of my output files do not abide the H.264 level I set them to.
I encoded my video with Avidemux using x264 to a frame size (resolution) of 720x540 pixels and set the H.264 level ("IDC Level") to 3.0 and the x264 preset to "slower". This preset uses 8 reference frames but H.264 level 3.0 only allows 5 reference frames at the chosen resolution (see also https://planetcalc.com/3321/).
When encoding the same footage the same way using Handbrake, I noticed that it reduced the number of reference frames correctly despite the preset when selecting level 3.0.
Can this be fixed so that Avidemux behaves like Handbrake does? Or is the less experienced user expected to leave the level setting always at auto? In my case, being able to restrain the level and then know that the encoder will act accordingly, really helps playback on older devices like old iPads (some of which require Main Profile Level 3.0).

Greetings,
M.

eumagga0x2a

Quote from: madada on October 14, 2019, 09:49:03 PM
I encoded my video with Avidemux using x264 to a frame size (resolution) of 720x540 pixels and set the H.264 level ("IDC Level") to 3.0 and the x264 preset to "slower". This preset uses 8 reference frames but H.264 level 3.0 only allows 5 reference frames at the chosen resolution (see also https://planetcalc.com/3321/).

Due to decoded picture buffer size constraints?

QuoteWhen encoding the same footage the same way using Handbrake, I noticed that it reduced the number of reference frames correctly despite the preset when selecting level 3.0.
Can this be fixed so that Avidemux behaves like Handbrake does?

Of course it can as soon as someone actually implements it.

QuoteOr is the less experienced user expected to leave the level setting always at auto? In my case, being able to restrain the level and then know that the encoder will act accordingly, really helps playback on older devices like old iPads (some of which require Main Profile Level 3.0).

Avidemux relies on x264_encoder_open() to perform the necessary checks (which doesn't care).

Rangeles

What are the odds of this being implemented anytime soon?

eumagga0x2a

No estimate possible. Generally, if you need a feature, the best way to make it happen is writing it yourself. On my part, I'm curious about how Handbrake handles this, might be something well suited to help procrastinate important stuff.


madada

Wow that's great!
Thanks for the effort. I'll be looking out for the next Nightly to try.

madada

Just tried the latest nightly that was released today (x64, Windows).
It works great now!

Thank you very much for providing this fix so soon!

M.