RTP
An input type that allows streaming video and audio to the Smelter server over RTP. It supports both streaming over UDP and TCP (Smelter works as a TCP server).
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/registerContent-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.
Reference
Type definition
type RtpInput = { type: "rtp_stream" port: string | u16; transport_protocol?: "udp" | "tcp_server"; video?: InputRtpVideoOptions; audio?: InputRtpAudioOptions; required?: bool; offset_ms?: f64;}
Parameters for registering an RTP stream as an input.
Properties
port
A port number or a port range in format START:END
. If range is specified, a port from that
range will be returned from register-input
request.
- Type:
string | u16
transport_protocol
Transport protocol.
- Type:
"udp" | "tcp_server"
- Supported values:
udp
- UDP protocol.tcp_server
- TCP protocol where Smelter is the server side of the connection.
video
Parameters of a video included in the RTP stream.
- Type:
InputRtpVideoOptions
audio
Parameters of an audio source included in the RTP stream.
- Type:
InputRtpAudioOptions
required
Determines if the input stream is essential for output frame production. If set to true and the stream is delayed, Smelter will postpone output frames until the stream is received.
- Type:
bool
- Default value:
false
offset_ms
Offset in milliseconds relative to the pipeline start (start request). If unspecified, the stream synchronizes based on the delivery time of the initial frames.
- Type:
f64
InputRtpVideoOptions
type InputRtpVideoOptions = { decoder: "ffmpeg_h264" | "vulkan_video";}
Properties
decoder
Video decoder.
- Type:
"ffmpeg_h264" | "vulkan_video"
- Supported values:
-
"ffmpeg_h264"
- Use the software decoder based on ffmpeg. -
"vulkan_video"
(Required feature:vk-video ) - Use hardware decoder based on Vulkan Video.This should be faster and more scalable than the ffmpeg decoder, if the hardware and OS support it.
This requires hardware that supports Vulkan Video. Another requirement is this program has to be compiled with the
vk-video
feature enabled (enabled by default on platforms which support Vulkan, i.e. non-Apple operating systems and not the web).
-
InputRtpAudioOptions
type InputRtpAudioOptions = | { decoder: "opus"; forward_error_correction?: bool; } | { decoder: "aac"; audio_specific_config: string; rtp_mode?: "low_bitrate" | "high_bitrate"; }
Properties (decoder: "opus"
)
forward_error_correction
Specifies whether the stream uses forward error correction. It’s specific for the Opus
codec. For more information, visit RFC specification.
- Type:
bool
- Default value:
false
Properties (decoder: "aac"
)
audio_specific_config
Configuration encoded in the format described in RFC 3640.
- Type:
string
For detailed instructions on obtaining this value, refer to the information provided in the table below:
Format/Protocol | Location of AAC Specific Config (ASC) | Notes |
---|---|---|
FFmpeg Streaming | SDP file | Use the -sdp_file FILENAME option when streaming to a Smelter to generate an SDP file containing the ASC. |
MP4 Files | Inside the esds box | The ASC is embedded as part of the esds box, not the entire box. Applies to regular MP4 and fragmented MP4s (used in HLS playlists with MP4 files). |
FLV Files / RTMP | Inside the AACAUDIODATA tag | The ASC is contained within the AACAUDIODATA tag. |
rtp_mode
Specifies the RFC 3640 mode that should be used when depacketizing this stream. For more information, visit RFC specification
- Type:
"low_bitrate" | "high_bitrate"
- Default value:
"high_bitrate"