Remove specific audio/subtitle stream from video

Show available streams

> ffprobe video_in.mkv
...
  Stream #0:0: Video: h264 (Main), ...
    ...
  Stream #0:1(spa): Audio: ac3, ...
    ...
  Stream #0:2(kor): Audio: ac3, ...
    ...
  Stream #0:3(spa): Subtitle: subrip
    ...
  Stream #0:4(eng): Subtitle: subrip
    ...

Remove specific streams

> ffmpeg -i video_in.mkv -map 0 -map -0:[type]:[idx] -c copy video_out.mkv
  • type … a = audio, v = video, s = subtitles
  • idx … index of the stream (starting from 0)

Let’s remove the spanish audio and the spanish subtitle stream from the video file.

> ffmpeg -i video_in.mkv -map 0 -map -0:a:0 -map -0:s:0 -c copy video_out.mkv
...
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:2 -> #0:1 (copy)
  Stream #0:4 -> #0:2 (copy)