Skip to main content

RTP

An input type that allows streaming video and audio to the compositor over RTP.

Usage

To use RTP Input you must register it first. You can do it by sending a request like this:

Example request
POST: /api/input/:input_id/register
Content-Type: application/json
{
"type": "rtp_stream",
"transport_protocol": "tcp_server",
"port": 9001,
"video": {
"decoder": "ffmpeg_h264"
},
"audio": {
"decoder": "opus"
}
}

See HTTP Routes documentation to learn more about managing inputs. You can also check out our guide to learn how to deliver streams after registering them.

RtpInputStream

type RtpInputStream = {
port: string | u16;
transport_protocol?: "udp" | "tcp_server";
video?: InputRtpVideoOptions;
audio?: InputRtpAudioOptions;
required?: bool;
offset_ms?: f64;
}

Parameters for an input stream from RTP source. At least one of video and audio has to be defined.

Properties

  • port - UDP port or port range on which the compositor should listen for the stream.
  • transport_protocol - Transport protocol.
    • "udp" - UDP protocol.
    • "tcp_server" - TCP protocol where LiveCompositor is the server side of the connection.
  • video - Parameters of a video source included in the RTP stream.
  • audio - Parameters of an audio source included in the RTP stream.
  • required - (default=false) If input is required and the stream is not delivered on time, then LiveCompositor will delay producing output frames.
  • offset_ms - Offset in milliseconds relative to the pipeline start (start request). If the offset is not defined then the stream will be synchronized based on the delivery time of the initial frames.

InputRtpVideoOptions

type InputRtpVideoOptions = { decoder: "ffmpeg_h264"; }

InputRtpAudioOptions

type InputRtpAudioOptions = 
| {
decoder: "opus";
forward_error_correction?: bool;
}
| {
decoder: "aac";
audio_specific_config: string;
rtp_mode?: "low_bitrate" | "high_bitrate";
}

Properties (type: "opus")

  • forward_error_correction - (default=false) Specifies whether the stream uses forward error correction. It's specific for Opus codec. For more information, check out RFC.

Properties (type: "aac")

  • audio_specific_config - AudioSpecificConfig as described in MPEG-4 part 3, section 1.6.2.1 The config should be encoded as described in RFC 3640.

    The simplest way to obtain this value when using ffmpeg to stream to the compositor is to pass the additional -sdp_file FILENAME option to ffmpeg. This will cause it to write out an sdp file, which will contain this field. Programs which have the ability to stream AAC to the compositor should provide this information.

    In MP4 files, the ASC is embedded inside the esds box (note that it is not the whole box, only a part of it). This also applies to fragmented MP4s downloaded over HLS, if the playlist uses MP4s instead of MPEG Transport Streams

    In FLV files and the RTMP protocol, the ASC can be found in the AACAUDIODATA tag.

  • rtp_mode - (default="high_bitrate") Specifies the RFC 3640 mode that should be used when depacketizing this stream.