Information about a file

Use ffprobe:

_$: ffprobe file.mkv

Map streams

Let’s say we have a file named file.mkv with the following streams:

  • 0:0 Video
  • 0:1 Audio (Spanish)
  • 0:2 Audio (English)
  • 0:3 Subtitles (Spanish)
  • 0:4 Subtitles (English)

and we want to

  • Rescale the video to 1024x768
  • Keep only the Spanish audio

we can run the following command:

_$: ffmpeg -i file.mkv
    -map 0:0 \
    -map 0:1 \
    -vf scale=1024:768 \
    -c:a copy \
    file_1024.mkv

On a second thought, if we want to keep the English subtitles for some unfortunate souls:

_$: ffmpeg -i file.mkv
    -map 0:0 \
    -map 0:1 \
    -map 0:4 \
    -vf scale=1024:768 \
    -c:a copy \
    -c:s copy \
    file_1024.mkv