How to replace sound track in mkv file (on Ubuntu 11.10)

I have

  • mkv file with web video and ogg audio
  • ogg audio file

I want to replace the audio in the mkv file with the sound from the ogg file. How can I do this on Ubuntu 11.10 with programs available from the default repositories?

The resulting file may also have a different format (e.g. avi), but I would prefer mkv. Btw. Does ffmpeg have an mkv muxer? My test with the -f mkv option resulted in an error. The requested output format "mkv" is not a suitable output format

+8
ubuntu ffmpeg ogg mkv webm
source share
1 answer

The Matroska (mkv) file format is specified with the -f matroska option. It must be supported by ffmpeg (version 0.7.3) in Ubuntu 11.10. Use ffmpeg -formats for a list of supported file formats.

To combine specific streams (audio or video) from multiple files, use the -i option for each input and -map input_index[:stream_index] . For example, the following command combines the first stream of the first input with the second input and saves the codecs:

 ffmpeg -i input.mkv -i input_audio.ogg -map 0:0 -map 1 \ -vcodec copy -acodec copy output.mkv 
+24
source share

All Articles