Converting videos from mkv to mp4
There are several ways of converting videos from mkv format to mp4 format, and some of them allow you do so without re-encoding the video or audio.
It might be the best choice if you don’t mind its dazzling command line parameters. An example of its usage:
ffmpeg -ss 00:01:15.000 -i input.mkv -vcodec copy -acodec copy -scodec copy -map 0:0 -map 0:2 -map 0:5 -t 01:00.00 output.mp4
The command above asks ffmpeg to do followings:
- convert input.mkv to output.mp4
- trim the video to keep the portion starts from 00:01:15.000 and lasts one hour (by -t 01:00.00)
- only process stream 0:0, 0:2 and 0:5, ignore the other streams (e.g. unwanted audios and subtitles)
- copy selected streams directly into output without re-encoding them
MP4Box is a command line utility of creating MP4 files and it is part of GPAC. There are several tools were built around it like YAMB and my MP4box GUI. MkvToMp4 makes a step further by putting mkv extract tool from MKVToolNix and MP4Box together to make mkv to mp4 converting an one step task.
This is for everything else into mkv or mp4.