Skip to content

Instantly share code, notes, and snippets.

@thielemans
Last active June 19, 2022 13:38
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thielemans/73968c4eecee620d9c3dcb4c3442d8ef to your computer and use it in GitHub Desktop.
Save thielemans/73968c4eecee620d9c3dcb4c3442d8ef to your computer and use it in GitHub Desktop.
Add a 5.1 DTS or AC3 audio stream from a 7.1 DTS-HD stream using ffmpeg to allow directplay
#Downconvert 7.1 DTS-HD to DTS 5.1:
ffmpeg -i in.mkv -strict -2 -map 0:a:0 -c dts -af "channelmap=channel_layout=5.1" dts.mkv
#Downconvert 7.1 DTS-HD to AC3 5.1:
ffmpeg -i in.mkv -map 0:a:0 -c ac3 -ac 6 -ab 640k ac3.mkv
#Add downconverted audio streams via ffmpeg:
ffmpeg -i in.mkv -i dts.mkv -i ac3.mkv -map 0:v -c:v copy -map 0:a -c:a copy -map 1:a -c:a copy -map 2:a -c:a copy -map 0:s -c:s copy out.mkv
#Or use MKVToolNix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment