[gst-devel] multipoint rtp streams?
Dirk Griffioen
dirk.griffioen at barcelonamedia.org
Wed Oct 21 11:44:40 CEST 2009
Hi Wim,
Thanks for the reply!
I had a look at it and it was quite helpful ...
I came up with the following python example that seems to do the
streaming. I'll post it below, maybe someone finds it usefull.
Best regards, Dirk
//////
import gst
host1 = "127.0.0.1"
port1 = 1234
host2 = "192.168.0.1"
port2 = 4321
audiotestsrc = gst.element_factory_make("audiotestsrc")
audioconvert = gst.element_factory_make("audioconvert")
rtprawpay = gst.element_factory_make("rtpL16pay")
multiudpsink = gst.element_factory_make("multiudpsink")
pipeline = gst.Pipeline('server')
pipeline.add(audiotestsrc, audioconvert, rtprawpay, multiudpsink)
gst.element_link_many(audiotestsrc, audioconvert, rtprawpay, multiudpsink)
def client_added(sink, host, port):
print host, ":", port
multiudpsink.connect("client_added", client_added)
multiudpsink.emit("add", host1, port1)
multiudpsink.emit("add", host2, port2)
def print_stats():
def _print(data, host, port):
stats = "%s:%s bytes_sent: %s, packets_sent: %s, connect_time:
%s" %(host, port, data[0], data[1], data[2])
print stats
data = multiudpsink.emit("get_stats", host1, port1)
_print(data, host1, port1)
data = multiudpsink.emit("get_stats", host2, port2)
_print(data, host2, port2)
return True
import glib
glib.timeout_add_seconds(1, print_stats)
pipeline.set_state(gst.STATE_PLAYING)
import gtk
gtk.main()
> gst-rtsp-server uses it when the media can be shared between clients.
> Like here: http://cgit.freedesktop.org/gstreamer/gst-rtsp-server/tree/gst/rtsp-server/rtsp-media.c#n1487
>
> Wim
>
> On Mon, Oct 19, 2009 at 8:32 AM, Dirk Griffioen
> <dirk.griffioen at barcelonamedia.org> wrote:
>
>> Hi Wim,
>>
>> Thanks for the reply!
>>
>> I would like to know if it is possible to stream 1 source to multiple
>> destinations with the rtp pipeline by adding more udpsinks.
>>
>>
>> Check out multiudpsink.
>>
>>
>>
>> Sadly, Google did not point me to an example of how to use this, but I
>> presume by looking at the documentation I have to use the 'add' signal?
>>
>> Which I think means I cannot do it from the commandline, but need Python or
>> C.
>>
>> Could you maybe give me hint on it's use?
>>
>> Best regards, Dirk
>>
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>>
>>
>>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20091021/3488ee3a/attachment.htm>
More information about the gstreamer-devel
mailing list