omxh264enc control-rate confusion

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

omxh264enc control-rate confusion

kepitto
I'm currently testing different parameters for the omxh264enc in order to find a good solution for live transcoding. I'm using a Raspberry Pi 4 for these tests.

My findings are:
control-rate=2 (constant) is way slower than control-rate=1 (variable) and constant uses less CPU than variable.
target-bitrate works for both up until 13Mbit/s for variable (seems like variable is capped at 13Mbit/s)

Can someone explain me why constant is so much slower and uses way less CPU?  
Up until 13Mbit/s the filesize & quality (constant is worse quality for lower bitrates) is pretty much the same, so is it correct that for control-rate=variable the target-bitrate is also some kind of constant bitrate streaming?
Reply | Threaded
Open this post in threaded view
|

Re: omxh264enc control-rate confusion

Marianna S. Buschle
This site: https://streaminglearningcenter.com/ has a lot of good articles on h264 encoding, bitrates, rate controls and such. It has helped me a lot in understanding how to properly use the vaapih264enc and what to expect.

I can't say anything about the speed and CPU usage, since it should be a HW encoder.

About the bitrate:

- Constant: will keep the bitrate at the target, through all the file. So if you inspect the file size second by second it will always be the same

- Variable: will vary the bitrate through all the file, but keeping the AVERAGE at the target bitrate. So if you inspect the file size second by second it will vary. Scenes with less motion will use a lower bitrate and scenes with higher motion will have a higher bitrate. But the final file size will be the same as with Constant bitrate.

And about the 13Mbps "limitation" I don't know, it is probably just that your stream doesn't need higher bitrate.

Fx. for a fullHD@30fps pretty much anything over 8Mbps start getting hard to see the difference (unless it is really a very motion full stream)