In my application, I use the gstreamer element omxh264enc to encode a 3840x1920P30 video stream. The problem is that the bitrate is incorrectly set to 1~1.2Mbps(from observing running result), not 8Mbps as I set with g_object_set, nor 4Mbps as the default.
g_object_set(G_OBJECT(enc), "bitrate", 8000000, NULL);
The above line of code seems unable to configure encoder’s bitrate, no matter what value it’s set. Only when I set the qp-range property, to lower the max boundry to 30, as
g_object_set(G_OBJECT(enc), "qp-range", "0,30:0,30:0,30", NULL);
the bitrate would go up to somewhere 5Mbps.
Then, to compare, I tried this command line
gst-launch-1.0 \ v4l2src device=/dev/video0 ! 'video/x-raw, width=(int)1920, height=(int)1080, format=(string)UYVY, framerate=(fraction)30/1' ! \ nvvidconv ! 'video/x-raw(memory:NVMM), width=(int)3840, height=(int)1920, format=(string)I420, framerate=(fraction)30/1' ! \ omxh264enc bitrate=8000000 ! h264parse ! mp4mux ! filesink location=./rec.mp4
And this time the bitrate is indeed 8Mbps as expected.
So what’s making the bitrate property invalid?