//----------------------------------------------------------------------------
//
// TSDuck - The MPEG Transport Stream Toolkit
// Copyright (c) 2005-2025, Thierry Lelegard
// BSD-2-Clause license, see LICENSE.txt file or https://tsduck.io/license
//
//----------------------------------------------------------------------------

<<<
=== srt (input)

[.cmd-header]
Receive TS packets from Secure Reliable Transport (SRT)

This input plugin receives TS packets from Secure Reliable Transport (SRT).

The received UDP datagrams are analyzed and all TS packets are extracted.
Optional extra data at the beginning of the datagram are discarded.

Using this plugin forces `tsp` and all plugins to use their real-time defaults (see the reference documentation for `tsp`).

[.usage]
Restrictions

This plugin is not available on all platforms.
It is provided only when `libsrt` is available during the compilation of TSDuck.
Typically, this plugin is available on macOS, Windows, Fedora 31 onwards, Ubuntu 19.04 onwards.

[.usage]
Acknowledgement

This plugin is a contribution from Anthony Delannoy.

[.usage]
Input timestamps

The SRT source time value of each message is used as input timestamp by tsp for all TS packets in this message.

[.usage]
Usage

[source,shell]
----
$ tsp -I srt [options]
----

[.usage]
General options

[.opt]
*-d* _value_ +
*--display-interval* _value_

[.optdoc]
Specify the interval in seconds between two displays of the evaluated real-time input bitrate.
The default is to never display the bitrate.
This option is ignored if `--evaluation-interval` is not specified.

[.opt]
*-e* _value_ +
*--evaluation-interval* _value_

[.optdoc]
Specify that the real-time input bitrate shall be evaluated on a regular basis.
The value specifies the number of seconds between two evaluations.
By default, the real-time input bitrate is never evaluated and
the input bitrate is evaluated from the PCR in the input packets.

[.opt]
*--rs204*

[.optdoc]
Specify that all packets are in 204-byte format.
By default, the input packet size, 188 or 204 bytes, is automatically detected.
Use this option only when necessary.

[.opt]
*--timestamp-priority* _name_

[.optdoc]
Specify how the input timestamp of each packet is computed.

[.optdoc]
The name specifies an ordered list of timestamp sources.
The first available timestamp value is used as input timestamp.
The name must be one of `rtp-srt-tsp`, `srt-rtp-tsp`, `srt-tsp`, `rtp-tsp`, `tsp`.

[.optdoc]
The possible timestamp sources are:

[.optdoc]
[.compact-list]
* `rtp` : The RTP time stamp, when the UDP packet is an RTP packet.
* `srt` : SRT source time stamp.
* `tsp` : A software timestamp, provided by `tsp` when the input plugin returns a chunk of packets.
  The `tsp`-provided timestamp is always available, always comes last and is less precise.

[.optdoc]
The default is `rtp-srt-tsp`.

include::{docdir}/opt/group-srt.adoc[tags=!*]
include::{docdir}/opt/group-common-inputs.adoc[tags=!*]
