Skip to content

Instantly share code, notes, and snippets.

@theanurin
Last active December 20, 2022 07:33
Show Gist options
  • Save theanurin/06aa658269491a76d99e81a6c93261dd to your computer and use it in GitHub Desktop.
Save theanurin/06aa658269491a76d99e81a6c93261dd to your computer and use it in GitHub Desktop.

Obtain list of desired streams

ffprobe -hide_banner -i input-file.mkv
...
  Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default)
    Metadata:
      title           : Criminal (WEB-DL 1080p)
...
  Stream #0:21(ukr): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      title           : 1+1
...
  Stream #0:23(eng): Audio: aac (LC), 96000 Hz, stereo, fltp
    Metadata:
      title           : Original Eng
...
  Stream #0:29(eng): Subtitle: subrip
    Metadata:
      title           : English

Copy ONLY desired streams

Lets said:

ffmpeg -i input-file.mkv -map 0:0 -map 0:21 -map 0:23 -map 0:29 -c copy output-file.mkv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment