Application to record an RTSP/RTP stream to MP4 using gstreamer

Raja Poonati rpoonati at extron.com
Fri Sep 6 08:02:04 PDT 2013


Hi,

I am trying to create an application that records RTSP/RTP stream to a MP4 file.
I am able to record the stream using gst-launch in the following way as mentioned below.

gst-launch-0.10.exe rtspsrc location=rtsp://streaming1.osu.edu/media2/ufsap/ufsap.mov !  rtph264depay byte-stream=false ! capsfilter caps="video/x-h264,width=320,height=240,framerate=(fraction)25/1" ! mp4mux ! filesink location=d:\\test\\dump.mp4

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 rtph264depay source pad after linking rtph264depay and mp4mux elements.
The dot files generated using my application and gst-launch are also slightly different. The .dot files are also attached to this message.

Can someone please help me with this?

Please find the source file attached. Here are the steps I followed in the application.

main function

*         Creates rtspsrc, rtph264depay, mp4mux and elements

*         Sets location property of rtspsrc to "rtsp://streaming1.osu.edu/media2/ufsap/ufsap.mov"

*         Attaches a signal handler "pad_added_handler" to pad-added on rtspsrc

pad_added_handler function

*         Checks if it is application/x-rtp and H264 type

*         Sets byte-stream property on rtph264depay to false

*         Links new pad and sink pad on rtph264depay

*         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)

*         Links rtph264depay and mp4mux using created caps

*         Links mp4mux and filesink



Regards,
Raja

________________________________


Statement Of Confidentiality:

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130906/4d17ac7e/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: main.cpp
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130906/4d17ac7e/attachment-0001.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gst-launch-generated.dot
Type: application/msword
Size: 30145 bytes
Desc: gst-launch-generated.dot
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130906/4d17ac7e/attachment-0002.dot>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: myapp-generated.dot
Type: application/msword
Size: 30954 bytes
Desc: myapp-generated.dot
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130906/4d17ac7e/attachment-0003.dot>


More information about the gstreamer-devel mailing list