sdpsrc2

sdpsrc2 is a network source that sets up an RTP receiver pipeline from an SDP session description. It can be combined with RTP depayloaders to receive RTP sessions whose description is available as a file, without any out-of-band configuration.

The description is given either in the sdp property or read from the file named by location, an sdp:// URI such as sdp:///path/to/session.sdp, also supported via the sdp:// URI handler. Exactly one of the two has to be set and both are mutable in READY.

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 sdpsrc2 location=sdp:///tmp/session.sdp ! rtpopusdepay2 ! opusdec ! autoaudiosink

A pipeline to receive the Opus media of a session described by /tmp/session.sdp, e.g. written by sdpsink2.

Hierarchy

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstElement
                ╰──GstBin
                    ╰──sdpsrc2

Implemented interfaces

Factory details

Authors: – Sebastian Dröge

Classification: – Source/Network/RTP

Rank – none

Plugin – sdp

Package – gst-plugin-sdp

Pad Templates

stream_%u

application/x-rtp:

Presence – sometimes

Direction – src

Object type – GstPad


Properties

debug

“debug” gboolean

Log the SDP

Flags : Read / Write

Default value : false


latency

“latency” guint

RTP jitterbuffer latency in ms

Flags : Read / Write

Default value : 200


location

“location” gchararray

URI to SDP file (sdp:///path/to/file)

Flags : Read / Write

Default value : NULL


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)


sdp

“sdp” gchararray

SDP description used instead of location

Flags : Read / Write

Default value : NULL


timeout

“timeout” guint64

Fail transport after this many nanoseconds without receiving UDP packets

Flags : Read / Write

Default value : 10000000000


Named constants

GstSdpRtcpMode

Members

inactive (0) – Inactive
recvonly (1) – Only receive RTCP
sendonly (2) – Only send RTCP
sendrecv (3) – Send and receive RTCP

The results of the search are