Migrating to gstreamer-1.0: cannot stream mpegts over udp

Tim-Philipp Müller t.i.m at zen.co.uk
Sun Jan 20 15:35:41 PST 2013


On Mon, 2013-01-21 at 00:07 +0100, Robert Szelepcsenyi wrote:

Hi Robert,

> I need to migrate a simple transcoer from gstreamer-0.10 to
> gstreamer-1.0. It accepts an mpeg2ts stream over UDP (a satelite
> program streamed by getstream for example), transcodes video and audio
> into h264 and aac respectively and then rebroadcasts it again as
> mpeg2ts over udp.
> 
> The problem is that in gstreamer-1.0 I am unable to stream mpeg2ts over
> udp correctly, i.e. one PES packet per one UDP packet. udpsink
> generates huge packets and also some other junk that shows as ip
> protocol 17 in tcpdump.

I am not sure if "one PES packet per one UDP packet" is how to stream
mpeg-ts "correctly" over UDP. I believe any number of mpeg-ts packets
per UDP packet is "correct", but one would usually send ca. 7 mpeg-ts
packets of 188 bytes per UDP packet, to avoid fragmentation at the lower
layers.

Ideally mpegtsmux would discover this mode of operation automatically,
but it doesn't do that yet. In the mean time, you could work around this
by (ab)using an rndbuffersize element to force the desired
packetization, e.g.

 .... ! rndbuffersize min=1316 max=1316 ! udpsink


> Gstreamer-0.10 contained flutsmux, which generated correct packets.
> However, i cannot find this plugin in gstreamer-1.0.

This element is/was provided by a third party, not part of upstream
GStreamer, so you'd have to ask them for a version ported to 1.0. (The
mpegtsmux element is based on flutsmux's codebase, however.)


> Another option in gstreamer-0.10 was to send the output from mpegtsmux
> through mpegtsparse, which is also gone in gstreamer-1.0. I have found
> tsparse, which is probably a replacement, but it does not help to split
> mpegts into small packets.

Hopefully the above workaround works for splitting packets (without the
additional parsing overhead). Ideally this should be negotiated between
udpsink and the muxer directly, so the muxer can output buffers of the
right size directly. (This problem also existed with mpegtsmux in 0.10
btw, as far as I am aware.)


> Another problem is that i cannot process audio in any way. A pipeline
> like this:
> 
> gst-launch-1.0 -vvv \
> udpsrc uri=udp://127.0.0.1:8006 ! \
> tsdemux ! mad ! queue2 ! audioconvert ! faac ! \
> mpegtsmux ! udpsink host=192.168.1.110 port=1234
> 
> causes a totallz cryptic error "Internal data flow error".

Hard to say what the problem is here without more information. What is
the 'error detail' part of the error message? (not-linked?
not-negotiated? error? etc.)

Perhaps you could make a GST_DEBUG=*:6 log, xz -9 it and put it up
somewhere?

Does gst-launch-1.0 -v audiotestsrc ! faac ! mpegtsmux ! fakesink
silent=false work for you ?

 Cheers
  -Tim



More information about the gstreamer-devel mailing list