Hello everyone, I am trying to replicate the following "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" .<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 <stdio.h></div>
<div>#include <gst/gst.h></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("STARTING %d \n",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 (&argc, &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("pipeline"));</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>printf("Created Pipeline\n");</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("rtspsrc","source");</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>g_object_set(G_OBJECT(source),"location","rtsp://<a href="http://10.10.10.3:554">10.10.10.3:554</a>",NULL);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>printf("Created SRC\n");</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("rtph264depay","demux");</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>printf("Created Demux\n");</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("mpegtsmux","mux");</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>printf("Created Mux\n");</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("filesink","dest");</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>g_object_set(G_OBJECT(dest),"location","output.ts",NULL);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>printf("Created Output\n");</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("Done Linking\n");</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("Added Elements To Pipe\n");</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("CSet State\n");</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("Starting Loop...\n");</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("done\n");</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>return 0;</div><div>}</div></div><div><br></div></div>