splitmuxsink & mpegtsmux

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

splitmuxsink & mpegtsmux

Brian A
Hello,

I am having basic trouble using the two elements splitmuxsink & mpegtsmux in a C program.  Any help would be greatly appreciated.

[I have compiled and installed gstreamer 1.12.3 & plugins (base, libav, good, bad, ugly) - previously tried unsuccessfully with 1.10.4]

Checking documentation, searching the gstreamer-devel lists and googling, have got me so far...

Data is produced with line 1 - and I'm trying to replicate (the correctly working) line 2, in code:

         (1) gst-launch-1.0 -v -e  videotestsrc  ! x264enc  ! rtph264pay  ! udpsink host=127.0.0.1 port=5004

         (2) gst-launch-1.0 -e udpsrc buffer-size=524288 port=5004 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! queue ! splitmuxsink muxer=mpegtsmux max-size-time=10000000000 location=test%05d.ts

Synopsis:
        Linked: udpsrc--> rtph264depay-->queue, with gst_element_link()

        Linked pads: splitmuxsink-->queue, with gst_element_get_request_pad(), gst_element_get_compatible_pad() & gst_pad_link()

        Muxer property of splitmuxsink, set, thus: g_object_set (data.splitmuxsink, "muxer", data.mpegtsmux, NULL);

Full code, here: https://pastebin.com/xLcdhXTE

Error:
        Error received from element udpsrc-element: Internal data stream error.
        Debugging information: gstbasesrc.c(2939): gst_base_src_loop (): /GstPipeline:test-pipeline/GstUDPSrc:udpsrc-element:
        streaming stopped, reason not-negotiated (-4)

I'm confused by the apparent problem at the front of the pipeline - i.e. udpsrc; and TBH the debug info didn't enlighten me. I'm new to gstreamer.

I don't believe I need to link the pads from splitmuxsink-->mpegtsmux ... but I tried, in case. This makes no difference.

I also tried adding mpegtsmux to the bin (line 52); again, no difference.

Thanks in advance.

Brian.
------------------------------------------------------------------------------

This email and any files attached are intended for the addressee and may contain information of a confidential nature. If you are not the intended recipient, be aware that this email was sent to you in error and you should not disclose, distribute, print, copy or make other use of this email or its attachments. Such actions, in fact, may be unlawful. In compliance with the various Regulations and Acts, General Dynamics United Kingdom Limited reserves the right to monitor (and examine for viruses) all emails and email attachments, both inbound and outbound. Email communications and their attachments may not be secure or error- or virus-free and the company does not accept liability or responsibility for such matters or the consequences thereof. General Dynamics United Kingdom Limited, Registered Office: 21 Holborn Viaduct, London EC1A 2DY. Registered in England and Wales No: 1911653.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: splitmuxsink & mpegtsmux

Tim Müller
On Mon, 2017-09-18 at 17:41 +0000, [hidden email] wrote:

Hi Brian,

> Synopsis: 
> Linked: udpsrc--> rtph264depay-->queue, with gst_element_link()
>
> Linked pads: splitmuxsink-->queue, with
> gst_element_get_request_pad(), gst_element_get_compatible_pad() &
> gst_pad_link()
>
> Muxer property of splitmuxsink, set, thus: g_object_set
> (data.splitmuxsink, "muxer", data.mpegtsmux, NULL);
>
> Full code, here: https://pastebin.com/xLcdhXTE
>
> Error:
> Error received from element udpsrc-element: Internal data
> stream error.
> Debugging information: gstbasesrc.c(2939): gst_base_src_loop
> (): /GstPipeline:test-pipeline/GstUDPSrc:udpsrc-element:
> streaming stopped, reason not-negotiated (-4)
>
> I'm confused by the apparent problem at the front of the pipeline -
> i.e. udpsrc; and TBH the debug info didn't enlighten me. I'm new to
> gstreamer.
>
> I don't believe I need to link the pads from splitmuxsink-->mpegtsmux
> ... but I tried, in case. This makes no difference.
>
> I also tried adding mpegtsmux to the bin (line 52); again, no
> difference.

I added a

  GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (data->pipeline),
      GST_DEBUG_GRAPH_SHOW_ALL, "error");

in your GST_MESSAGE_ERROR handler, then ran your code with

 $ GST_DEBUG_DUMP_DOT_DIR=/tmp ./gstreamer_splitmuxsink_mpegtsmux

and then looked at the .dot file with xdot. I noticed that the muxer
used inside splitmuxsink is mp4mux. I think this happens because the
muxer gets instantiated when you request the video pad.


To fix your problem, move the line

  g_object_set (data.splitmuxsink, "muxer", data.mpegtsmux, NULL);

before the

  sinkpad = gst_element_get_request_pad (data.splitmuxsink, "video");

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

Join us at the GStreamer Conference!
21-22 October 2017 in Prague, Czech Republic
http://gstreamer.freedesktop.org/conference/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: splitmuxsink & mpegtsmux

Tim Müller
PS: you may also want an rtpjitterbuffer between udpsrc and the
rtph264depay.

--
Tim Müller, Centricular Ltd - http://www.centricular.com

Join us at the GStreamer Conference!
21-22 October 2017 in Prague, Czech Republic
http://gstreamer.freedesktop.org/conference/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: splitmuxsink & mpegtsmux

Brian A
Many thanks Tim - the debug info is also a great help!



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel