How do I convert MKV files to MP4 for free?
A problem people often face is converting videos from
mp4 container/file formats for free and easily. It is actually effortless to convert mkv to mp4 using open-source software so that you don’t have to pay a dime! In this post, we will understand how to convert
mp4 format using –
- VLC player
So, let’s get going with a quick introduction to the MKV file format.
What is the MKV File Format?
Matroska Multimedia Container is a file format that can hold unlimited video, audio, picture, or subtitle tracks in one file [from Wikipedia]. The file format is completely open sourced, and it is similar to MP4 and other media containers.
The different file extensions associated with Matroska are –
mkv file format is open to all; you might encounter systems that do not play or support the
mkv extension or container format. In this situations, it is necessary to convert
mkv to another system-compatible file format, such as the
mp4 file format.
Let’s learn how to make this conversion in the next couple of sections.
Convert MKV to MP4 using VLC Player
The VLC media player is a free, open-source, cross-platform media player and streaming media server developed by the VideoLAN project. It is a great playback software for Windows, Mac, and Linux. Apart from just playing media (audio + video), it can also give you detailed information about the video, its codec, metadata, take screenshots, and even convert videos from one format to another.
In this section, let’s learn how to use VLC Player to convert
mkv files to
After installing VLC on your operating system, open it and click on the “Media” tab.
Choose “Convert / Save”.
Click on the “+Add” button and choose your input
mkv file. After adding that file using the Add option, click on the “Convert/Save” button at the bottom of the screen, which should have gotten enabled now.
Now, choose the “Convert” option and pick the “Video – H.264 + MP3 (MP4)” option as the output profile. Then, decide the destination file name and location and hit “Start”.
After a few seconds or minutes (depending on the size of your
mkv video, you’ll have the converted
mp4 file at the location you specified.
When you use VLC player to convert mkv to mp4, it takes a lot of time because VLC player basically re-encodes the video and then wraps it into an mp4 container. If your file is very long, it could take a lot of time to complete the conversion.
This is a straightforward way of converting
mp4 that does not require the use of the command line. However, some people prefer the command line as they might want to run this entire process on a headless server or embed the conversion process in a shell script.
The best option in those situations is to use FFmpeg which we will explore next.
Convert MKV to MP4 using FFmpeg
FFmpeg is the #1 open-source video processing and video compression library in the world and you can take my word for it. It can do a ton of different things, is very stable, and is used heavily in commercial video applications as well.
If you haven’t installed FFmpeg on your system, it is very easy to do so. Follow our instructions for installing FFmpeg on Windows, Linux, and MacOS and come back here.
With FFmpeg installed, here is the commandline to convert
ffmpeg -i inputVideoName.mkv -c:v copy -c:a copy outputVideoName.mp4
That’s it. One line in FFmpeg and you can convert
mkv files to
mp4 files. Here is what the different parameters mean –
-i inputVideoName.mkv: this is name of your input file in
-c:v copy -c:a copy: this tells FFmpeg to simple copy the video and audio from one video container to another and in this case, it is from the mkv container to the mp4 container.
outputVideoname.mp4: this is the name of the destination
Because you are telling FFmpeg to directly copy the audio and video from one container format to another, there is no re-encoding involved and this copy-operation is extremely fast.
If you are not comfortable using the commandline, then I urge you to try the next option, i.e., using Handbrake to convert mkv to mp4. Let’s take a look at that next.
Convert MKV to MP4 using Handbrake
If you prefer a GUI-based approach instead of the terminal and command lines, then Handbrake is a great option for video format conversion and video conversion. Handbrake is a free, open-source tool that users can install on Windows, Mac, Linux. Check out our article on the installation and usage of Handbrake if you are new to it.
After installed Handbrake on your system, open the GUI which looks as follows –
Using the File -> Open Source menu, open the
mkv file. Handbrake will display all the relevant information about the mkv file.
Next, if you want to convert the
mkv file into
mp4 file format, then choose
MPEG-4 (avformat) in the Summary tab.
Then choose a file name in the bottom “Save As” dialog box and press the “Start” button to begin the container conversion process. When you use Handbrake to convert mkv to mp4, it takes a lot of time because it re-encodes the video and then wraps it into an mp4 container. If your file is very long, it could take a lot of time to complete the conversion. However, Handbrake also gives you the option of optimizing the mp4 file for delivery over email, WhatsApp, or other messaging platforms.
That’s it. After the conversion is complete, you should have the mp4 version of the file in the output folder that you specified.
FAQ 1: Does converting MKV to MP4 lose quality?
Well, the best way to put it is that there are both lossy and lossless ways of converting an mkv file to mp4 format. Let’s learn more about this –
- Lossless: You are only transferring the video from the mkv container to an mp4 container without modifying the video in the lossless option. This can be achieved by using FFmpeg and doing a copy operation (also called transmuxing).
- Lossy: However, if you want to change the video quality or the video resolution, the video quality will change because the software you’re using for conversion will need to re-encode the video. This is generally termed lossy conversion and can be achieved using Handbrake, VLC, and FFmpeg.
In this post, we learned 3 simple ways of converting MKV files to MP4 format using either VLC, Handbrake, or FFmpeg. All three techniques work well and it depends on whether you like to use GUI-based tools or the commandline for your work.
Do check them out and give it a shot.
Thank you, take care, and happy Streaming!