Multiple Streams via UDP While Limiting Bandwidth

Sebastian Dröge sebastian at
Fri Apr 29 06:49:05 UTC 2016

On Do, 2016-04-28 at 19:26 -0700, hoene wrote:
> My goal is to send two video streams from one computer to another and limit
> the bandwidth being used as much as possible. I have no problem doing this
> in one pipeline if I just send each source to a different port. However, I
> figured it would be better to mux the streams together when transmitting and
> demux when receiving. I have tried using mpegtsmux and tsdemux, but I can't
> find how to split the streams apart on the receiving end.
> -Here is the transmitting pipeline:
> [...]
> gst.parse_launch('udpsrc port=1234 caps="video/mpegts,
> systemstream=(boolean)true, packetsize=(int)188" ! tsdemux ! ffdec_h264 !
> xvimagesink sync=false')
> I need to figure out how I can access both streams.

tsdemux is emitting the pad-added signal for each stream it detects. In
your case it will do that twice and then you can link the next elements
to it.

gst.parse_launch() is doing a lot behind the scenes for making this
easier, so what you could do there is something like

... ! tsdemux name=d ! queue ! ffdec_h264 ! xvimagesink   d. ! queue ! ffdec_h264 ! xvimagesink

Also you seem to be using GStreamer 0.10, this is not a good idea. This
release series is no longer maintained since more than 3 years now and
you're unlikely to get any support for any problems you find.
Use one of the stable 1.x releases, e.g. the latest 1.8.1.

>  Or is streaming to separate ports fine?

That depends on if your codecs can be streamed without container and if
you don't need synchronization between them.

You should ideally also use RTP for sending media via UDP, in which
case it wouldn't matter that you send via different ports if you do the
setup of the streams correctly.

Sebastian Dröge, Centricular Ltd ·
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the gstreamer-devel mailing list