<div dir="ltr"> Hi. I have a pipeline which receives h264 video stream:<div><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">rtspsrc</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">location=rtsp://%1:%2/vd</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">latency=0</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">tcp-timeout=2000000</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">protocols=GST_RTSP_LOWER_TRANS_TCP</span><span style="color:rgb(192,192,192)"> </span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">application/x-rtp,encoding-name=H264,payload=96</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">rtph264depay</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">name=prs0</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">h264parse</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">tee</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">name=t</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">t.</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">queue</span><span style="color:rgb(192,192,192)"> </span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">avdec_h264</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">videoconvert</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">video/x-raw,format=(string)BGR</span><span style="color:rgb(192,192,192)"> </span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(0,128,0)">!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">appsink</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">name=flowsink</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">t.</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">queue</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">qtmux</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">!</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">filesink</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">location=%3.mov</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">sync=false</span></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000"><br></font></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#000000">Here is a part of code where i try to finish it correct:</font></pre><pre style="margin-top:0px;margin-bottom:0px"><font color="#008000"><br></font></pre><pre style="margin-top:0px;margin-bottom:0px"><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">     </span><span style="color:rgb(0,0,128)">qDebug</span>()<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,103,124)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"clear</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">buffer"</span>;</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">for</span><span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(128,128,0)">auto</span>&<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">i</span><span style="color:rgb(192,192,192)"> </span>:<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,0)">frameBuffer</span>)</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>{</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(0,103,124)">gst_buffer_unmap</span>(<span style="color:rgb(128,0,128)">std</span>::<span style="color:rgb(0,103,124)">get</span><span style="color:rgb(192,192,192)"> </span><<span style="color:rgb(128,0,128)">GstBuffer</span>*><span style="color:rgb(192,192,192)"> </span>(<span style="font-style:italic;color:rgb(9,46,100)">i</span>),<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(128,0,128)">std</span>::<span style="color:rgb(0,103,124)">get</span><span style="color:rgb(192,192,192)"> </span><<span style="color:rgb(128,0,128)">GstMapInfo</span>><span style="color:rgb(192,192,192)"> </span>(<span style="font-style:italic;color:rgb(9,46,100)">i</span>));</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(0,103,124)">gst_sample_unref</span>(<span style="color:rgb(128,0,128)">std</span>::<span style="color:rgb(0,103,124)">get</span><span style="color:rgb(192,192,192)"> </span><<span style="color:rgb(128,0,128)">GstSample</span>*><span style="color:rgb(192,192,192)"> </span>(<span style="font-style:italic;color:rgb(9,46,100)">i</span>));</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>}</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(0,0,128)">qDebug</span>()<span style="color:rgb(192,192,192)"> </span><<<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"send</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">eos"</span>;</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(0,103,124)">gst_element_send_event</span>(<span style="color:rgb(128,0,0)">pipeline</span>,<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,103,124)">gst_event_new_eos</span>()))</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">        </span>{</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(0,0,128)">qDebug</span>()<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,103,124)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"eos</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">sent"</span>;</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,0,128)">GstClockTime</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">timeout</span><span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">10</span><span style="color:rgb(192,192,192)"> </span>*<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">GST_SECOND</span>;</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,0,128)">GstMessage</span>*<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">msg</span>;</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(9,46,100)">msg</span><span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,103,124)">gst_bus_timed_pop_filtered</span><span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(0,0,128)">GST_ELEMENT_BUS</span><span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(128,0,0)">pipeline</span>),</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">           </span><span style="color:rgb(9,46,100)">timeout</span>,<span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(128,0,128)">GstMessageType</span>)(<span style="color:rgb(128,0,128)">GST_MESSAGE_EOS</span><span style="color:rgb(192,192,192)"> </span>|<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GST_MESSAGE_ERROR</span>));</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(9,46,100)">msg</span><span style="color:rgb(192,192,192)"> </span>==<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">NULL</span>)</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>{</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span><span style="color:rgb(0,0,128)">qDebug</span>()<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,103,124)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"NO</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">END</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">OF</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">STREAM"</span>;</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>}</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">else</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(0,0,128)">GST_MESSAGE_TYPE</span><span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(9,46,100)">msg</span>)<span style="color:rgb(192,192,192)"> </span>==<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,0,128)">GST_MESSAGE_ERROR</span>)</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>{</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span><span style="color:rgb(128,0,128)">GError</span><span style="color:rgb(192,192,192)"> </span>*<span style="color:rgb(9,46,100)">err</span><span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">NULL</span>;</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span><span style="color:rgb(128,0,128)">gchar</span><span style="color:rgb(192,192,192)"> </span>*<span style="color:rgb(9,46,100)">dbg_info</span><span style="color:rgb(192,192,192)"> </span>=<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,0,128)">NULL</span>;</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span><span style="color:rgb(0,103,124)">gst_message_parse_error</span><span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(9,46,100)">msg</span>,<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(9,46,100)">err</span>,<span style="color:rgb(192,192,192)"> </span>&<span style="color:rgb(9,46,100)">dbg_info</span>);</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span><span style="color:rgb(0,0,128)">qDebug</span>()<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,103,124)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"ERROR"</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,103,124)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">err</span>-><span style="color:rgb(128,0,0)">message</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,103,124)"><<</span><span style="color:rgb(192,192,192)"> </span>((<span style="color:rgb(9,46,100)">dbg_info</span>)<span style="color:rgb(192,192,192)"> </span>?<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(9,46,100)">dbg_info</span><span style="color:rgb(192,192,192)"> </span>:<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"none"</span>);</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span><span style="color:rgb(0,103,124)">g_error_free</span><span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(9,46,100)">err</span>);</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span><span style="color:rgb(0,103,124)">g_free</span><span style="color:rgb(192,192,192)"> </span>(<span style="color:rgb(9,46,100)">dbg_info</span>);</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>}</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span><span style="color:rgb(128,128,0)">else</span></pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">            </span>{</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">                </span><span style="color:rgb(0,0,128)">qDebug</span>()<span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,103,124)"><<</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"END</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">OF</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">STREAM"</span>;</pre><pre style="margin-top:0px;margin-bottom:0px"><span style="color:rgb(192,192,192)">           </span>}</pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">Even if i call gst_bus_timed_pop_filtered without timeout i never get an eos or any other signal</pre><pre style="margin-top:0px;margin-bottom:0px">and can't finish the pipeline correctly...</pre><pre style="margin-top:0px;margin-bottom:0px">What can be wrong here?

</pre></pre></div></div>