Hello everyone, I am trying to replicate the following &quot;gst-launch rtspsrc location=rtsp://<a href="http://10.10.10.3:554">10.10.10.3:554</a> ! rtph264depay ! mpegtsmux ! filesink location=out.ts&quot;  .<div><br></div>
<div>This line works in producing video output but when the following code is used the output file is always 0 in size. Any pointers on why this might be happening would be appreciated<br><div><br></div><div><div>#include &lt;stdio.h&gt;</div>
<div>#include &lt;gst/gst.h&gt;</div><div><br></div><div>int main (int argc, char *argv[])</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>printf(&quot;STARTING %d \n&quot;,1);</div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//Init</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_init (&amp;argc, &amp;argv);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//Get Ready</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>GstPipeline *pipeline = GST_PIPELINE(gst_pipeline_new(&quot;pipeline&quot;));</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>printf(&quot;Created Pipeline\n&quot;);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//Prep Source</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *source = gst_element_factory_make(&quot;rtspsrc&quot;,&quot;source&quot;);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>g_object_set(G_OBJECT(source),&quot;location&quot;,&quot;rtsp://<a href="http://10.10.10.3:554">10.10.10.3:554</a>&quot;,NULL);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>printf(&quot;Created SRC\n&quot;);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//Prep Decode</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *demux =gst_element_factory_make(&quot;rtph264depay&quot;,&quot;demux&quot;);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>printf(&quot;Created Demux\n&quot;);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//Prep Encode</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *mux = gst_element_factory_make(&quot;mpegtsmux&quot;,&quot;mux&quot;);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>printf(&quot;Created Mux\n&quot;);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//prep output</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>GstElement *dest = gst_element_factory_make(&quot;filesink&quot;,&quot;dest&quot;);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>g_object_set(G_OBJECT(dest),&quot;location&quot;,&quot;output.ts&quot;,NULL);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>printf(&quot;Created Output\n&quot;);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//Link</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_element_link_many(source,demux,mux,dest,NULL);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>printf(&quot;Done Linking\n&quot;);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//Add</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>gst_bin_add_many(GST_BIN(pipeline),source,demux,mux,dest,NULL);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>printf(&quot;Added Elements To Pipe\n&quot;);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div>
<span class="Apple-tab-span" style="white-space:pre">        </span>gst_element_set_state(GST_ELEMENT(pipeline),GST_STATE_PLAYING);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>printf(&quot;CSet State\n&quot;);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>GMainLoop *loop = g_main_loop_new(NULL,FALSE);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>printf(&quot;Starting Loop...\n&quot;);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>g_main_loop_run(loop);</div><div>  </div><div><br></div><div>  </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>printf(&quot;done\n&quot;);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>return 0;</div><div>}</div></div><div><br></div></div>