Skip to content

WHIP

An input type that allows streaming video and audio to Smelter over WHIP.

Smelter exposes WHIP endpoint on port 9000 under /whip/:input_id route. A different port can be configured with SMELTER_WHIP_WHEP_SERVER_PORT.

To connect new input, register it first with register-input request and then establish WHIP connection.

Usage

To use WHIP 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": "whip",
"video": {
"decoder": "ffmpeg_h264"
},
"audio": {
"decoder": "opus"
},
}

Reference

Type definitions

type WhipInput = {
type: "whip";
video?: InputWhipVideoOptions;
audio?: InputWhipAudioOptions;
required?: bool;
offsetMs?: f64;
};

Parameters for registering an WHIP endpoint as an input.

Properties

video

Parameters of a video source included in the WHIP stream.


audio

Parameters of an audio source included in the WHIP stream.


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

InputWhipVideoOptions

Parameters of a video source included in the WHIP stream.

Type definitions

type InputWhipVideoOptions = {
decoder: "ffmpeg_h264" | "vulkan_video";
}

Properties

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).

InputWhipAudioOptions

Parameters of a audio source included in the WHIP stream.

Type definitions

type InputWhipAudioOptions = {
decoder: "opus";
forward_error_correction?: bool;
}

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