multipoint rtp streams?

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

multipoint rtp streams?

Dirk Griffioen-2
Hi All,

I would like to know if it is possible to stream 1 source to multiple
destinations with the rtp pipeline by adding more udpsinks.

For example I tried:

REMOTE_HOST1=127.0.0.1
REMOTE_HOST2=192.168.0.1

gst-launch -v gstrtpbin name=rtpbin \
    jackaudiosrc connect=none ! audio/x-raw-float, channels=8 ! \
    vorbisenc quality=0.3 ! rtpvorbispay ! \
\
rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink port=5000
host=$REMOTE_HOST1 ts-offset=0  \
rtpbin.send_rtcp_src_0 ! udpsink port=5001 host=$REMOTE_HOST1 sync=false
async=false  \
udpsrc port=5002 ! rtpbin.recv_rtcp_sink_0 \
\
rtpbin.send_rtp_sink_1 rtpbin.send_rtp_src_1 ! udpsink port=5003
host=$REMOTE_HOST2 ts-offset=0  \
rtpbin.send_rtcp_src_1 ! udpsink port=5004 host=$REMOTE_HOST2 sync=false
async=false  \
udpsrc port=5005 ! rtpbin.recv_rtcp_sink_1

But this gives me the following after some time:

ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal
data flow error.
Additional debug info:
gstbasesrc.c(2378): gst_base_src_loop ():
/GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming task paused, reason not-linked (-1)

Then I added a queue so both udpsinks could read from that, but I cant
seem to get the syntax right.

Hints or pointers are very much appreciated. Thanks in advance!

Best, 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: multipoint rtp streams?

Wim Taymans
On Mon, 2009-10-19 at 11:47 +0200, Dirk Griffioen wrote:
> Hi All,
>
> 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.

Wim

>
> For example I tried:
>
> REMOTE_HOST1=127.0.0.1
> REMOTE_HOST2=192.168.0.1
>
> gst-launch -v gstrtpbin name=rtpbin \
>     jackaudiosrc connect=none ! audio/x-raw-float, channels=8 ! \
>     vorbisenc quality=0.3 ! rtpvorbispay ! \
> \
> rtpbin.send_rtp_sink_0 rtpbin.send_rtp_src_0 ! udpsink port=5000
> host=$REMOTE_HOST1 ts-offset=0  \
> rtpbin.send_rtcp_src_0 ! udpsink port=5001 host=$REMOTE_HOST1 sync=false
> async=false  \
> udpsrc port=5002 ! rtpbin.recv_rtcp_sink_0 \
> \
> rtpbin.send_rtp_sink_1 rtpbin.send_rtp_src_1 ! udpsink port=5003
> host=$REMOTE_HOST2 ts-offset=0  \
> rtpbin.send_rtcp_src_1 ! udpsink port=5004 host=$REMOTE_HOST2 sync=false
> async=false  \
> udpsrc port=5005 ! rtpbin.recv_rtcp_sink_1
>
> But this gives me the following after some time:
>
> ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal
> data flow error.
> Additional debug info:
> gstbasesrc.c(2378): gst_base_src_loop ():
> /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
> streaming task paused, reason not-linked (-1)
>
> Then I added a queue so both udpsinks could read from that, but I cant
> seem to get the syntax right.
>
> Hints or pointers are very much appreciated. Thanks in advance!
>
> Best, 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
> [hidden email]
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: multipoint rtp streams?

Dirk Griffioen-2
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: multipoint rtp streams?

Wim Taymans
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
<[hidden email]> 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
> [hidden email]
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: multipoint rtp streams?

Dirk Griffioen-2
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
[hidden email] 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
[hidden email]
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
[hidden email]
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel