VionetoVioneto
Back to the magazine

VIONETO MAGAZINE Playback & technology

Choose the right audio track before exporting a video

A file can contain multiple audio tracks, even though the player is currently playing only one. Check your selection before exporting using a clear and traceable FFmpeg example.

Two colored audio tracks are displayed beneath a video preview. The marked upper track results in a single export file.
When exporting, an entire audio track is selected. The schematic illustration does not include any measurement data.Image: Vioneto · AI-generated illustration

If your video file includes a German version, an English version, and possibly a commentary, check the selected audio track before exporting to the website. The fact that a local player is currently playing German only describes its current playback behavior. To ensure a clearly defined output file, set the audio track selection during export and then verify the result afterward.

Distinguish audio track from stereo channel

An audio track is a separate stream within the file. It may contain one or two channels. Therefore, the second audio track is not automatically the right channel. When dealing with speech and commentary, you usually look for the correct stream. If the same content comes from only one speaker, you instead check that speaker's channel assignment.

First, review the actual file list

With FFprobe installed, this command lists the audio streams of a local file in JSON format: ffprobe -v error -select_streams a -show_streams -of json eingabe.mp4

Check the number of streams, their language labels, available titles, and channel count. Metadata serves as guidance, not proof of audio content: a stream labeled "German" may be incorrectly tagged. Listen to the beginning and a clearly identifiable point later in the stream, then assign the desired version to the correct stream.

FFprobe documentation on stream selection and stream details

Select the correct audio track before video export

If both video and audio are already suitable for your target file, FFmpeg can copy them without re-encoding. This example takes the first video stream and the first audio track: ffmpeg -i input.mp4 -map 0:v:0 -map 0:a:0 -c copy output-first-audio-track.mp4

For the second audio stream, use instead -map 0:a:1 and a new output filename. The first zero refers to the first input file; the last number counts within the specified stream type starting from zero. The selection here includes only the specified streams. Additional audio or subtitle tracks are not automatically included.

The FFmpeg documentation describes this explicit mapping using -map. A language tag can also serve as a selection criterion; however, it requires additional verification if language tags are missing or duplicated. If copying fails due to an inappropriate codec or container, a properly configured new export is necessary.

FFmpeg documentation on stream selection using -map

What we checked in our own file

For this guide, a local three-second synthetic file was created featuring a test image and two separate AAC audio tracks: one at 440 Hz and one at 880 Hz. The language labels "deu" and "eng" were used exclusively for example captions; the file contains no spoken languages.

Both selection commands generated files containing exactly one video and one audio stream. After complete decoding, the PCM audio data checksums matched exactly with the selected source track; the two source tracks were different. This was verified using FFmpeg 8.0.1. This demonstrates the behavior in this example, not the browser compatibility of arbitrary customer files.

Reduce viewer uptake

Re-check the new file using FFprobe and listen to it fully or at all content-critical points. Specifically verify that the opening and later scenes contain the desired language or mix. After uploading, test the actual viewer player that is generated. The presence of multiple tracks during upload does not automatically mean that the video host offers them as selectable versions.

Check mono, stereo, and channel assignment in video

Plan multilingual course videos as expenses

Topics

Sources and further reading

  1. https://www.ffmpeg.org/ffmpeg.html
  2. https://www.ffmpeg.org/ffprobe.html