How to convert mp4 to mkv?

Solution 1:

Download and install VLC player with one of the options provided here: http://www.videolan.org/vlc/download-ubuntu.html

Then run it by executing this command in Terminal:

vlc

Then once the program is open go "Media > Convert / Save...":

"Media > Convert / Save..." option

And in this interface which comes up click the "Add" button and locate the MP4 file which you wish to convert:

Open Media window

Then select the "Convert / Save" option at the bottom which now becomes enabled (not greyed out). Next select the profile "Video - H.264 + MP3 (MP4)" and then click on the little tool icon next to the pull-down menu and make sure that the option "MKV" is selected and not the default "MP4/MOV" like this:

Profile edition options

Then click the "Save" button at the bottom left. Then select the destination to where you want VLC player to export the file to and press "Start". Ignore any errors telling you about encoding problems. The progress bar which normally shows how far into the program you are will now show the progress of the conversion. When the progress bar has finished, your video will have been converted and ready to play.

Solution 2:

You can use Handbrake.

HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded video transcoder, available for MacOS X, Linux and Windows.Launchpad

To install, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo add-apt-repository ppa:stebbins/handbrake-releases
sudo apt-get update
sudo apt-get install handbrake-gtk

Or you can use Synaptic to install it.

To convert mMP4 to MKV, follow the steps below:

Click on the movie like icon, to choose the MP4 file to be converted.

enter image description here

Click on the file to select it

enter image description here

Make sure the output type is mkv, and then click on the green button to start the conversion.

enter image description here

Solution 3:

It is very simple, I tried and got succeed using the below ffmpeg command

ffmpeg -i input.mp4 -vcodec copy -acodec copy output.mkv

Solution 4:

First, install avconv

sudo apt-get install libav-tools

Next, translate via command line

avconv -i filme.mp4 -c copy filme.mkv

Converting this way produces a file with a similar size. We need do add extra options to define what transformations should be done to reduce space. (See avconv -h)