Skip to content
Mapping Syntax

Mapping Syntax

Use explicit maps only when automatic track selection is insufficient. Input and track indexes are zero-based; MPEG-TS PID selectors use decimal values.

Video and Audio Maps

  • Video: [INPUT:]v[:INDEX|best|HEIGHTp|WIDTHxHEIGHT][:CODEC][@FPS][FLAG][>FALLBACK]
  • Audio: [INPUT:]a[:INDEX|best][:CODEC][FLAG][>FALLBACK]
SelectorResult
v / aAll video or audio tracks
v:0 / a:0First track of that type
1:v:0 / 1:a:0First matching track from input 1
v:best / a:bestHighest-quality matching track
p:100:v:0 / p:100:a:0First matching track in program 100
i:256 / #256PID 256, restricted by the Video or Audio Map field

Video filters:

SelectorResult
v:1080pHighest-bitrate video with height 1080
v:1920x1080Highest-bitrate video with exact dimensions
v:1080p@251080-height video at 25 fps
v:h264H.264 video; also supports hevc, vp8, vp9, and av1
v:1920x1080:h264@25Exact size, codec, and frame rate

Audio codec selectors are aac, eac3, ac3, mp3, and mp2, for example a:0:aac.

Fallback and Multiple Matches

SyntaxResult
v:720p>v:1080p>v:0First selector that matches
a:0>a:1Use track 1 only when track 0 does not match
v:0,v:1 / a:0,a:1Multiple independent tracks
a:0?No match is allowed
v:1080p+Every matching 1080p track
v:1080p*Optional plus all matches

Compatibility forms include bare 0, v:, a:, :v:0, and :a:0. In matching fields, p:100 and p:100:0 abbreviate program selectors. Prefer explicit forms in new configurations.

Tip

Map Restrictions: PID Map selectors such as i:256 accept decimal only. Multiple selected video tracks are valid only when every Video Encoder uses Copy. For yt-dlp sources, use one Video Map and one Audio Map selector rather than comma-separated lists.

Subtitle Map

Use [INPUT:]s[:INDEX|best][:CODEC][FLAG][>FALLBACK].

SelectorResult
s / s:0 / 1:s:0All subtitles, first subtitle, or first from input 1
s:bestHighest-quality matching subtitle
s:dvb_subtitle / s:dvb_teletextDVB bitmap subtitle or teletext
s:webvtt / s:ttml / s:textNamed text subtitle codec
p:100:s:0First subtitle in program 100
i:258 / #258Decimal MPEG-TS PID 258
s:0>s:1 / s:0,s:1 / s:0?Fallback, multiple tracks, or optional match

Add -cc as a separate comma item, for example s:0?,-cc, to remove supported H.264/H.265 closed-caption SEI units. It does not select a subtitle track.

PID Map

PID Map uses comma-separated OUTPUT_STREAM_INDEX:PID pairs. The index is zero-based decimal; PID may be decimal or hexadecimal and must be 0–8191.

0:0x101,1:0x102

Each output index may appear once. Avoid reserved or conflicting PIDs and verify PAT/PMT with an MPEG-TS analyzer.

Metadata

Metadata uses comma-separated SCOPE:key=value entries. Scopes are g for global, s for stream, p for zero-based program, and c for zero-based chapter.

g:title=Channel,s:a:0:language=eng,p:0:service_name=News,c:1:title=Introduction

Stream scope accepts an output index, media type, or TYPE:INDEX. It does not accept map-only fallback, codec, resolution, best, ?, +, or * syntax. Values may contain = but not commas. A later duplicate scope and key replaces the earlier value.

Verify a Map

  1. Probe the source and identify its input, program, track, or PID.
  2. Start with v:0, a:0, or s:0.
  3. Add only the required constraint or fallback.
  4. Save and confirm the selected tracks in the generated process log.