Restart RTSP pipeline on demand

Guillermo Rodriguez Garcia guille.rodriguez at gmail.com
Tue Sep 15 06:31:45 PDT 2015


Hello all,

I have a pipeline that fetches video over RTSP or HTTP and draws to a
xvimagesink. Sometimes the resolution of the source video changes on
the fly and this causes the image to become corrupted. I suspect that
this is due to a bug in the video drivers as it only happens on a
specific hardware platform and cannot be reproduced on a standard
desktop PC.

The thing is, when I detect the change in the resolution, I want to
"restart" the pipeline to work around this issue.

For the HTTP case I found it is enough to set the pipeline state to
NULL, then back to PLAYING:

    gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_NULL);
    gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PLAYING);

This seems to fix (or rather, work around) the problem.

However for the RTSP case, this does not seem to be enough. The
pipeline goes to NULL and back to PLAYING but the image is still
corrupted. The actual RTSP pipeline is rtspsrc -> rtph264depay ->
ffdec_h264 -> xvimagesink.

How can force a "restart" (or a full renegotiation) of the pipeline,
without destroying it ?

Any hints welcome..

Guillermo Rodriguez Garcia
guille.rodriguez at gmail.com


More information about the gstreamer-devel mailing list