Problem restarting rtsp-stream recording pipeline

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Problem restarting rtsp-stream recording pipeline

Dilip Yadav

I am recording a rtsp-stream to a segmented file using splitmuxsink and embedding some text overlay on it.
I am implementing this pipeline in the code:

gst-launch-1.0 rtspsrc location=rtsp:// ! queue min-threshold-buffers=1 !\
rtph264depay ! h264parse ! avdec_h264 ! videorate ! videoscale ! capsfilter caps="video/x-raw,width=640,height=480,framerate=(fraction)15/1" ! textoverlay shaded-background=true font-desc=28 text=CAM0 halignment=left valignment=top ! \
clockoverlay shaded-background=true font-desc=28 time-format="%Y-%m-%d %H:%M:%S" halignment=right !\
vaapipostproc ! vaapih264enc  ! h264parse ! splitmuxsink max-size-time=60000000000

I stop the pipeline by sending EOS to it. In message handler I set pipeline to NULL state, upon receiving EOS.
It is working fine.

Now I restart the pipeline by :

1. Unlinking all the previous elements:

gst_element_set_state (rtspSource, GST_STATE_NULL);
gst_element_set_state (rtpDepay, GST_STATE_NULL);

2. Relinking them again :
if(gst_element_link_many(rtpDepay,h264Parse,avDecH264,videoBox,capsfilter,textOverlay,clockOverlay,videoConvert,videoEncode,splitSink,NULL) != true)
        g_print ("RTSP Elements could not be linked\n");

3. Setting the pipeline to playing state :
gst_element_set_state (pipeline, GST_STATE_PLAYING);

The last step seems to block and does not start the pipeline. It continues to block.
Please help.

Thanks & Regards,

Dilip Yadav
Embedded Software Engineer
A. Paul Instruments Pvt. Ltd.
Office: +911140524822,33 Mob: 09582153178


gstreamer-devel mailing list
[hidden email]