Using ffmpeg to convert DTS audio track to AC3 and add back into MKV?

My home audio system only supports Dolby (AC3) and not DTS. So if I want 5.1 surround sound, I have been using ffmpeg like so:

ffmpeg -i my_movie.mkv -map 0 -vcodec copy -scodec copy -acodec ac3 -b:a 640k my_movie_ac2.mkv

This creates a separate file with the AC3 track instead of DTS. How do I instead just add the AC3 stream back into the MKV as an additional audio track? I'd like to keep the DTS track, but not have two, separate MKV files.


Use

ffmpeg -i my_movie.mkv -map 0:v -map 0:a:0 -map 0:a -map 0:s -c:v copy -c:a copy -c:s copy -c:a:0 ac3 -b:a:0 640k my_movie_ac2.mkv

See Making ffmpeg process first audio stream differently than all others for a guide to how stream specifiers are applied.