srtsrc
srtsrc is a network source that reads SRT packets from the network.
Examples
gst-launch-1.0 -v srtsrc uri="srt://127.0.0.1:7001" ! fakesink
This pipeline shows how to connect SRT server by setting uri property.
gst-launch-1.0 -v srtsrc uri="srt://:7001?mode=listener" ! fakesink
This pipeline shows how to wait SRT connection by setting uri property.
gst-launch-1.0 -v srtclientsrc uri="srt://192.168.1.10:7001?mode=rendez-vous" ! fakesink
This pipeline shows how to connect SRT server by setting uri property and using the rendez-vous mode.
Additionally, in listener mode, this element supports sharing the underlying SRT connection in order to receive multiple SRT stream using a single UDP port.
Connection sharing is acheived using the connection-key property, two
receivers, in the same application, with the same connection-key value
will share their SRT connection. The demultiplexing of the streams will
be performed using the streamid property.
Example sender- and receiver for SRT connection sharing
gst-launch-1.0 -v \
srtsrc connection-key=multiplex uri="srt://127.0.0.1:5000?mode=listener&streamid=one" ! tsparse ! queue ! filesink location=one.ts \
srtsrc connection-key=multiplex uri="srt://127.0.0.1:5000?mode=listener&streamid=two" ! tsparse ! queue ! filesink location=two.ts
|] This pipeline shows two SRT listeners sharing one UDP port
|[
gst-launch-1.0 -v mpegtsmux name=muxone alignment=7 mpegtsmux name=muxtwo alignment=7 \
videotestsrc pattern=ball ! queue ! x264enc ! muxone. \
videotestsrc ! queue ! x264enc ! muxtwo. \
muxone. ! queue ! srtsink uri="srt://127.0.0.1:5000?mode=caller&streamid=one" \
muxtwo. ! queue ! srtsink uri="srt://127.0.0.1:5000?mode=caller&streamid=two"
|] This pipeline shows two SRT callers sending to the same port with different `streamid`
`srtsrc` also supports listening on an endpoint without a stream ID, in which case
the stream ID will be updated upon connection of a sender:
```
gst-launch-1.0 -v srtsrc uri="srt://127.0.0.1:5000?mode=listener" ! tsparse ! queue ! filesink location=output.ts
```
```
gst-launch-1.0 -v videotestsrc pattern=ball ! queue ! x264enc ! mpegtsmux alignment=7 ! queue ! \
srtsink uri="srt://127.0.0.1:5000?mode=caller&streamid=one"
```
You can use this in combination with connection sharing to ingest multiple streams
on the same endpoint, by spinning up a new srtsrc in a `notify::streamid` signal handler.
The connections RecMutex is held during emission of the signal.
Hierarchy
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstElement ╰──GstBaseSrc ╰──GstPushSrc ╰──srtsrc
Implemented interfaces
Factory details
Authors: – Justin Kim
Classification: – Source/Network
Rank – primary
Plugin – srt
Package – GStreamer Bad Plug-ins
Pad Templates
Signals
caller-added
caller_added_callback (GstElement * gstsrtsrc, gint unused, GSocketAddress * addr, gpointer udata)
def caller_added_callback (gstsrtsrc, unused, addr, udata):
#python callback for the 'caller-added' signal
function caller_added_callback(gstsrtsrc: GstElement * gstsrtsrc, unused: gint unused, addr: GSocketAddress * addr, udata: gpointer udata): {
// javascript callback for the 'caller-added' signal
}
A new caller has connected to srtsrc.
Parameters:
gstsrtsrc
–
the srtsrc element that emitted this signal
unused
–
always zero (for ABI compatibility with previous versions)
addr
–
the GSocketAddress of the new caller
udata
–
Flags: Run Last
caller-connecting
gboolean caller_connecting_callback (GstElement * gstsrtsrc, GSocketAddress * addr, gchararray stream_id, gpointer udata)
def caller_connecting_callback (gstsrtsrc, addr, stream_id, udata):
#python callback for the 'caller-connecting' signal
function caller_connecting_callback(gstsrtsrc: GstElement * gstsrtsrc, addr: GSocketAddress * addr, stream_id: gchararray stream_id, udata: gpointer udata): {
// javascript callback for the 'caller-connecting' signal
}
Whether to accept or reject a caller's connection to srtsrc in listener mode. The Caller's connection is rejected if the callback returns FALSE, else the connection is accepeted.
Parameters:
gstsrtsrc
–
the srtsrc element that emitted this signal
addr
–
the GSocketAddress that describes the client socket
stream_id
–
the stream Id to which the caller wants to connect
udata
–
Flags: Run Last
Since : 1.20
caller-rejected
caller_rejected_callback (GstElement * gstsrtsrc, GSocketAddress * addr, gchararray stream_id, gpointer udata)
def caller_rejected_callback (gstsrtsrc, addr, stream_id, udata):
#python callback for the 'caller-rejected' signal
function caller_rejected_callback(gstsrtsrc: GstElement * gstsrtsrc, addr: GSocketAddress * addr, stream_id: gchararray stream_id, udata: gpointer udata): {
// javascript callback for the 'caller-rejected' signal
}
A caller's connection to srtsrc in listener mode has been rejected.
Parameters:
gstsrtsrc
–
the srtsrc element that emitted this signal
addr
–
the GSocketAddress that describes the client socket
stream_id
–
the stream Id to which the caller wants to connect
udata
–
Flags: Run Last
Since : 1.20
caller-removed
caller_removed_callback (GstElement * gstsrtsrc, gint unused, GSocketAddress * addr, gpointer udata)
def caller_removed_callback (gstsrtsrc, unused, addr, udata):
#python callback for the 'caller-removed' signal
function caller_removed_callback(gstsrtsrc: GstElement * gstsrtsrc, unused: gint unused, addr: GSocketAddress * addr, udata: gpointer udata): {
// javascript callback for the 'caller-removed' signal
}
The given caller has disconnected.
Parameters:
gstsrtsrc
–
the srtsrc element that emitted this signal
unused
–
always zero (for ABI compatibility with previous versions)
addr
–
the GSocketAddress of the caller
udata
–
Flags: Run Last
Properties
authentication
“authentication” gboolean
Authenticate a connection
Flags : Read / Write
Default value : false
auto-reconnect
“auto-reconnect” gboolean
Boolean to choose whether to automatically reconnect. If TRUE, an element in caller mode will try to reconnect instead of reporting an error.
This will be ignored for authentication failures.
Flags : Read / Write
Default value : true
Since : 1.22
connection-key
“connection-key” gchararray
Identifier for sharing SRT connection when listening, elements with the same connection-key will use on the same UDP socket.
Flags : Read / Write
Default value : NULL
Since : 1.30
keep-listening
“keep-listening” gboolean
If FALSE, the element will return GST_FLOW_EOS when the remote client disconnects. If TRUE, the element will keep waiting for the client to reconnect. An element message named 'connection-removed' will be sent on disconnection.
Flags : Read / Write
Default value : false
Since : 1.22
latency
“latency” gint
The maximum accepted transmission latency.
Flags : Read / Write
Default value : 125
localaddress
“localaddress” gchararray
The address to bind when mode is listener or rendezvous. This property can be set by URI parameters.
Flags : Read / Write
Default value : NULL
localport
“localport” guint
The local port to bind when mode is listener or rendezvous. This property can be set by URI parameters.
Flags : Read / Write
Default value : 7001
mode
“mode” GstSRTConnectionMode *
The SRT connection mode. This property can be set by URI parameters.
Flags : Read / Write
Default value : caller (1)
passphrase
“passphrase” gchararray
The password for the encrypted transmission. This property can be set by URI parameters.
Flags : Read / Write
pbkeylen
“pbkeylen” GstSRTKeyLength *
The crypto key length. This property can be set by URI parameters.
Flags : Read / Write
Default value : no-key (0)
poll-timeout
“poll-timeout” gint
The polling timeout used when srt poll is started. Even if the default value indicates infinite waiting, it can be cancellable according to GstState This property can be set by URI parameters.
Flags : Read / Write
Default value : 1000
stats
“stats” GstStructure *
The statistics from SRT.
Flags : Read
Default value :
application/x-srt-statistics, bytes-received-total=(guint64)0;
streamid
“streamid” gchararray
The stream id for the SRT access control.
Flags : Read / Write
Default value : NULL
uri
“uri” gchararray
The URI used by SRT connection. User can specify SRT specific options by URI parameters. Refer to Mediun: SRT
Flags : Read / Write
Default value : srt://127.0.0.1:7001
wait-for-connection
“wait-for-connection” gboolean
Block the stream until a client connects
Flags : Read / Write
Default value : true
Named constants
GstSRTConnectionMode
SRT connection types.
Members
none (0) – GST_SRT_CONNECTION_MODE_NONE
caller (1) – GST_SRT_CONNECTION_MODE_CALLER
listener (2) – GST_SRT_CONNECTION_MODE_LISTENER
rendezvous (3) – GST_SRT_CONNECTION_MODE_RENDEZVOUS
GstSRTKeyLength
Members
no-key (0) – GST_SRT_KEY_LENGTH_NO_KEY
0 (0) – GST_SRT_KEY_LENGTH_0
16 (16) – GST_SRT_KEY_LENGTH_16
24 (24) – GST_SRT_KEY_LENGTH_24
32 (32) – GST_SRT_KEY_LENGTH_32
The results of the search are