Skip to content

WHIP server

An input type that provides a WHIP server endpoint. It allows you to stream media to the Smelter.

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.

The bearer token will be returned as response to the input registration.

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_server",
"video": {
"decoder_preferences": ["ffmpeg_h264", "any"]
}
}

Reference

Type definitions

type WhipServer = {
type: "whip_server";
video?: VideoOptions;
bearer_token?: string;
required?: bool;
offset_ms?: f64;
};

Parameters for registering an WHIP endpoint as an input.

Properties

video

Parameters of a video source included in the WHIP stream.


bearer_token

Authentication token. If not provided, a random token will be generated and returned in the response body.

  • Type: string

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

VideoOptions

Parameters of a video source included in the WHIP stream.

Type definitions

type VideoOptions = {
decoder_preferences?: VideoDecoder[];
};

Properties

decoder_preferences

An ordered list of preferred video decoders. The first element in the list has the highest priority during WHIP negotiation.

Behavior:

  • If the list ends with “any”:

    • Smelter will first try the decoders explicitly listed (in order) and use the first one that is supported and negotiated in WHIP signaling.
    • If none of the listed decoders are supported, Smelter will fall back to any supported codec from the negotiated list that wasn’t already in the preferences.
  • If “any” is not included:

    • Only the decoders listed will be considered.
    • If none are supported, no fallback will occur.

VideoDecoder

Video decoder type.

Type definitions

type VideoDecoder =
| "ffmpeg_h264"
| "ffmpeg_vp8"
| "ffmpeg_vp9"
| "vulkan_h264"
| "any";

  • Type: “ffmpeg_h264” | “ffmpeg_vp8” | “ffmpeg_vp9” | “vulkan_h264” | “any”
  • Supported values:
    • "ffmpeg_h264" - Software H264 decoder based on FFmpeg.
    • "vulkan_h264" (Required feature: vk-video ) - Hardware decoder. Requires GPU that supports Vulkan Video decoding.
    • "ffmpeg_vp8" - Software VP8 decoder based on FFmpeg.
    • "ffmpeg_vp9" - Software VP9 decoder based on FFmpeg.
    • "any" - Automatically selects any video decoder supported by Smelter.