With omxh264enc, using control-rate=constant (CBR) and target-bitrate=<value> just hangs. Am I doing it wrong?

Nick Robillard nick at nickrobillard.com
Thu Aug 5 07:23:32 UTC 2021


When using the OpenMax encoder omxh264enc, I have found that setting control-rate=constant and specifying a value for target-bitrate causes GStreamer to hang indefinitely. It does not encode any output and does not show any error message (with debug mode disabled). It is very possible that I am not using the correct configuration. My goal is to produce a constant bitrate (or something close to it) stream at a specified bitrate that is suitable for live streaming to Twitch, Facebook, Youtube, etc. Is there a better or more correct way to achieve this?

I have come up with a minimal example that has no external dependencies.

This command works as expected:
$ gst-launch-1.0 videotestsrc ! omxh264enc ! avimux ! filesink location=output.avi

This command results in the described issue. I am attempting to achieve constant 4500Kbps bitrate:
$ gst-launch-1.0 videotestsrc ! omxh264enc target-bitrate=4500000 control-rate=constant ! avimux ! filesink location=output.avi

It should be noted that combining control-rate=variable with target-bitrate=<value> does not have this issue and appears to work as expected.

My GStreamer version:

$ gst-launch-1.0 --version
gst-launch-1.0 version 1.18.4
GStreamer 1.18.4
http://packages.qa.debian.org/gstreamer1.0

For the failure case, I have set different levels of debug and I’m not spotting anything obvious. Of course the debug output is massive at higher debug levels so I will link to some pastebins.

Debug level 4. This log is full and complete. (I exited via control+c after a few minutes of seeing no more output.)
https://pastebin.com/raw/C1nQrnpB

Debug level 5. This is a truncated log that includes the first 10th of a second of output due to length. It seems very repetitive.
https://pastebin.com/raw/zqBMduhC



More information about the gstreamer-devel mailing list