rtspsrc

rtspsrc

Synopsis

struct              GstRTSPSrc;

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GstObject
               +----GstElement
                     +----GstBin
                           +----GstRTSPSrc

Implemented Interfaces

GstRTSPSrc implements GstChildProxy and GstURIHandler.

Properties

  "debug"                    gboolean              : Read / Write
  "location"                 gchar*                : Read / Write
  "protocols"                GstRTSPLowerTrans     : Read / Write
  "retry"                    guint                 : Read / Write
  "timeout"                  guint64               : Read / Write
  "latency"                  guint                 : Read / Write
  "tcp-timeout"              guint64               : Read / Write
  "connection-speed"         guint64               : Read / Write
  "nat-method"               GstRTSPNatMethod      : Read / Write
  "do-rtcp"                  gboolean              : Read / Write
  "proxy"                    gchar*                : Read / Write
  "rtp-blocksize"            guint                 : Read / Write
  "user-id"                  gchar*                : Read / Write
  "user-pw"                  gchar*                : Read / Write
  "buffer-mode"              GstRTSPSrcBufferMode  : Read / Write
  "port-range"               gchar*                : Read / Write
  "udp-buffer-size"          gint                  : Read / Write
  "short-header"             gboolean              : Read / Write
  "do-rtsp-keep-alive"       gboolean              : Read / Write
  "drop-on-latency"          gboolean              : Read / Write
  "probation"                guint                 : Read / Write
  "udp-reconnect"            gboolean              : Read / Write
  "proxy-id"                 gchar*                : Read / Write
  "proxy-pw"                 gchar*                : Read / Write
  "multicast-iface"          gchar*                : Read / Write
  "ntp-sync"                 gboolean              : Read / Write
  "use-pipeline-clock"       gboolean              : Read / Write
  "sdes"                     GstStructure*         : Read / Write
  "tls-database"             GTlsDatabase*         : Read / Write
  "tls-validation-flags"     GTlsCertificateFlags  : Read / Write
  "do-retransmission"        gboolean              : Read / Write
  "tls-interaction"          GTlsInteraction*      : Read / Write
  "ntp-time-source"          GstRTSPSrcNtpTimeSource  : Read / Write
  "user-agent"               gchar*                : Read / Write
  "max-rtcp-rtp-time-diff"   gint                  : Read / Write
  "rfc7273-sync"             gboolean              : Read / Write

Signals

  "handle-request"                                 
  "on-sdp"                                         
  "select-stream"                                  : Run First
  "new-manager"                                    : Run First
  "request-rtcp-key"                               : Run Last

Description

Makes a connection to an RTSP server and read the data. rtspsrc strictly follows RFC 2326 and therefore does not (yet) support RealMedia/Quicktime/Microsoft extensions.

RTSP supports transport over TCP or UDP in unicast or multicast mode. By default rtspsrc will negotiate a connection in the following order: UDP unicast/UDP multicast/TCP. The order cannot be changed but the allowed protocols can be controlled with the "protocols" property.

rtspsrc currently understands SDP as the format of the session description. For each stream listed in the SDP a new rtp_stream%d pad will be created with caps derived from the SDP media description. This is a caps of mime type "application/x-rtp" that can be connected to any available RTP depayloader element.

rtspsrc will internally instantiate an RTP session manager element that will handle the RTCP messages to and from the server, jitter removal, packet reordering along with providing a clock for the pipeline. This feature is implemented using the gstrtpbin element.

rtspsrc acts like a live source and will therefore only generate data in the PLAYING state.

Example launch line

1
gst-launch-1.0 rtspsrc location=rtsp://some.server/url ! fakesink
Establish a connection to an RTSP server and send the raw RTP packets to a fakesink.

Synopsis

Element Information

plugin

rtsp

author

Wim Taymans <wim@fluendo.com>, Thijs Vermeir <thijs.vermeir@barco.com>, Lutz Mueller <lutz@topfrose.de>

class

Source/Network

Element Pads

name

stream_%u

direction

source

presence

sometimes

details

application/x-rtp

application/x-rdt

Details

struct GstRTSPSrc

struct GstRTSPSrc;

Property Details

The "debug" property

  "debug"                    gboolean              : Read / Write

Dump request and response messages to stdout.

Default value: FALSE


The "location" property

  "location"                 gchar*                : Read / Write

Location of the RTSP url to read.

Default value: NULL


The "protocols" property

  "protocols"                GstRTSPLowerTrans     : Read / Write

Allowed lower transport protocols.

