- Press V to toggle the subs on and off
- Press J to cycle languages
- Press # to cycle the audio
mencoder input-a.avi input-b.avi -forceidx -oac copy -ovc copy -o output.avi
Since you can't remove a track, you must extract everything and then rebuild the file without it.
Inspect tracks in original file with mkvtools
$ mkvmerge -i 28DaysLater-original.mkv
File '28DaysLater-original.mkv': container: Matroska
Track ID 1: video (V_MPEG4/ISO/AVC)
Track ID 2: audio (A_AC3)
Track ID 3: audio (A_DTS)
Chapters: 33 entries
compare with mplayer output
$ mplayer -vo null 28DaysLater-original.mkv
...
Playing 28DaysLater-original.mkv.
libavformat file format detected.
[matroska,webm @ 0x98fa020] Estimating duration from bitrate, this may be inaccurate
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (ac3), -aid 0, -alang ger
[lavf] stream 2: audio (dca), -aid 1, -alang eng
VIDEO: [H264] 1280x688 0bpp 23.976 fps 0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
...
Extract chapters
$ mkvextract chapters 28DaysLater-original.mkv > chapters.xml
Extract Audio & Video tracks
$ mkvextract tracks 28DaysLater-original.mkv 1:video.h264 2:gerAudio.ac3 3:engAudio.dts
Extracting track 1 with the CodecID 'V_MPEG4/ISO/AVC' to the file 'video.h264'. Container format: AVC/h.264 elementary stream
Extracting track 2 with the CodecID 'A_AC3' to the file 'gerAudio.ac3'. Container format: Dolby Digital (AC3)
Extracting track 3 with the CodecID 'A_DTS' to the file 'engAudio.dts'. Container format: Digital Theater System (DTS)
Progress: 100%
Join tracks we're keeping back in (use "-A" to omit audio from a given track)
$ mkvmerge -o 28DaysLater-final.mkv -A video.h264 engAudio.dts --chapters chapters.xml
Notes:
- Language is undefined in the output file, might want to specify that if including multiple languages
- No default tracks are specified, might want to do that if multiple audio or video tracks are included