![]() |
![]() |
![]() |
GStreamer Good Plugins 0.10 Plugins Reference Manual | ![]() |
---|---|---|---|---|
GObject +----GstObject +----GstElement +----GstBaseSrc +----GstPushSrc +----GstUDPSrc
"caps" GstCaps : Read / Write "multicast-group" gchararray : Read / Write "port" gint : Read / Write "uri" gchararray : Read / Write "sockfd" gint : Read / Write
udpsrc is a network source that reads UDP packets from the network. It can be combined with RTP depayloaders to implement RTP streaming.
Here is a simple pipeline to read from the default port and dump the udp packets.
gst-launch -v udpsrc ! fakesink dump=1
To actually generate udp packets on the default port one can use the udpsink element. When running the following pipeline in another terminal, the above mentioned pipeline should dump data packets to the console.
gst-launch -v audiotestsrc ! udpsink
The udpsrc element supports automatic port allocation by setting the "port" property to 0. the following pipeline reads UDP from a free port.
gst-launch -v udpsrc port=0 ! fakesink
udpsrc can read from multicast groups by setting the multicast_group property to the IP address of the multicast group.
Alternatively one can provide a custom socket to udpsrc with the "sockfd" property, udpsrc will then not allocate a socket itself but use the provided one.
The "caps" property is mainly used to give a type to the UDP packet so that they can be autoplugged in GStreamer pipelines. This is very usefull for RTP implementations where the contents of the UDP packets is transfered out-of-bounds using SDP or other means.
The udpsrc is always a live source. It does however not provide a GstClock, this is left for upstream elements such as an RTP session manager or demuxer (such as an MPEG demuxer).
udpsrc implements a GstURIHandler interface that handles udp://host:port type URIs.
multicast-group
" property"multicast-group" gchararray : Read / Write
The Address of multicast group to join.
Default value: "0.0.0.0"
port
" property"port" gint : Read / Write
The port to receive the packets from, 0=allocate.
Allowed values: [0,65535]
Default value: 4951
uri
" property"uri" gchararray : Read / Write
URI in the form of udp://multicast_group:port.
Default value: "udp://0.0.0.0:4951"