Help me to change x264enc parameter dynamically

Andrey Nechypurenko andreynech at googlemail.com
Wed Feb 1 23:42:23 PST 2012


Hi Ahmad,

> I am a PhD student and I am working on "multimedia QoE management". To look

Cool! BTW, what is QoE? I know what QoS is but never heard about QoE ;-) .

> I need to change the Quantization Parameter after the streaming starts.
> According to the NEWS in "GStreamer Ugly Plugins 0.10.18", this version
> "allows changing the bitrate and quantitizers dynamically".

I did not try to change these particular parameters myself yet, but as
I understand, in general, it is necessary to pause the element before
you change such parameters and then resume it again.

> I use "g_object_set(G_OBJECT(myencoder), "quantizer", newQP, NULL);" to
> reset the QP; but nothing happens.

You can take a look at the following code snippets from our vehicle
on-board "streaming" server:
https://github.com/veter-team/vehicle/blob/master/src/VideoSenderThread.cpp#L253
Here setFrameSize() function illustrates how to set element
properties. In this function we are searching for elements with
particular names ("qos-scaler" and "qos-caps") pause the playback by
calling gst_element_set_state(qos_scaler, GST_STATE_NULL); , set
"width" and "height" properties and then switch to the PLAYING state
again. I was told that PAUSE state itnstead of NULL should be enough
but did not try it yet myself.

Right below this function, there is a setBitrate() function which
supposed to set the target bitrate for the encoder dynamically. But,
for some reasons which I still do not understand, applied to the TI-s
DSP-based h264 encoder for OMAP processor it causes the application to
crash. That is why, it is not used in the code but might be also
useful for you as an example.

Hope this helps and good luck with your project!
Andrey.


More information about the gstreamer-devel mailing list