Default value: GST_RTSP_LOWER_TRANS_UDP|GST_RTSP_LOWER_TRANS_UDP_MCAST|GST_RTSP_LOWER_TRANS_TCP


The "retry" property

  "retry"                    guint                 : Read / Write

Max number of retries when allocating RTP ports.

Allowed values: <= 65535

Default value: 20


The "timeout" property

  "timeout"                  guint64               : Read / Write

Retry TCP transport after UDP timeout microseconds (0 = disabled).

Default value: 5000000


The "latency" property

  "latency"                  guint                 : Read / Write

Amount of ms to buffer.

Default value: 2000


The "tcp-timeout" property

  "tcp-timeout"              guint64               : Read / Write

Fail after timeout microseconds on TCP connections (0 = disabled).

Default value: 20000000


The "connection-speed" property

  "connection-speed"         guint64               : Read / Write

Network connection speed in kbps (0 = unknown).

Allowed values: <= 18446744073709551

Default value: 0


The "nat-method" property

  "nat-method"               GstRTSPNatMethod      : Read / Write

Method to use for traversing firewalls and NAT.

Default value: Send Dummy packets


The "do-rtcp" property

  "do-rtcp"                  gboolean              : Read / Write

Enable RTCP support. Some old server don't like RTCP and then this property needs to be set to FALSE.

Default value: TRUE


The "proxy" property

  "proxy"                    gchar*                : Read / Write

