Configuration
These docs describe configuration v3. Set version = "3" at the top of each complete configuration. Use a TOML file, or JSON with a .json extension. One Packager instance can handle multiple sources and sinks, and each source/sink can have its own transcoder.
- See the example files for common use cases.
- Refer to the configuration options section for each section and its options.
- Test inputs provide reproducible local fixtures.
Structure of the configuration file
The configuration file is divided into several sections, each with its own purpose. The main sections are:
[logging]: Configure logging options.[api]: Configure the API options for monitoring and controlling the Packager.[[sources]]: Define input sources for the Packager, such as RTMP, SDI, MPEG-TS, etc. Each source is defined as a table entry.[[transcoders]]: Define how to process and encode input media streams into multiple renditions (bitrates, codecs, etc.).[[sinks]]: Define output destinations, such as MoQ or RTMP to e.g. Vindral Live.[[aliases]]: Define aliases for sources and sinks. This is useful for creating named API endpoints.
Replace the YOUR_* placeholders with your input and publishing settings.
The input URLs identify the audio and video feeds; use your RTMP destination and
your channel's Vindral publish URL (https://lb.cdn.vindral.com/api/edge/publish-url/YOUR_STREAM_KEY) for the two outputs.
The example below uses:
- two RTMP PULL sources
- one where only audio is picked for transcoding and sent to RTMP PUSH
- one where audio is passthroughed while video is transcoded, and sent as a ladder to Vindral Live
# Vindral Bridge Packager
# example of two RTMP PULL -> one stream is transcoded and sent as audio only/radio,
# one is full ladder video transcode and audio passthrough to Vindral Live
# Configuration format
version = "3"
# can be useful for debugging issues with sources
[logging]
ffmpeg_log_level = "verbose"
# first feed where we will pick only the audio
[[sources]]
id = "feed-1"
source_type = "flv"
[sources.protocol_options.url]
type = "string"
value = "rtmp://YOUR_INPUT_HOST/live/YOUR_AUDIO_STREAM_KEY"
# second feed where we will passthrough audio and transcode video to a ladder
[[sources]]
id = "feed-2"
source_type = "flv"
[sources.protocol_options.url]
type = "string"
value = "rtmp://YOUR_INPUT_HOST/live/YOUR_VIDEO_STREAM_KEY"
# select feed-1 audio and transcode
[[transcoders]]
id = "feed-1-encode"
source_ids = ["feed-1"]
# we pick the audio track, do not pass it through but rather transcodes it to 64 kbps
[[transcoders.tracks]]
type = "audio"
id = "audio"
[transcoders.tracks.track_selector]
type = "track-kind"
kind = "audio"
is_required = true
[[transcoders.tracks.renditions]]
id = "aac"
bit_rate = 64_000
codec = "aac"
sample_rate = 48_000
# select feed-2 video and audio
[[transcoders]]
id = "feed-2-encode"
source_ids = ["feed-2"]
# we pass through the incoming video and add two more renditions/qualities as well
[[transcoders.tracks]]
type = "video"
id = "video"
passthrough = true
[transcoders.tracks.track_selector]
type = "track-kind"
kind = "video"
criteria = "best" # if you have multiple video tracks, this will select the best one (highest quality)
is_required = true
[[transcoders.tracks.renditions]]
id = "540p"
codec = "h264"
gop_size_ms = 1000
bit_rate = 1_200_000
# you can set the size of the video specifically
[transcoders.tracks.renditions.size]
width = 960
[[transcoders.tracks.renditions]]
id = "half-size"
codec = "h264"
gop_size_ms = 1000
bit_rate = 500_000
# you can set the size of the video as a scale of the original
# which is useful for cases where you either don't know the size of the original
# or if it might be portrait/landscape and you don't want to hardcode the size
[transcoders.tracks.renditions.size]
scale_factor = 0.5
# this is live thumbnails, created every 5 seconds
[[transcoders.tracks.renditions]]
id = "thumbnails"
codec = "mjpeg"
gop_size_ms = 5000
bit_rate = 1280
frame_skipping = "frame_every_5_seconds"
# we pick the audio track, passthrough the aac and add a opus track as well
[[transcoders.tracks]]
type = "audio"
id = "audio"
passthrough = true
[transcoders.tracks.track_selector]
type = "track-kind"
kind = "audio"
is_required = true
[[transcoders.tracks.renditions]]
id = "opus"
bit_rate = 128_000
codec = "opus"
sample_rate = 48_000
# feed-1 sink RTMP PUSH audio only
[[sinks]]
id = "feed-1-rtmp"
sink_type = "flv" # flv is rtmp
source_ids = ["feed-1-encode"]
wait_for_all_sources = true
# Set the RTMPS publishing URL supplied by your destination.
[sinks.protocol_options.url]
type = "string"
value = "rtmps://YOUR_INGEST_HOST/publish/YOUR_STREAM_KEY"
# feed-2 sink Vindral Live full ladder
[[sinks]]
id = "feed-2-vindral"
sink_type = "vindral_ws"
source_ids = ["feed-2-encode"]
wait_for_all_sources = true
# Your channel's publish URL: https://lb.cdn.vindral.com/api/edge/publish-url/YOUR_STREAM_KEY
[sinks.protocol_options.url]
type = "string"
value = "YOUR_VINDRAL_PUBLISH_URL"
# sets up alias for the sink, to allow access to API with a certain key
[[aliases]]
[aliases.key]
type = "string"
field = "example_key" # whatever you want to call it
[aliases.value]
type = "uuid"
field = "feed-2-vindral" # the sink id
This example combines two independent feeds in one file to show the structure. In production, you can also run one Packager per feed, so that each restarts independently.
See the example files for real common use cases.
Configuration options
The configuration file is divided into several sections, each with its own purpose. Below is a description of each section and its options.
[logging]
The logging section is used to configure the logging options for the Packager. The following options are available:
ffmpeg_log_level: The log level for FFmpeg. Possible values arequiet,panic,fatal,error,warning,info,verbose,debug, andtrace. The default value isverbose.level: The log level for the Packager. Possible values areerror,warn,info,debug, andtrace. The default value isinfo.log_levelis accepted as an alias.browser_log_level: The threshold for Chromium's own log output from browser sources, written as plain text to stderr. Possible values aredisable,fatal,error,warning,info, andverbose. The default value isdisable. The setting applies to the whole process and is fixed when the browser engine starts. Pageconsole.*output is logged separately at trace level; enable it withfilter = "media_engine_browser=trace".
[api]
The API section is used to configure the API options for the Packager. The following options are available:
bind: Address and port for the API and metrics. Default:0.0.0.0:4040.api_key: Optional string. When set, all routes requireAuthorization: Bearer <key>, including/healthcheckand/metrics. See API authentication.
[[sources]]
The sources section configures the input sources for the Packager. Each source is defined as a table entry with the following options:
| Field | Description |
|---|---|
source_type | Type of source input. |
name | A human-readable name for the source. |
id | Unique string identifier for the source. Used for cross-referencing. |
description | Optional free-text description of the source. |
protocol_options | Source-type-specific options (e.g., device name for DeckLink). |
target_state | Desired state of the source on start. Options: started, stopped. Default: started. |
Example:
[[sources]]
id = "sdi-input"
source_type = "decklink_sdk"
protocol_options = { device = "DeckLink Duo (1)" }
Source types
source_type | Description | Protocols |
|---|---|---|
flv | RTMP / FLV input. | rtmp, rtmps |
srt | MPEG-TS over SRT. See SRT. | srt |
mpegts | MPEG-TS over UDP, RTP, TCP, RIST or SRT. See RIST. | udp, rtp, tcp, srt, rist |
rtsp | Pull from an IP camera or RTSP server. See RTSP. | rtsp, rtsps |
hls | HLS input. | http, https, file |
decklink_sdk | Blackmagic DeckLink SDI/HDMI capture through the DeckLink SDK. See DeckLink. | |
decklink | DeckLink capture through FFmpeg. Kept for existing configurations; see DeckLink. | |
ndi | NDI input. See NDI. | |
test-signal | Built-in clock, bars and tone. See Test signal. | |
file | File input. Set realtime_pacing = true to play out at wall-clock speed. | file |
image | A static image (PNG, JPEG, …) re-emitted continuously as video. See image sources. | file |
browser | A rendered web page, optionally with its audio. See browser sources. | http, https |
moq | Media over QUIC input. | |
vindral_ws | Vindral WebSocket media transport. | ws, wss |
Image sources
source_type = "image" turns a still image into a continuous video track, useful for slates,
holding cards and test patterns. The file path goes in protocol_options.url, and the only
demuxer option is frame_rate (default 30, range 1–240).
[[sources]]
id = "slate"
source_type = "image"
[sources.protocol_options.url]
type = "string"
value = "./slate.png"
[sources.demuxer_options.frame_rate]
type = "u_int"
value = 25
Browser sources
source_type = "browser" renders a web page and emits it as a video track, optionally with
the page's audio as a second track. Use it for graphics overlays and for fully web-rendered
output.
The page URL goes in protocol_options.url and must be an http:// or https:// URL;
file:// URLs and local paths are refused. The page cannot reach loopback, private, LAN or
link-local addresses. See Network access.
Everything else is set through demuxer_options:
| Option | Type | Default | Range | Description |
|---|---|---|---|---|
width | u_int | 1920 | 1–3840 | Browser viewport width in pixels. Width × height may not exceed 3840×2160. |
height | u_int | 1080 | 1–3840 | Browser viewport height in pixels. |
transparent_background | bool | true | Render with a transparent background, so the page can be alpha-blended over another source. Set to false when the page is the only source. | |
frame_rate | u_int | 30 | 1–60 | Output frame rate. The source paces itself at this rate and does not need realtime_pacing. |
startup_delay_ms | u_int | 0 | 0–60000 | How long to hold back frames after the page is created, so it can load and lay out first. |
audio_capture | bool | false | Capture the page's audio as a synchronised PCM track alongside the video. |
Example:
[[sources]]
id = "browser-overlay"
source_type = "browser"
[sources.protocol_options.url]
type = "string"
value = "https://example.com/scoreboard"
[sources.demuxer_options.width]
type = "u_int"
value = 1920
[sources.demuxer_options.height]
type = "u_int"
value = 1080
[sources.demuxer_options.transparent_background]
type = "bool"
value = true
[sources.demuxer_options.audio_capture]
type = "bool"
value = true
Video is produced as BGRA and audio as PCM; converting them is the transcoder's job. When
audio_capture is enabled the audio track always exists, even if the page is silent; the
source fills the gaps with silence. If the page's audio context is not 48 kHz stereo, the
source resamples it automatically.
width, height and frame_rate dominate the cost of a browser source: every frame is
rendered by a full browser engine and then carried through the pipeline as raw BGRA, so both
the render cost and the bandwidth scale with resolution and rate. Configure only what the
output actually needs. Halving the frame rate halves the render work, and a graphic that
occupies a corner of the frame should be rendered at its own size and positioned with the
overlay node's x and y rather than as a full-frame transparent page.
The browser source runs in a separate Packager image. Contact Vindral support for access.
See Browser overlay on a live source and Browser as the only source for complete configurations.
[[transcoders]]
The transcoders section defines how to process and encode input media streams into multiple renditions (bitrates, codecs, etc.).
| Field | Description |
|---|---|
id | Unique string ID of the transcoder. |
name | Name used to identify the transcoder. |
description | Free-text description. |
target_state | Desired state of the transcoder. Default: started. |
source_ids | List of upstream task IDs the transcoder listens to. |
device | Hardware device used to accelerate transcoding: cpu, nvidia, netint_quadra, netint_t4xx, qsv or vaapi. Defaults to automatic selection. See Usage for driver setup. Intel QSV and AMD VAAPI join automatic selection only when their opt-in environment variable is set to 1, true or yes. |
queue_size | Packets buffered before the transcoder starts dropping. Default 10000. |
[[transcoders.tracks]]
Defines a specific media track (e.g., video or audio) to be processed.
| Field | Description |
|---|---|
id | String ID of the configured track. |
type | Track type: video, audio, subtitle, or data. A data track (SCTE-35, SMPTE ST 2038, KLV or another MPEG-TS data PID) is passthrough only and takes just id and track_selector. |
passthrough | Forward the selected track unchanged, in addition to any configured renditions. Default false. |
track_selector | Selection strategy for track. Usually track-kind with kind = video or audio and criteria = best. |
[transcoders.tracks.processing]
Optional per-track processing applied before encoding.
For video tracks:
| Field | Description |
|---|---|
deinterlace | every_field (default, one output frame per field), every_frame, or disabled. Only applies to interlaced input. |
max_frame_rate | Caps the frame rate of every rendition on this track, given as a fraction, e.g. [30, 1]. |
gop_alignment | Where the encoder places keyframes. Unset by default: each encoder follows its own gop_size_ms. See GOP alignment. |
hw_filtering_enabled | Whether scaling and filtering may use the hardware scaler. Default true. Set to false to force software filtering. |
filter_threads | Slice threads for software scaling. Hardware scaling always uses 1. Kept small by default to avoid thread oversubscription when several packagers share a host. |
For audio tracks:
| Field | Description |
|---|---|
filters | An FFmpeg filter chain applied to the audio, e.g. channelmap=map=4|5. See Audio filtering. |
GOP alignment
gop_alignment takes one of two forms:
| Value | Behaviour |
|---|---|
"match_incoming" | A keyframe is forced wherever the source has one. The renditions' gop_size_ms is ignored. The encoder can still add keyframes of its own when the source has none for a long time; libx264 adds one every 250 frames. |
{ aligned = { gop_size_ms = 1000 } } | A keyframe is forced on every gop_size_ms boundary of the frame timestamps. |
[transcoders.tracks.processing.gop_alignment.aligned]
gop_size_ms = 1000
processing = { gop_alignment = "match_incoming" }
With aligned, keyframe placement follows the timestamp grid rather than a frame count.
Renditions, restarts and separate Packagers fed the same timeline therefore place keyframes
on the same timestamps, and a dropped frame does not shift the GOP phase. Timestamps that
jump back by up to half a GOP keep the current GOP; a larger jump restarts the grid. Frames
without timestamps fall back to frame counting. A frame-count backstop of two GOPs
keeps keyframes regular on every encoder.
libx264, libx265, NVENC and QSV encoders get forced IDR frames under both modes. NETINT
encoders run with intraPeriod=0, so the card adds no keyframes of its own. VAAPI encoders keep
their own cadence; see AMD VAAPI.
[[transcoders.tracks.renditions]]
Each track can have multiple renditions with different quality levels for adaptive streaming.
| Field | Description |
|---|---|
id | String ID of the rendition. |
codec | Encoding codec: h264, mjpeg, aac, opus, av1, etc. |
gop_size_ms | GOP (Group of Pictures) size in milliseconds. |
bit_rate | Target bitrate (in bits per second). |
max_b_frames | Maximum number of consecutive B-frames. QSV and VAAPI encoders default to none; NETINT encoders use B-frames only when this is greater than 0 and the profile allows them. |
frame_skipping | Options like none, half, quarter, frame_every_1_seconds, frame_every_5_seconds. Default none. |
sample_rate | For audio: in Hz (e.g., 48000). |
channels | Number of audio channels (usually 2). Default same as incoming. |
Size block:
[transcoders.tracks.renditions.size]
width = 1280
height = 720 # omit height to retain the input aspect ratio
[transcoders.tracks.renditions.size]
scale_factor = 0.5 # scale the original size by this factor
Rate control buffer:
[transcoders.tracks.renditions.rc_buffer_size]
unit = "milliseconds"
value = 2000 # buffer duration in milliseconds
Encoder specific options:
[transcoders.tracks.renditions.options.h264_nvenc]
profile = "high"
preset = "p4" # choose a preset supported by the NVENC encoder in your build
[transcoders.tracks.renditions.options.libx264]
profile = "high" # or "main", "baseline"
preset = "veryfast" # or "ultrafast", "superfast", "fast", "medium", "slow", "slower", "veryslow"
[[sinks]]
The sinks section defines output destinations, such as MoQ or RTMP to e.g. Vindral Live.
| Field | Description |
|---|---|
sink_type | Output type. See sink types below. |
name | Human-readable name for the sink. |
id | String ID of the sink. |
description | Free-text description. |
target_state | Desired state (started or stopped). |
source_ids | IDs of upstream sources, transcoders, or compositors. |
protocol_options | Sink-specific settings (e.g., url, timeouts). |
Example:
[[sinks]]
id = "vindral"
sink_type = "vindral_ws"
source_ids = ["encode"]
[sinks.protocol_options.url]
type = "string"
value = "YOUR_VINDRAL_PUBLISH_URL"
Sink types
sink_type | Description | Protocols |
|---|---|---|
flv | RTMP / FLV output. | rtmp, rtmps |
srt | MPEG-TS over SRT. See SRT. | srt |
mpegts | MPEG-TS over UDP, RTP, TCP, RIST or SRT. | udp, rtp, tcp, srt, rist |
decklink_sdk | Blackmagic DeckLink SDI/HDMI playout through the DeckLink SDK. See DeckLink. | |
decklink | DeckLink playout through FFmpeg. Kept for existing configurations. | |
ndi | Publish as an NDI source on the local network. See NDI. | |
hls | HLS output, including recording to S3-compatible storage. See Upload recordings to S3. | |
moq | Media over QUIC output. See MoQ transport selection. | |
vindral_ws | Vindral WebSocket media transport to Vindral Live. See SDI to Vindral. | ws, wss |
srt and mpegts with an srt:// URL produce the same output; srt only accepts
srt:// URLs, which makes the intent explicit. SRT, RIST, NDI and DeckLink types are
registered only when the image or host provides their libraries. See
Inputs, outputs and transports.
[[compositors]]
The compositors section combines several decoded sources into a single output: video
layers blended or tiled together, audio tracks mixed down, and any other tracks carried
through untouched. A compositor decodes the tracks it selects from its inputs and produces
raw frames, so it is followed by transcoders that encode. Its inputs can be sources or
transcoders. Put a transcoder in front when you want to control decoding, scaling or format
conversion yourself, for example to decode on a GPU or to bring inputs to one resolution;
such a transcoder decodes with the wrapped_avframe rendition codec.
| Field | Description |
|---|---|
id | Unique identifier of the compositor. Referenced by downstream transcoders in their source_ids. |
name | Human-readable name. |
description | Free-text description. |
target_state | Desired state of the compositor. Options: started, stopped. Default: started. |
anchor | The id of the input, in video, audio or passthrough sources, whose clock the output follows. Optional. By default the compositor anchors on a passthrough video input if there is one, otherwise on its first decoded input. See Clocks and timestamps. |
video | Video compositing: sources and filter nodes. Optional. |
audio | Audio compositing: sources and filter nodes. Optional. |
passthrough | Tracks that bypass filtering entirely. Optional. |
Each of video, audio and passthrough declares its own sources, and video and
audio additionally declare nodes.
[[compositors.video.sources]] and [[compositors.audio.sources]]
A source binds a track from an upstream task to a local label that filter nodes reference.
| Field | Description |
|---|---|
id | Local label for this input, referenced by source_ids on the nodes below. |
source_id | The id of the upstream source or transcoder that produces the track. |
track_selector | Which track to take from that task. Usually track-kind with kind and criteria. |
Note the two levels of naming: source_id points at an upstream task, while id is a label
local to this compositor. A node's source_ids refers to the local labels, not to the
upstream tasks.
[[compositors.video.nodes]] and [[compositors.audio.nodes]]
A node applies one filter to one or more inputs.
| Field | Description |
|---|---|
type | The filter to apply. See the filter tables below. |
id | Unique identifier of the node. Also the address used by the filter command API. |
source_ids | Local source labels feeding this node, in order. Order is significant for most filters. |
output_format | Video nodes only. Appends a format conversion to the node's output, for example yuv420p to strip alpha, or cuda to keep frames in GPU memory. |
Any filter-specific options are set directly on the node table alongside these fields.
A node reads local input labels from this compositor's sources list. To apply
filters in sequence, use separate compositor tasks and wire an input's
source_id to the previous compositor. A node ID is not an input label for
another node in the same compositor. See live audio levels.
Video filters
type | Inputs | Options | Commands |
|---|---|---|---|
overlay | 2 | x, y (offset expressions, default "0"), format (set to "auto" to enable alpha blending) | x, y |
overlay_cuda | 2 | x, y (offset expressions, default "0") | — |
overlay_qsv | 2 | x, y (offset expressions, default "0"), w, h (overlay layer size expressions), alpha (global alpha, 0–255) | — |
xstack | 2–61 | grid (e.g. "1x2", "2x2") | — |
drawtext | 1 | See drawtext options | See drawtext options |
null | 1 | — | — |
The first entry in source_ids is the base layer; later entries are drawn on top of it.
overlay runs on the CPU and overlay_cuda on an NVIDIA GPU. They are separate filters
rather than one filter with a device switch, mirroring FFmpeg's own split. overlay_cuda
has no format option. Its alpha blend runs in 8-bit yuv420p, so its output is 8-bit, also for a
main input with more bits per component, such as p010 from NVDEC.
overlay_qsv blends on an Intel GPU through QSV. Both inputs must be QSV frames on the same
device: decode them with device = "qsv" transcoders using codec = "wrapped_avframe" and
format = "qsv", and set output_format = "qsv" on the node so frames stay in GPU memory.
See Intel QSV browser overlay.
All three filters accept x and y expressions in the configuration, but only the CPU
overlay supports changing them at runtime through the filter command API. Repositioning an
overlay_cuda or overlay_qsv node requires restarting it with an updated configuration.
Use null when a compositor needs a video path but no actual compositing, for example when
its real work is on the audio side.
Audio filters
type | Inputs | Options | Commands |
|---|---|---|---|
amix | 2–64 | weights, normalize | weights |
amerge | 2–64 | — | — |
volume | 1 | volume (linear gain) | volume |
anull | 1 | — | — |
channelmap | 1 | map, channel_layout | — |
amix sums its inputs into one track. The first entry in source_ids is the timing
master: it passes through untouched and defines the output sample rate and timeline, and
every other input is resampled to lock onto it. That is what lets independently-clocked
sources, such as a live feed and a browser page, stay aligned instead of drifting apart, and
it is why sources with different sample rates can be mixed at all. The ordering convention
matches video overlay, where the base layer is listed first.
weightsis one gain per entry insource_ids, in the same order. If given, its length must equal the number of sources. A source whose selector matches several tracks applies its weight to each of them. Weights must be finite and non-negative and cannot all be zero; a single zero mutes that source. Omittingweightsgives every source a gain of 1.normalizedivides by the sum of the weights. It defaults tofalse, which keeps the master at its true level and adds the other inputs on top. Setting it totrueguards against clipping but pulls the master down.
amerge differs from amix: rather than summing inputs into one track, it combines their
channels into a single multi-channel track.
amix takes new weights as a filter command
while the stream runs, for example {"weights": [1.0, 0.0]} to take the second source out of
the mix. Send one weight per source, in source_ids order; a source with several audio tracks
applies its weight to each. The limits are the same as in the configuration, and a command
that breaks them returns 422. amerge does not accept commands. To give one input its own
level control, run its volume node in a separate compositor that feeds the mix; see
Change audio levels through the API.
channelmap reorders, drops, duplicates or relabels the channels of one input:
maplists the output channels in order. Each entry is"in"or"in-out", where a channel is an FFmpeg channel name (FL,FR,FC,LFE,BL,BR, ...) or a zero-based index. All entries must use the same form. Default: empty.channel_layoutnames the output layout (stereo,5.1,FL+FR). Whenmapis empty it is required and relabels the input channels in place; otherwise its channel count must equal the number ofmapentries.
At most 64 channels are allowed, output channels cannot repeat, and index outputs must cover
0 to n-1. The Packager checks this before it builds the graph. The output keeps the
input's sample format.
[[compositors.audio.nodes]]
type = "channelmap"
id = "swap-stereo"
source_ids = ["audio"]
map = ["FR-FL", "FL-FR"]
channel_layout = "stereo"
[[compositors.passthrough.sources]]
Tracks declared here bypass decoding and filtering completely; only their presentation timestamps are normalised so they line up with the composited timeline. This is how subtitle and data tracks are carried through a compositor.
| Field | Description |
|---|---|
id | Local label for this input. |
source_id | The id of the upstream task. |
track_selector | Which tracks to take. |
enabled | Whether packets are forwarded. Default true. A disabled source drops its packets. |
enabled can be changed at runtime by sending {"enabled": false} or {"enabled": true} to
the source's id through the compositor command API.
Example:
[[compositors.passthrough.sources]]
id = "subs"
source_id = "decoder"
enabled = true
[compositors.passthrough.sources.track_selector]
type = "track-kind"
kind = "subtitle"
criteria = "all"
drawtext options
drawtext burns text into the video. text is required; everything else is optional.
| Option | Description |
|---|---|
text | The text to draw. UTF-8. Supports FFmpeg text expansion, so %{localtime\:%H\\\:%M\\\:%S} renders a running clock. |
font | Font family. Default "Sans". |
fontfile | Path to a font file, used instead of font. |
font_size | Font size. Default 16. |
font_color | Text colour. Default "black". |
font_color_expr | Expression producing a dynamic text colour. Overrides font_color. |
alpha | Alpha blending, 0.0–1.0. Default 1. |
x, y | Offset expressions. Default "0". |
box | Draw a box behind the text: 0 or 1. Default 0. |
box_color | Box colour. Default "white". Supports "[email protected]" for opacity. |
box_border_w | Box border width. Accepts "10", "10|20", "10|20|30" or "10|20|30|40". Default "0". |
box_w, box_h | Explicit box size. Computed automatically by default. |
border_w | Width of the outline around the text. Default 0. |
border_color | Outline colour. Default "black". |
shadow_x, shadow_y | Shadow offset. Default 0. |
shadow_color | Shadow colour. Default "black". |
line_spacing | Line spacing in pixels. Default 0. |
text_align | Vertical T/M/B plus horizontal L/C/R, e.g. "TL", "MC", "BR". |
y_align | What y refers to: "text" (default), "baseline" or "font". |
expansion | Text expansion mode: "none", "strftime" (deprecated) or "normal" (default). |
fix_bounds | Adjust coordinates to avoid clipping. |
text_shaping | Shape text before drawing. Default 1. |
tabsize | Tab width in spaces. Default 4. |
start_number | Starting value for the frame-number variable. Default 0. |
basetime | Start time for the count, in microseconds. strftime expansion only. |
timecode | Initial timecode, hh:mm:ss[:;.]ff. |
timecode_rate | Timecode frame rate. Rounded to the nearest integer, minimum 1. |
tc24hmax | Wrap the timecode at 24 hours: 0 or 1. Default 0. |
text, font_color, font_size, alpha, x, y, box, box_border_w, box_color,
box_w, box_h, line_spacing, text_align, border_w, border_color, shadow_color,
shadow_x and shadow_y can all be changed at runtime
through the filter command API.
Example:
[[compositors.video.nodes]]
type = "drawtext"
id = "clock"
source_ids = ["v1"]
text = "%{localtime\\:%H\\\\\\:%M\\\\\\:%S}"
font_size = 48
font_color = "white"
box = 1
box_color = "[email protected]"
box_border_w = "10"
x = "(w-text_w)/2"
y = "20"
shadow_x = 2
shadow_y = 2
shadow_color = "[email protected]"
Full example
[[compositors]]
id = "compositor"
[[compositors.video.sources]]
id = "base"
source_id = "main-decoder"
[compositors.video.sources.track_selector]
type = "track-kind"
kind = "video"
[[compositors.video.sources]]
id = "overlay"
source_id = "overlay-decoder"
[compositors.video.sources.track_selector]
type = "track-kind"
kind = "video"
[[compositors.video.nodes]]
type = "overlay"
id = "overlay"
source_ids = ["base", "overlay"]
x = "16"
y = "16"
format = "auto"
output_format = "yuv420p"
[[compositors.audio.sources]]
id = "base-audio"
source_id = "main-decoder"
[compositors.audio.sources.track_selector]
type = "track-kind"
kind = "audio"
[[compositors.audio.sources]]
id = "overlay-audio"
source_id = "overlay-decoder"
[compositors.audio.sources.track_selector]
type = "track-kind"
kind = "audio"
[[compositors.audio.nodes]]
type = "amix"
id = "audio-mix"
source_ids = ["base-audio", "overlay-audio"]
weights = [1.0, 0.3]
normalize = false
See Browser overlay on a live source for a complete configuration built around a compositor, including the decoding and encoding transcoders on either side of it.
[[aliases]]
Optional. Binds a human-readable key to a task ID, so the HTTP API can address it by
that key. See Identifiers. Alias values are written with type = "uuid".
[[aliases]]
[aliases.key]
type = "string"
field = "example_key" # whatever you want to call it
[aliases.value]
type = "uuid"
field = "feed-1-rtmp" # the id being aliased
With the alias above, POST /api/sinks/example_key/stop acts on that sink.
Common options and defaults
The following values apply to v3 tasks independently of the media protocol. Plugin-specific options belong in the appropriate option map described below.
| Field | Applies to | Default | Meaning |
|---|---|---|---|
id | All tasks | Required | Unique string used for graph connections. |
name | All tasks | Unset | Optional display name. |
description | All tasks | Empty string | Description for operators. |
target_state | All tasks | started | Desired state on startup; actual state can be waiting or starting. |
annotations | Top level, sources, sinks, transcoders | Empty map | String-to-string metadata. |
track_selectors | Sources, sinks | Empty list | Empty selects all tracks; see track selection. |
reconnect_delay_ms | Sources, sinks | 1000 | Delay between reconnect attempts, in milliseconds. |
connect_timeout_ms | Sources, sinks | Unset | Optional task connection deadline, in milliseconds. |
idle_timeout_ms | Sources, sinks | 20000 | Idle deadline, in milliseconds. |
queue_size | Transcoders, sinks | 10000 | Queue capacity in messages/packets, not a latency in milliseconds. |
wait_for_all_sources | Sinks | false | Wait for every configured upstream task before starting. |
realtime_pacing | Sources | false | Pace fast-reading inputs such as files to media time. |
handle_timestamp_rollover | Sources | true | Handle timestamp wraparound. |
interleave_buffer | Sources | Unset | Optional packet interleaving; max_buffer_size_ms bounds the buffer duration. Adds latency. |
A required source_ids list on a transcoder or sink refers to upstream task IDs.
A media track ID is a separate integer. See How the Packager works.
Option maps and typed values
| Map | Purpose |
|---|---|
sources.protocol_options | Input transport or URL options. |
sources.demuxer_options | Container/device/browser input options. |
sinks.protocol_options | Output transport or storage options. |
sinks.muxer_options | Output container/packaging options. |
transcoders.tracks.decoder.options | Options for the decoder implementation. |
transcoders.tracks.renditions.options | Encoder options, optionally grouped by encoder name such as libx264 or h264_nvenc. |
Strings support shorthand. Numeric and boolean plugin values use a typed object:
[sources.protocol_options]
url = "rtmp://example.com/live/input"
[sources.demuxer_options]
# Example for an image source; applicability depends on source_type.
frame_rate = { type = "int", value = 30 }
Types are string, int, u_int, double, bool, ratio, pixel, and
sample; a ratio value is [numerator, denominator]. Field types and units in
option maps belong to the selected plugin. For example, an FFmpeg rw_timeout
value is not interchangeable with the task's idle_timeout_ms. Do not assume all
timeout options use milliseconds. See Protocols.
Decoder and encoder controls
A track's optional decoder block accepts name, options, hw_frames_enabled
(default true), thread, max_error_tolerance (default 10), and
extract_codec_frame_rate (default false). A thread block has kind and
count; see performance tuning for effective defaults and
precedence.
Video renditions also support encoder_name, format, thread, qmin, qmax,
min_bit_rate, and max_bit_rate. gop_size_ms defaults to 2000,
rc_buffer_size to { unit = "milliseconds", value = 1000 }, and
frame_skipping to none. An omitted bitrate leaves selection to the encoder.
min_bit_rate and max_bit_rate describe offsets from the target bitrate:
the default { unit = "fraction", value = 0.1 } gives a minimum of 90% and
maximum of 110% of the target. unit = "absolute" expresses the offset in bits
per second. Encoder support determines which controls take effect.
Size accepts { width = 1280, height = 720 }, { width = 1280 },
{ scale_factor = 0.5 }, or {} to match the input. Width-only sizing preserves
aspect ratio. Scale-derived dimensions are rounded to the nearest even value. To size by height
while keeping the aspect ratio, compute the width, since height alone is not a size form.
Logging and control plane
logging.level defaults to info; log_level is also accepted. logging.kind
is fancy (default) or json, and logging.filter adds per-module filters.
See Monitoring for examples.
[control_plane] accepts url, token, optional hostname, and
heartbeat_interval (duration string, default "2s"). Adding this block connects
the instance to the control plane while retaining local tasks. The separate
start managed command changes task ownership; see Managed mode.
For [[drm_provider]] and sink drm_provider_id, see the
DRM guide. For subtitle-specific settings, see
Subtitles. For clocks and timestamps, see Synchronization.
Validation
Use the v3 schema and example checks to catch unsupported fields and missing references before starting a pipeline. The schema checks structure; only a running pipeline can confirm codec, device, and protocol availability in your image.
Test inputs
Use the quickstart fixture for a local video and audio signal, or the workflow fixtures for camera, audio-mixing and graphics examples. These inputs make the expected picture and sound reproducible without depending on a public demo endpoint.
For RTMP, SRT or other network inputs, supply a stream you control and replace the example's input URL with its actual playback address.