Skip to content

rtpout

RTP Streamer

Register name used to load filter: rtpout
This filter may be automatically loaded during graph resolution.

The RTP streamer handles SDP/RTP output streaming.

SDP mode

When the destination URL is an SDP, the filter outputs an SDP on a file PID and streams RTP packets over UDP, starting from the indicated port.

Direct RTP mode

When the destination URL uses the protocol scheme rtp://IP:PORT, the filter does not output any SDP and streams a single input over RTP, using PORT indicated in the destination URL, or the first port configured.
In this mode, it is usually needed to specify the desired format using ext or mime.
Example

gpac -i src -o rtp://localhost:1234/:ext=ts

This will indicate that the RTP streamer expects a MPEG-2 TS mux as an input.

RTP Packets

The RTP packets produced have a maximum payload set by the mtu option (IP packet will be MTU + 40 bytes of IP+UDP+RTP headers).
The real-time scheduling algorithm works as follows:

  • first initialize the clock by:

    • computing the smallest timestamp for all input PIDs
    • mapping this media time to the system clock
  • determine the earliest packet to send next on each input PID, adding delay if any

  • finally compare the packet mapped timestamp TS to the system clock SC. When TS - SC is less than tt, the RTP packets for the source packet are sent

The filter does not check for RTCP timeout and will run until all input PIDs reach end of stream.

Options

ip (str): destination IP address (NULL is 127.0.0.1)
port (uint, default: 7000): port for first stream in session
loop (bool, default: true): loop all streams in session (not always possible depending on source type)
mpeg4 (bool, default: false): send all streams using MPEG-4 generic payload format if possible
mtu (uint, default: 1460): size of RTP MTU in bytes
ttl (uint, default: 2): time-to-live for multicast packets
ifce (str): default network interface to use
payt (uint, default: 96, minmax: 96-127): payload type to use for dynamic decoder configurations
delay (sint, default: 0): send delay for packet (negative means send earlier)
tt (uint, default: 1000): time tolerance in microseconds. Whenever schedule time minus realtime is below this value, the packet is sent right away
runfor (sint, default: -1): run for the given time in ms. Negative value means run for ever (if loop) or source duration, 0 only outputs the sdp
tso (sint, default: -1): set timestamp offset in microseconds. Negative value means random initial timestamp
xps (bool, default: false): force parameter set injection at each SAP. If not set, only inject if different from SDP ones
latm (bool, default: false): use latm for AAC payload format
dst (cstr): URL for direct RTP mode
ext (str): file extension for direct RTP mode
mime (cstr): set mime type for direct RTP mode