Configure MKV Audio Description Flags with FFmpeg
This guide explains how to use FFmpeg to configure the “visual-impaired” and “descriptions” disposition flags for audio tracks within an MKV (Matroska) container. By setting these metadata flags, compatible media players can automatically identify and select audio description tracks for visually impaired users. You will learn the exact FFmpeg commands needed to apply these flags to your audio streams quickly and without re-encoding.
Understanding the Disposition Flags
In FFmpeg, stream properties like “visual-impaired” and “descriptions” are managed using dispositions.
- descriptions: Indicates that the audio track contains a spoken description of the visual action.
- visual_impaired: Indicates that the track is presented for the visually impaired.
In Matroska containers, these flags are often used together on a secondary audio track to define an Audio Description (AD) stream.
The FFmpeg Command
To set these flags, you target the specific audio stream using its
index. In the command below, we assume the main video is stream 0, the
primary audio is stream 1 (a:0), and the audio description
track is stream 2 (a:1).
Run the following command to set both flags on the second audio stream:
ffmpeg -i input.mkv -map 0 -c copy -disposition:a:1 descriptions+visual_impaired output.mkvCommand Breakdown
-i input.mkv: Specifies your source video file.-map 0: Selects all streams (video, audio, subtitles) from the input file to be included in the output.-c copy: Enables stream copying. This copies all video and audio data without re-encoding, preserving original quality and processing the file in seconds.-disposition:a:1 descriptions+visual_impaired: Targets the second audio stream (a:1) and applies both thedescriptionsandvisual_impairedflags. Use the+sign to combine multiple flags.
How to Target Different Audio Streams
FFmpeg uses zero-based indexing for stream selection. You must identify which audio stream needs the flags:
- To flag the first audio track, use
-disposition:a:0 descriptions+visual_impaired. - To flag the second audio track, use
-disposition:a:1 descriptions+visual_impaired. - To flag the third audio track, use
-disposition:a:2 descriptions+visual_impaired.
Verifying the Changes
After running the command, you can verify that the flags were
successfully applied using ffprobe:
ffprobe -show_entries stream=index,codec_type:stream_tags=disposition -v error output.mkvLook for the disposition section of your targeted audio stream in the output. It should display:
DISPOSITION:descriptions=1
DISPOSITION:visual_impaired=1