<div dir="ltr"><div><div><div>Superficially your code seems correct. I am not sure about setting the byte-stream property on rtph264depay to false. It should do that automatically when it encounters the SPS/PPS headers and an I-Frame.<br>
<br></div>You need to find why it isn't working. That implies GStreamer logging. Google 'gstreamer logging' and you will get many articles explaining how to do that. I am sorry but you are using Windows and I don't know the syntax.<br>
<br></div>You could also install a 'T' after the capsfilter and have one branch go to the recording and another to display on the screen simultaneously. That is also very helpful. Look up the documentation for the GStreamer 'tee' element. It is easy to use but the syntax for GST-LAUNCH is a bit unusual. You can and should include that in your C program. It is always better to know that the pipeline is able to run and process data while it is supposed to be running than finding out afterwards that it didn't.<br>
<br></div>Good luck<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 6, 2013 at 11:02 AM, Raja Poonati <span dir="ltr"><<a href="mailto:rpoonati@extron.com" target="_blank">rpoonati@extron.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div link="blue" vlink="purple" lang="EN-GB">
<div>
<p class="MsoNormal">Hi,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I am trying to create an application that records RTSP/RTP stream to a MP4 file.
</p>
<p class="MsoNormal">I am able to record the stream using gst-launch in the following way as mentioned below.
</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><i>gst-launch-0.10.exe rtspsrc location=rtsp://<a href="http://streaming1.osu.edu/media2/ufsap/ufsap.mov" target="_blank">streaming1.osu.edu/media2/ufsap/ufsap.mov</a> !  rtph264depay byte-stream=false ! capsfilter caps="video/x-h264,width=320,height=240,framerate=(fraction)25/1" ! mp4mux ! filesink location=d:\\test\\dump.mp4</i></p>

<p class="MsoNormal"> </p>
<p class="MsoNormal" style="text-autospace:none">Recording is not working, when I follow same steps in my application. I get NULL caps, when I make “gst_pad_get_negotiated_caps” call on<span style="font-size:9.0pt;font-family:Consolas">
</span>rtph264depay source pad after linking rtph264depay and mp4mux elements.</p>
<p class="MsoNormal" style="text-autospace:none">The dot files generated using my application and gst-launch are also slightly different. The .dot files are also attached to this message.<span style="font-size:9.0pt;font-family:Consolas"></span></p>

<p class="MsoNormal"> </p>
<p class="MsoNormal">Can someone please help me with this?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Please find the source file attached. Here are the steps I followed in the application.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">main function </p>
<p><span style="font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman"">        
</span></span></span>Creates rtspsrc, rtph264depay, mp4mux and elements </p>
<p><span style="font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman"">        
</span></span></span>Sets location property of rtspsrc to “rtsp://<a href="http://streaming1.osu.edu/media2/ufsap/ufsap.mov" target="_blank">streaming1.osu.edu/media2/ufsap/ufsap.mov</a>”</p>
<p><span style="font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman"">        
</span></span></span>Attaches a signal handler “pad_added_handler” to pad-added on rtspsrc</p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas"> </span></p>
<p class="MsoNormal">pad_added_handler function</p>
<p><span style="font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman"">        
</span></span></span>Checks if it is application/x-rtp and H264 type</p>
<p><span style="font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman"">        
</span></span></span>Sets byte-stream property on rtph264depay to false</p>
<p><span style="font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman"">        
</span></span></span>Links new pad and sink pad on rtph264depay</p>
<p><span style="font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman"">        
</span></span></span>Creates cap element with gst_caps_new_simple( "video/x-h264", ”width", G_TYPE_INT, 320, "height", G_TYPE_INT, 240,"framerate", GST_TYPE_FRACTION, 25, 1, NULL)</p>
<p><span style="font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman"">        
</span></span></span>Links rtph264depay and mp4mux using created caps</p>
<p><span style="font-family:Symbol"><span>·<span style="font:7.0pt "Times New Roman"">        
</span></span></span>Links mp4mux and filesink</p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas;color:#a31515"> </span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas;color:#a31515"> </span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas;color:#a31515"> </span></p>
<p class="MsoNormal">Regards,</p>
<p class="MsoNormal">Raja</p>
</div>
<br>
<hr>
<font color="Gray" face="Arial" size="1"><br>
<br>
Statement Of Confidentiality:<br>
<br>
This electronic message transmission, and all attachments, contains information from Extron Electronics which is confidential and privileged. The information is for the exclusive viewing or use of the intended recipient. If you are not the intended recipient,
 be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic transmission in error, please notify the sender immediately by a "reply to sender only" message and destroy all
 electronic and hard copies of the communication, including attachments.<br>
</font>
</div>

<br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br></div>