Set the proxy parameters. This has to be a string of the format [http://][user:passwd@]host[:port].

Default value: NULL


The "rtp-blocksize" property

  "rtp-blocksize"            guint                 : Read / Write

RTP package size to suggest to server.

Allowed values: <= 65536

Default value: 0


The "user-id" property

  "user-id"                  gchar*                : Read / Write

RTSP location URI user id for authentication.

Default value: NULL


The "user-pw" property

  "user-pw"                  gchar*                : Read / Write

RTSP location URI user password for authentication.

Default value: NULL


The "buffer-mode" property

  "buffer-mode"              GstRTSPSrcBufferMode  : Read / Write

Control the buffering and timestamping mode used by the jitterbuffer.

Default value: Choose mode depending on stream live


The "port-range" property

  "port-range"               gchar*                : Read / Write

Configure the client port numbers that can be used to recieve RTP and RTCP.

Default value: NULL


The "udp-buffer-size" property

  "udp-buffer-size"          gint                  : Read / Write

Size of the kernel UDP receive buffer in bytes.

Allowed values: >= 0

Default value: 524288


The "short-header" property

  "short-header"             gboolean              : Read / Write

Only send the basic RTSP headers for broken encoders.

Default value: FALSE


The "do-rtsp-keep-alive" property

  "do-rtsp-keep-alive"       gboolean              : Read / Write

Enable RTSP keep alive support. Some old server don't like RTSP keep alive and then this property needs to be set to FALSE.

Default value: TRUE


The "drop-on-latency" property

  "drop-on-latency"          gboolean              : Read / Write

Tells the jitterbuffer to never exceed the given latency in size.

Default value: FALSE


The "probation" property

  "probation"                guint                 : Read / Write

Consecutive packet sequence numbers to accept the source.

Default value: 2


The "udp-reconnect" property

  "udp-reconnect"            gboolean              : Read / Write

Reconnect to the server if RTSP connection is closed when doing UDP.

Default value: TRUE


The "proxy-id" property

  "proxy-id"                 gchar*                : Read / Write

Sets the proxy URI user id for authentication. If the URI set via the "proxy" property contains a user-id already, that will take precedence.

Default value: ""

Since 1.2


The "proxy-pw" property

  "proxy-pw"                 gchar*                : Read / Write

Sets the proxy URI password for authentication. If the URI set via the "proxy" property contains a password already, that will take precedence.

Default value: ""

Since 1.2


The "multicast-iface" property

  "multicast-iface"          gchar*                : Read / Write

The network interface on which to join the multicast group.

Default value: NULL


The "ntp-sync" property

  "ntp-sync"                 gboolean              : Read / Write

Synchronize received streams to the NTP clock.

Default value: FALSE


The "use-pipeline-clock" property

  "use-pipeline-clock"       gboolean              : Read / Write

Use the pipeline running-time to set the NTP time in the RTCP SR messages(DEPRECATED: Use ntp-time-source property).

Default value: FALSE


The "sdes" property

  "sdes"                     GstStructure*         : Read / Write

The SDES items of this session.


The "tls-database" property

  "tls-database"             GTlsDatabase*         : Read / Write

TLS database with anchor certificate authorities used to validate the server certificate.


The "tls-validation-flags" property

  "tls-validation-flags"     GTlsCertificateFlags  : Read / Write

TLS certificate validation flags used to validate the server certificate.

Default value: G_TLS_CERTIFICATE_UNKNOWN_CA|G_TLS_CERTIFICATE_BAD_IDENTITY|G_TLS_CERTIFICATE_NOT_ACTIVATED|G_TLS_CERTIFICATE_EXPIRED|G_TLS_CERTIFICATE_REVOKED|G_TLS_CERTIFICATE_INSECURE|G_TLS_CERTIFICATE_GENERIC_ERROR


The "do-retransmission" property

  "do-retransmission"        gboolean              : Read / Write

Ask the server to retransmit lost packets.

Default value: TRUE


The "tls-interaction" property

  "tls-interaction"          GTlsInteraction*      : Read / Write

A GTlsInteraction object to promt the user for password or certificate.


The "ntp-time-source" property

  "ntp-time-source"          GstRTSPSrcNtpTimeSource  : Read / Write

NTP time source for RTCP packets.

Default value: NTP time based on realtime clock


The "user-agent" property

  "user-agent"               gchar*                : Read / Write

The User-Agent string to send to the server.

Default value: "GStreamer/1.10.3"


The "max-rtcp-rtp-time-diff" property

  "max-rtcp-rtp-time-diff"   gint                  : Read / Write

Maximum amount of time in ms that the RTP time in RTCP SRs is allowed to be ahead (-1 disabled).

Allowed values: >= G_MAXULONG

Default value: 1000


The "rfc7273-sync" property

  "rfc7273-sync"             gboolean              : Read / Write

Synchronize received streams to the RFC7273 clock (requires clock and offset to be provided).

Default value: FALSE

Signal Details

The "handle-request" signal

void                user_function                      (GstRTSPSrc *rtspsrc,
                                                        gpointer    request,
                                                        gpointer    response,
                                                        gpointer    user_data)

Handle a server request in request and prepare response.

This signal is called from the streaming thread, you should therefore not do any state changes on rtspsrc because this might deadlock. If you want to modify the state as a result of this signal, post a GST_MESSAGE_REQUEST_STATE message on the bus or signal the main thread in some other way.

rtspsrc :

a GstRTSPSrc

request :

a GstRTSPMessage

response :

a GstRTSPMessage

user_data :

user data set when the signal handler was connected.

Since 1.2


The "on-sdp" signal

void                user_function                      (GstRTSPSrc    *rtspsrc,
                                                        GstSDPMessage *sdp,
                                                        gpointer       user_data)

Emited when the client has retrieved the SDP and before it configures the streams in the SDP. sdp can be inspected and modified.

This signal is called from the streaming thread, you should therefore not do any state changes on rtspsrc because this might deadlock. If you want to modify the state as a result of this signal, post a GST_MESSAGE_REQUEST_STATE message on the bus or signal the main thread in some other way.

rtspsrc :

a GstRTSPSrc

sdp :

a GstSDPMessage

user_data :

user data set when the signal handler was connected.

Since 1.2


The "select-stream" signal

gboolean            user_function                      (GstRTSPSrc *rtspsrc,
                                                        guint       num,
                                                        GstCaps    *caps,
                                                        gpointer    user_data)      : Run First

Emited before the client decides to configure the stream num with caps.

rtspsrc :

a GstRTSPSrc

num :

the stream number

caps :

the stream caps

user_data :

user data set when the signal handler was connected.

Returns :

TRUE when the stream should be selected, FALSE when the stream is to be ignored.

Since 1.2


The "new-manager" signal

void                user_function                      (GstRTSPSrc *rtspsrc,
                                                        GstElement *manager,
                                                        gpointer    user_data)      : Run First

Emited after a new manager (like rtpbin) was created and the default properties were configured.

rtspsrc :

a GstRTSPSrc

manager :

a GstElement

user_data :

user data set when the signal handler was connected.

Since 1.4


The "request-rtcp-key" signal

GstCaps*            user_function                      (GstRTSPSrc *rtspsrc,
                                                        guint       num,
                                                        gpointer    user_data)      : Run Last

Signal emited to get the crypto parameters relevant to the RTCP stream. User should provide the key and the RTCP encryption ciphers and authentication, and return them wrapped in a GstCaps.

rtspsrc :

a GstRTSPSrc

num :

the stream number

user_data :

user data set when the signal handler was connected.

Since 1.4