How to display video streamed from UDP source?

Chuck Crisler ccrisler at mutualink.net
Thu May 9 10:46:48 PDT 2013


gst-inspect playbin2 yields that it has a uri property. So you should be
able to simply set that property and it will identify the input stream type
and create the appropriate source element. You can read that created source
element (after it has been created) with the source property, which is
read-only. gst-inspect tells you a lot of things about the element that you
need to know.

Chuck


On Wed, May 8, 2013 at 5:05 PM, Jim Norton <jimnorton at jimnorton.org> wrote:

> Hi Chuck,
>
> Thank you for the information. Is it possible to connect a udpsrc to
> playbin2 or a way to specify the URI property of playbin2 to read from a
> UDP broadcast?
>
> Thanks again,
> Jim
>
>
>
>  Look at this example:
>> http://gstreamer.freedesktop.**org/data/doc/gstreamer/head/**
>> manual/html/chapter-**helloworld.html#section-**helloworld<http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-helloworld.html#section-helloworld>
>>
>> Change the filesrc to udpsrc. Use gst-inspect udpsrc to find the needed
>> properties. You should also reference this link:
>>
>> http://gstreamer.freedesktop.**org/data/doc/gstreamer/head/**
>> faq/html/chapter-**troubleshooting.html<http://gstreamer.freedesktop.org/data/doc/gstreamer/head/faq/html/chapter-troubleshooting.html>
>>
>> You can also use export GST_DEBUG=aaa:<dbg level> where aaa is a plugin
>> name such as udpsrc. dbg level ranges from 1 to 5 or so, 5 being very
>> verbose.
>>
>>
>> On Tue, May 7, 2013 at 4:42 PM, Jim Norton <jimnorton at jimnorton.org>
>> wrote:
>>
>>  I have a small program that uses the GStreamer library to play videos
>>> from
>>> local files and videos on webservers using HTTP.
>>>
>>> How does one go about connecting to and playing a UDP video broadcast in
>>> C
>>> using GStreamer?
>>>
>>>
>>> For example, what is required to play the streaming video at this
>>> hypothetical URI? 10.0.11.255:9001
>>>
>>> I have to be able to play a streaming video that is created using the
>>> following sample VLC command:
>>>
>>> cvlc -vvv /vlc/attract.mpg :norm=ntsc :v4l2-width=320 :v4l2-height=240
>>> :v4l2-standard=45056 :channel=1 --no-sout-audio --sout
>>> '#transcode{vb="1600",vcodec=****mpgv,acodec=mpga,venc=ffmpeg}**:**
>>> standard{access=udp,mux=ts,****dst=10.0.11.255:9001}' --loop --ttl 1
>>>
>>>
>>> I tried:
>>>
>>> // using playbin2 connect to UDP broadcast
>>> g_object_set (data.playbin2, "uri", "udp://10.0.11.255:9001", NULL);
>>>
>>> Then I try to start the stream with the following:
>>>
>>> /* Start playing */
>>>     if( gst_element_set_state (data.playbin2, GST_STATE_PLAYING) ==
>>> GST_STATE_CHANGE_FAILURE )
>>>     {
>>>         g_printerr ("Unable to set the pipeline to the playing
>>> state.\n");
>>>         gst_object_unref (data.playbin2);
>>>         return( -1 );
>>>     }
>>>
>>> and I get the failure to change state message.
>>>
>>> After some more googling, I found out about udpsrc. However, I can't
>>> figure out how to use it in C code. I've gone through the tutorials, but
>>> have not found any examples showing how to play a video streaming via VLC
>>> from a UDP port.
>>>
>>> Any and all help would be greatly appreciated.
>>>
>>>
>
> ______________________________**_________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.**freedesktop.org<gstreamer-devel at lists.freedesktop.org>
> http://lists.freedesktop.org/**mailman/listinfo/gstreamer-**devel<http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130509/746f433a/attachment.html>


More information about the gstreamer-devel mailing list