<div dir="ltr"><div>Hi.<br><br></div>I'm playing a rtmp stream passed through nginx with the rtmp module added. My problem is that I can't play the stream reliably. The pipeline sometimes fail 3 out of 4 times with the messages:<br><br><div style="margin-left:40px">Redistribute latency...<br>WARNING: from element /GstPipeline:pipeline0/GstFlvDemux:demux: Delayed linking failed.<br>Additional debug info:<br>./grammar.y(506): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstFlvDemux:demux:<br>failed delayed linking some pad of GstFlvDemux named demux to some pad of GstQueue named queue2<br><br></div><div>The playing pipeline is this:<br><br><div style="margin-left:40px">QUEUE="queue max-size-time=0 max-size-bytes=0 max-size-buffers=0"<br>LOCATION=rtmp://<a href="http://192.168.3.100/live/mykey3">192.168.3.100/live/mykey3</a><br><br>gst-launch-1.0 -v                        \<br>        rtmpsrc location=$LOCATION      !\<br>        $QUEUE                          !\<br>        flvdemux name=demux             !\<br>        $QUEUE                          !\<br>        aacparse                        !\<br>        avdec_aac                       !\<br>        autoaudiosink sync=0 demux.     !\<br>        $QUEUE                          !\<br>        h264parse                       !\<br>        avdec_h264                      !\<br>        $QUEUE                          !\<br>        videoconvert                    !\<br>        autovideosink sync=0<br><br></div></div><div>Is there a way to make the pipeline play the stream reliably (play every time)?<br></div><div>Enabling debugging suggest the demuxer get filled whatever that means. Debug:<br><br>0:00:06.298664848 28766      0x2573b70 WARN                 default grammar.y:506:gst_parse_no_more_pads:<demux> warning: Delayed linking failed.<br>0:00:06.298728893 28766      0x2573b70 WARN                 default grammar.y:506:gst_parse_no_more_pads:<demux> warning: failed delayed linking some pad of GstFlvDemux named demux to some pad of GstQueue named queue3<br>0:00:06.298792450 28766      0x2573b70 INFO        GST_ERROR_SYSTEM gstelement.c:1879:gst_element_message_full:<demux> posting message: Delayed linking failed.<br>0:00:06.298904128 28766      0x2573b70 INFO        GST_ERROR_SYSTEM gstelement.c:1902:gst_element_message_full:<demux> posted warning message: Delayed linking failed.<br>WARNING: from element /GstPipeline:pipeline0/GstFlvDemux:demux: Delayed linking failed.<br><br></div><div>The stream is generated with the following pipeline:<br><br><div style="margin-left:40px">VIDSRC="v4l2src ! video/x-raw,width=320,height=240"<br>AUDSRC="alsasrc"<br>gst-launch-1.0 -v \<br>        $AUDSRC                                         !\<br>        'audio/x-raw,channels=2,rate=44100,layout=interleaved,format=S16LE' !\<br>        audioconvert                                    !\<br>        queue                                           !\<br>        faac bitrate=128000                             !\<br>        aacparse                                        !\<br>        queue ! muxer.                                   \<br>        $VIDSRC                                         !\<br>        queue                                           !\<br>        videoconvert                                    !\<br>        x264enc speed-preset=1 tune=zerolatency         !\<br>        h264parse                                       !\<br>        queue                                           !\<br>        flvmux name=muxer streamable=true               !\<br>        queue                                           !\<br>        rtmpsink location="rtmp://<a href="http://127.0.0.1/live/mykey3">127.0.0.1/live/mykey3</a> app=live flashVer=FME/3.0%20(compatible;%20FMSc%201.0) swfUrl=rtmp://<a href="http://127.0.0.1/live">127.0.0.1/live</a>" blocksize=4096 sync=0<br><br></div></div><div>The nginx rtmp relay is setup with the following config so absolutely nothing special. All it does is that it forward any rtmp stream sent to it as it is sent. That means that if you send using this location:<br><br><div style="margin-left:40px">rtmp://<a href="http://127.0.0.1/live/mykey3">127.0.0.1/live/mykey3</a><br></div><br></div><div>then you can retrieve it as rtmp://<a href="http://127.0.0.1/live/mykey3">127.0.0.1/live/mykey3</a> using gstreamers rtmpsrc module:<br></div><div><br><div style="margin-left:40px">rtmp {<br>        server {<br>                listen 1935;<br>                chunk_size 4096;<br>                application live {<br>                        live on;<br>                        record off;<br>                        allow publish 127.0.0.1;<br>                        allow publish <a href="http://193.88.237.0/24">193.88.237.0/24</a>;<br>                        allow publish <a href="http://192.168.3.0/24">192.168.3.0/24</a>;<br>                        allow publish <a href="http://192.168.10.0/24">192.168.10.0/24</a>;<br>                        deny publish all;<br>                }<br>        }<br>}<br></div><br></div><div>Any suggestion on how to make a pipeline playing the rtmp stream every single time?<br><br></div><div>Second question or perhaps a hint of the problem. When the pipeline plays the stream, audio frames starts flowing to the autoaudiosink at approx the same time the video start to appear, but while the video is only 200-300 ms behind, the audio is between 2-6 seconds behind. And here we have no sync what so ever on the audio and video sinks. If sync is enabled on video, video will lag not a few hundred ms but several seconds, if it plays at all. <br></div><div><br></div><div>Best regards<br></div><div>Peter<br></div></div>