This post was updated on .
For a little context, I am trying to create a pipeline that streams a video source to an RTSP server while writing it to file. I can get these components to work independently. But combining them with a tee causes issues.
For simplicity, we'll replace the RTSP server with a simple ximagesink, as provided in this example: https://stackoverflow.com/questions/40260580/gstreamer-shmsrc-and-shmsink-with-h264-data. The following couple of pipelines work fine together: gst-launch-1.0 -e videotestsrc is-live=true ! x264enc speed-preset=ultrafast tune=zerolatency ! tee name=tee0 \ tee0. ! shmsink socket-path=/tmp/test/gstshm sync=true wait-for-connection=false shm-size=10000000 gst-launch-1.0 -e shmsrc socket-path=/tmp/test/gstshm is-live=true do-timestamp=true ! h264parse ! avdec_h264 ! videoconvert ! ximagesink Likewise, this pipeline that writes to disk works fine: gst-launch-1.0 -e videotestsrc is-live=true ! x264enc speed-preset=ultrafast tune=zerolatency ! tee name=tee0 \ tee0. ! queue ! mp4mux moov-recovery-file=test.atom ! filesink location=test.mp4 However, the following combinations does not work: GST_DEBUG=2 gst-launch-1.0 -e videotestsrc is-live=true ! x264enc speed-preset=ultrafast tune=zerolatency ! tee name=tee0 \ tee0. ! queue ! mp4mux moov-recovery-file=test.atom ! filesink location=test.mp4 \ tee0. ! shmsink socket-path=/tmp/test/gstshm sync=true wait-for-connection=false shm-size=10000000 GST_DEBUG=2 gst-launch-1.0 -e shmsrc socket-path=/tmp/test/gstshm is-live=true do-timestamp=true ! h264parse ! avdec_h264 ! videoconvert ! ximagesink The filesink branch works fine, producing a working file. Yet, the shm branch fails. While it does create the shm socket file, the client hangs with the following log: Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock and after I interrupt it... handling interrupt. Interrupt: Stopping pipeline ... EOS on shutdown enabled -- Forcing EOS on the pipeline Waiting for EOS... 0:00:54.673698050 7690 0x5606ff897e30 WARN baseparse gstbaseparse.c:1329:gst_base_parse_sink_event_default:<h264parse0> error: No valid frames found before end of stream ERROR: from element /GstPipeline:pipeline0/GstH264Parse:h264parse0: No valid frames found before end of stream Additional debug info: gstbaseparse.c(1329): gst_base_parse_sink_event_default (): /GstPipeline:pipeline0/GstH264Parse:h264parse0 An error happened while waiting for EOS Execution ended after 0:00:54.606904934 Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ... Evidently, the shmsrc isn't receiving any frames. However, the log for the master pipeline reveals the shmsrc was at least somewhat connected: 0:00:59.042838666 7675 0x56295f5a8940 WARN shmsink gstshmsink.c:900:pollthread_func:<shmsink0> One client is gone, closing Interestingly, if we put the shmsink branch before the shmsrc branch, the filesink fails to produce a video file (specifically, a file is created but maintains a size of 0 bytes). I have tried different combinations of true and false values for the sync and wait-for-connection parameters, but to no avail. The posts RE: Still stuck (http://gstreamer-devel.966125.n4.nabble.com/Still-stuck-td4658949i20.html) and Problem with using shmsink/shmsrc (http://gstreamer-devel.966125.n4.nabble.com/Problem-with-using-shmsink-shmsrc-td4659936.html) were the most relevant posts I could find. I've read through them, but it's possible there's a related fix I missed. I am using GStreamer 1.14.5 on Ubuntu 18.04. Any help is appreciated! I am not opposed to exploring alternatives to shmsink/shmsrc, but any solution must have two pipelines to work with the RTSP server later on. EDIT: Added logs as plaintext because the < raw > tag removed them for whatever reason. |
Quick update for the mailing list: Some of the text in the original post got
screwed up, so I edited the original post. Check the forum for the corrected version. -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |