Problem restarting rtsp-stream recording pipeline
dilip yadav
yadav.dilip582 at gmail.com
Thu Jun 8 06:03:31 UTC 2017
Hi,
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://192.168.0.108/media/live/1/2 ! 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
location=video%02d.mov 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_unlink_many(rtspSource,rtpDepay,h264Parse,avDecH264,videoBox,capsfilter,textOverlay,clockOverlay,videoConvert,videoEncode,splitSink,NULL);
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");
return;
}
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:
09582153178Website: www.apaulinstruments.in
<http://www.apaulinstruments.in>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170608/c6aec3df/attachment.html>
More information about the gstreamer-devel
mailing list