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

Chuck Crisler ccrisler at mutualink.net
Mon Sep 9 11:24:48 PDT 2013


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.

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.

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.

Good luck


On Fri, Sep 6, 2013 at 11:02 AM, Raja Poonati <rpoonati at extron.com> wrote:

>  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.
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130909/8a24db34/attachment-0001.html>


More information about the gstreamer-devel mailing list