Hi, all. I am a newbie to gstreamer. I am now trying build a simple pipeline to transmit video with udp between two machines.
Here are what I have done now. server: gst-launch filesrc location=new0.mpg ! mpegdemux mpegdemux0.video_00 ! { queue ! udpsink port=4400 } \ mpegdemux0.audio_00 ! { queue ! udpsink port=4401 } client: gst-launch udpsrc port=4400 ! { queue ! mpeg2dec ! xvimagesink } \ udpsrc port=4401 ! { queue ! decodebin ! audioconvert ! audioresample ! autoaudiosink } I test them in one machine. They work well. But when I tried to specify the ip address as: server: gst-launch filesrc location=new0.mpg ! mpegdemux mpegdemux0.video_00 ! { queue ! udpsink port=4400 host=192.168.0.1} \ mpegdemux0.audio_00 ! { queue ! udpsink port=4401 host=192.168.0.1 } client: gst-launch udpsrc uri=udp://192.168.0.1:4400 ! { queue ! mpeg2dec ! xvimagesink } \ udpsrc uri=udp://192.168.0.1:4401 ! { queue ! decodebin ! audioconvert ! audioresample ! autoaudiosink } Error occurs in the client. error: from element /pipeline0/udpsrc0:can't get the resource specified. (I translate the message from my local language) gstudpsrc.c(825): gst_udpsrc_start (): /pipeline0/udpsrc0: could add membership -1: invalid parameter (22) Even cannot work with using 127.0.0.1 in one machine. server: gst-launch filesrc location=new0.mpg ! mpegdemux mpegdemux0.video_00 ! { queue ! udpsink port=4400 host=127.0.0.1 } \ mpegdemux0.audio_00 ! { queue ! udpsink port=4401 host=127.0.0.1 } client: gst-launch udpsrc uri=udp://127.0.0.1 :4400 ! { queue ! mpeg2dec ! xvimagesink } \ udpsrc uri=udp://127.0.0.1 :4401 ! { queue ! decodebin ! audioconvert ! audioresample ! autoaudiosink } But using "localhost" works, gst-launch filesrc location=new0.mpg ! mpegdemux mpegdemux0.video_00 ! { queue ! udpsink port=4400 host=localhost } \ mpegdemux0.audio_00 ! { queue ! udpsink port=4401 host=localhost } client: gst-launch udpsrc uri=udp://localhost :4400 ! { queue ! mpeg2dec ! xvimagesink } \ udpsrc uri=udp://localhost :4401 ! { queue ! decodebin ! audioconvert ! audioresample ! autoaudiosink } I'm confused. Can anybody help me? Thanks very much. ------------------------------------------------------------------------------ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Hi shirie,
Just tested your pipeline on my machine. It crashes in the latter 3 cases. However, if we specify the host first and then the port in the udpsink properties of server side, the pipeline works just fine. That is, to write "host=...." first and then "port=...." IMHO, there seems to be a default order in the modification of udpsink's properties. I don't know if this is true, but you can refer to the following source: $PLUGIN_GOOD/gst/udp/gstudpsink.c, in function gst_udpsink_set_property(). The code is modifying host iff parameter prop_id =1, while prop_id is susceptible to be the order of the modification expression. I'm using the latest release of plugins-good. Don't know if it is the same case for more stable versions. I'll be very happy to see anyone to prove or disprove my guess. Regards, Lin
|
In reply to this post by shirie
Thank you very much for your reply, Lin.
I change the order of "host=" and "port=" as you said, but the same error occurs. The server side seems working normally as before, after I start the server: gst-launch filesrc location=new0.mpg ! mpegdemux mpegdemux0.video_00 ! { queue ! udpsink host=127.0.0.1 port=4400 } \ mpegdemux0.audio_00 ! { queue ! udpsink host=127.0.0.1 port=4401 } Setting pipeline to PAUSED ... Pipeline is PREROLLING ... Pipeline is PREROLLED ... Setting pipeline to PLAYING ... New clock: GstSystemClock Then the client: gst-launch udpsrc uri=udp://127.0.0.1:4400 ! { queue ! mpeg2dec ! xvimagesink } \ udpsrc uri=udp://127.0.0.1:4401 ! { queue ! decodebin ! audioconvert ! audioresample ! autoaudiosink } Setting pipeline to PAUSED ... JACK tmpdir identified as [/dev/shm] ERROR: Pipeline doesn't want to pause. Error: from element: /pipeline0/udpsrc0:can't get the resource specified. Debug information: gstudpsrc.c(825): gst_udpsrc_start (): /pipeline0/udpsrc0: could add membership -1: invalid parameter (22) Setting pipeline to NULL ... FREEING pipeline ... If I don't use "uri=upd://..." , just "port=" on the client side, everything goes well. Where am I wrong, can anybody help me ? Thanks very much. ===================================================== Lin wrote: > > Hi shirie, > > Just tested your pipeline on my machine. It crashes in the latter 3 cases. > > However, if we specify the host first and then the port in the udpsink > properties of server side, the pipeline works just fine. That is, to write > "host=...." first and then "port=...." > > IMHO, there seems to be a default order in the modification of udpsink's > properties. I don't know if this is true, but you can refer to the following > source: $PLUGIN_GOOD/gst/udp/gstudpsink.c, in function > gst_udpsink_set_property(). The code is modifying host iff parameter prop_id > =1, while prop_id is susceptible to be the order of the modification > expression. > I'm using the latest release of plugins-good. Don't know if it is the same > case for more stable versions. > > I'll be very happy to see anyone to prove or disprove my guess. > > > Regards, > Lin ================================================================== shirie wrote: > > Hi, all. I am a newbie to gstreamer. I am now trying build a simple > pipeline to transmit video with udp between two machines. > Here are what I have done now. > > server: > gst-launch filesrc location=new0.mpg ! mpegdemux mpegdemux0.video_00 ! { > queue ! udpsink port=4400 } \ > mpegdemux0.audio_00 ! { queue ! udpsink port=4401 } > > client: > gst-launch udpsrc port=4400 ! { queue ! mpeg2dec ! xvimagesink } \ > udpsrc port=4401 ! { queue ! decodebin ! audioconvert ! audioresample ! > autoaudiosink } > > I test them in one machine. They work well. > > But when I tried to specify the ip address as: > > server: > gst-launch filesrc location=new0.mpg ! mpegdemux mpegdemux0.video_00 ! { > queue ! udpsink port=4400 host=192.168.0.1} \ > mpegdemux0.audio_00 ! { queue ! udpsink port=4401 host=192.168.0.1 } > client: > gst-launch udpsrc uri=udp://192.168.0.1:4400 ! { queue ! mpeg2dec ! > xvimagesink } \ > udpsrc uri=udp://192.168.0.1:4401 ! { queue ! decodebin ! audioconvert ! > audioresample ! autoaudiosink } > > Error occurs in the client. > error: from element /pipeline0/udpsrc0?can't get the resource specified. > (I > translate the message from my local language) > > gstudpsrc.c(825): gst_udpsrc_start (): /pipeline0/udpsrc0: > could add membership -1: invalid parameter (22) > > > Even cannot work with using 127.0.0.1 in one machine. > server: > gst-launch filesrc location=new0.mpg ! mpegdemux mpegdemux0.video_00 ! { > queue ! udpsink port=4400 host=127.0.0.1 } \ > mpegdemux0.audio_00 ! { queue ! udpsink port=4401 host=127.0.0.1 } > client: > gst-launch udpsrc uri=udp://127.0.0.1 :4400 ! { queue ! mpeg2dec ! > xvimagesink } \ > udpsrc uri=udp://127.0.0.1 :4401 ! { queue ! decodebin ! audioconvert ! > audioresample ! autoaudiosink } > > But using "localhost" works, > gst-launch filesrc location=new0.mpg ! mpegdemux mpegdemux0.video_00 ! { > queue ! udpsink port=4400 host=localhost } \ > mpegdemux0.audio_00 ! { queue ! udpsink port=4401 host=localhost } > client: > gst-launch udpsrc uri=udp://localhost :4400 ! { queue ! mpeg2dec ! > xvimagesink } \ > udpsrc uri=udp://localhost :4401 ! { queue ! decodebin ! audioconvert ! > audioresample ! autoaudiosink } > > I'm confused. Can anybody help me? > Thanks very much. > > ------------------------------------------------------------------------------ > > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/gstreamer-devel > > -- View this message in context: http://www.nabble.com/help%3A-udpsrc-with-ip-address.-tp22735354p22736689.html Sent from the GStreamer-devel mailing list archive at Nabble.com. ------------------------------------------------------------------------------ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
2009/3/27 Zibo SHI <[hidden email]>:
> Thank you very much for your reply, Lin. > I change the order of "host=" and "port=" as you said, but the same error > occurs. > The server side seems working normally as before, after I start the server: > > gst-launch filesrc location=new0.mpg ! mpegdemux mpegdemux0.video_00 ! { > queue ! udpsink host=127.0.0.1 port=4400 } \ > mpegdemux0.audio_00 ! { queue ! udpsink host=127.0.0.1 port=4401 } > > Setting pipeline to PAUSED ... > Pipeline is PREROLLING ... > Pipeline is PREROLLED ... > Setting pipeline to PLAYING ... > New clock: GstSystemClock > > Then the client: > gst-launch udpsrc uri=udp://127.0.0.1:4400 ! { queue ! mpeg2dec ! > xvimagesink } \ > udpsrc uri=udp://127.0.0.1:4401 ! { queue ! decodebin ! audioconvert ! > audioresample ! autoaudiosink } The host part of a URI to udpsrc is only used for multicast sessions. In the unicast case, you should just use udpsrc port=4400. Equivalently, if you want to use the URI form, specify the 'any' address like udp://0.0.0.0:4400 Mike ------------------------------------------------------------------------------ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by shirie
>> Thank you very much for your reply, Lin.
>> I change the order of "host=" and "port=" as you said, but the same error >> occurs. >> The server side seems working normally as before, after I start the server: >> >> gst-launch filesrc location=new0.mpg ! mpegdemux mpegdemux0.video_00 ! { >> queue ! udpsink host=127.0.0.1 port=4400 } \ >> mpegdemux0.audio_00 ! { queue ! udpsink host=127.0.0.1 port=4401 } >> >> Setting pipeline to PAUSED ... >> Pipeline is PREROLLING ... >> Pipeline is PREROLLED ... >> Setting pipeline to PLAYING ... >> New clock: GstSystemClock >> >> Then the client: >> gst-launch udpsrc uri=udp://127.0.0.1:4400 ! { queue ! mpeg2dec ! >> xvimagesink } \ >> udpsrc uri=udp://127.0.0.1:4401 ! { queue ! decodebin ! audioconvert ! >> audioresample ! autoaudiosink } > > The host part of a URI to udpsrc is only used for multicast sessions. > In the unicast case, you should just use udpsrc port=4400. > > Equivalently, if you want to use the URI form, specify the 'any' > address like udp://0.0.0.0:4400 > > Mike Hello, Mike. Thanks for your reply. But there is something I can't understand. Yes, I'm trying to use unicast with udp. I want to run the server and client in different machines (say, one with ip 192.168.0.1, the other 192.168.0.10). how can I communicate between two machines if I can't specify ip address and only with port. If I use 0.0.0.0, that won't be an unicast. Yeah? Can you help. Or anybody kown how to do that? Thanks very much. ------------------------------------------------------------------------------ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
> Hello, Mike. Thanks for your reply.
> But there is something I can't understand. Yes, I'm trying to use unicast > with udp. I want to run the server and client in different machines (say, > one with ip 192.168.0.1, the other 192.168.0.10). how can I communicate > between two machines if I can't specify ip address and only with port. The sender specifies where it's sending the data to - you don't need to change that. > > If I use 0.0.0.0, that won't be an unicast. Yeah? Can you help. Or anybody > kown how to do that? > Thanks very much. I only suggested changing the receiver, to accept packets from any address. Mike ------------------------------------------------------------------------------ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |