sdpdemux2
sdpdemux2 is a demuxer that receives an SDP session description on its
always sink pad sink (application/sdp) and sets up an RTP receiver
pipeline for every receivable media line. It can be combined with RTP
depayloaders to receive RTP sessions whose description arrives as stream
data, without any out-of-band configuration.
The SDP is buffered on the sink pad and the session is started when
EOS is received on that pad, so the usual way to feed the element is
filesrc location=session.sdp ! sdpdemux2 or an appsrc that pushes one
buffer and then EOS.
The receivable medias are exposed as sometimes source pads named
stream_%u, where %u is the index of the media line in the SDP, with
application/x-rtp caps derived from the media line. They appear once RTP
data flows, so applications have to connect to the pad-added signal. The
stream ID of each pad is derived from the SDP origin and the media line.
The internal rtprecv and rtpsend elements and the per-stream UDP
elements (udpsrc2-rtp-<id>, udpsrc2-rtcp-<id>, udpsink2-rtcp-<id>)
are added to the bin with stable names, depending on the RTCP mode, and can
be retrieved with gst_bin_get_by_name or the GstChildProxy interface.
If the SDP describes an RTSP session, i.e. the session or every media has
an a=control attribute with a full rtsp:// URL, and
redirect is true (the default) then a redirect element
message with the session as rtsp-sdp:// URI in its new-location field
is posted and an error is posted. With redirect false the
session is instead received by an internal rtspsrc2 (or rtspsrc)
element holding the SDP as its location, whose media streams appear
as stream_%u pads like the ones of UDP medias.
By default RTCP is sent and received. With rtcp-mode set to
recvonly or sendrecv, RTCP is received on the port from the SDP, or on
RTP port + 1 if the SDP has no a=rtcp attribute. An RTCP BYE or a
source timeout sends EOS on the corresponding pad, but the pad is kept and
re-targeted if the stream restarts with a new source. With sendonly or
sendrecv RTCP is also sent, to the a=rtcp destination or the RTP
destination on the session RTCP port, without requiring any RTCP
reception.
latency sets the jitter buffer latency. timeout
makes the element post an error once when a session does not start to
deliver RTP data within the given time. The timeout is cleared as soon as
data arrives.
media only keeps medias whose m= line media name matches, e.g.
audio. Multicast reception can be restricted to the interfaces listed in
multicast-iface, and by default multicast loopback is
disabled, so local senders on the same host do not receive the RTCP sent
by this element: set multicast-loopback to true for local
testing. With debug the SDP is logged at the info
level.
Examples
gst-launch-1.0 -v filesrc location=session.sdp ! sdpdemux2 ! rtpopusdepay2 ! opusdec ! autoaudiosink
A pipeline to receive the Opus media of a session described by
session.sdp, e.g. written by sdpsink2.
Hierarchy
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstElement ╰──GstBin ╰──sdpdemux2
Implemented interfaces
Factory details
Authors: – Sebastian Dröge
Classification: – Source/Network
Rank – none
Plugin – sdp
Package – gst-plugin-sdp
Pad Templates
Properties
media
“media” gchararray
Only handle medias with this m= media name, e.g. audio
Flags : Read / Write
Default value : NULL
multicast-iface
“multicast-iface” gchararray
Comma-separated list of network interfaces to use for multicast
Flags : Read / Write
Default value : NULL
multicast-loopback
“multicast-loopback” gboolean
Enable multicast loopback so that local senders on the same host receive RTCP; needed for local testing
Flags : Read / Write
Default value : false
redirect
“redirect” gboolean
Redirect to RTSP if the SDP has fully qualified rtsp:// control URLs, otherwise receive the session with an internal RTSP source
Flags : Read / Write
Default value : true
rtcp-mode
“rtcp-mode” GstSdpRtcpMode *
Whether to send and/or receive RTCP
Flags : Read / Write
Default value : sendrecv (3)
timeout
“timeout” guint64
Fail transport after this many nanoseconds without receiving UDP packets
Flags : Read / Write
Default value : 10000000000
The results of the search are