Bitrate problems with gstreamer omxh264enc on Jetson TK1

Hello !

I’m trying to use omxh264enc (or omxvp8enc as well) gstreamer plugin in order to stream encoded video. The problem is I can’t succeed into setting target-bitrate property programmatically. Here is a sample of code :

GValue bitrate = { 0, };
g_value_init(&bitrate, G_TYPE_UINT);
gst_value_deserialize(&bitrate, "8000000");
g_object_set_property(G_OBJECT(h264Encoder), "target-bitrate", &bitrate);
g_value_unset(&bitrate);

I have also tryed functions like g_object_set and gst_util_set_object_arg and it doesn’t work either…
I have test to call g_object_get_property after the setting and the return value is exactly the one I set. But the encoder doesn’t seems to use my value and not even the default value which is 4000000 (the video stream is still very ugly).

The most anoying thing is that the property is used when I call gst-launch in command line with the following pipeline :

gst-launch-1.0 v4l2src ! video/x-raw, width=640, height=480 ! omxh264enc target-bitrate=8000000 ! h264parse !  omxh264dec ! nveglglessink

Does anyone have any idea ?

This is what I do with GST 0.10:

g_object_set(G_OBJECT(encoder), "bitrate", 1048576, NULL);

But I don’t know if that has changed for GST 1.0?

I have just tried again with “bitrate”, and it still doesn’t work…
gst-inspect-1.0 mentions that the propertie is named “target-bitrate”.

My point was mainly that I use g_object_set and not g_object_set_property but as said, I’ve only used 0.10.

Hello !
I have done some tests since my last post : the “target-bitrate” property seems to be working well with omxh264enc plugin (using gstreamer C API and in command line) but not with omxvp8enc.

You were right about the function to use : g_object_set works well !

Does anyone know if it’s possible to have the source code of these two plugins ?

Sources for “libgstomx.so” are here:

https://developer.nvidia.com/linux-tegra-r213

But I’m not sure if that includes also these decoders.