FFmpeg is an open-source software project that has a suite of libraries and programs for handling videos, audio, and other multimedia files. It can help you convert a video to another video format or extract audio from a video by entering specific commands. In this post, we will introduce to you how to convert MKV to MP4 with FFmpeg.
How to Convert MKV to MP4 via FFmpeg
Here are 4 steps to make FFmpeg to convert MKV to MP4. Follow the below detailed guidance and you can master how to convert MKV to MP4 via FFmpeg.
Step 1. Download and install FFmpeg
You need to go to the official FFmpeg website to download its installation package and install it on your computer. For detailed steps to install FFmpeg, you can read this post: How to Download and Install FFmpeg on Windows/Mac/Linux
Step 2. Open the Command Prompt Window
Here are two options to open FFmpeg.
- Option 1. Press Win + R to open the Run window, type CMD into the box, and click OK to open the Command Prompt.
- Option 2. In the Search box of Windows, enter CMD, and press Enter.
Step 3. Specify the Directory for the Target MKV File
Next, what you need to do is specify the directory for the MKV file that you intend to convert. Type into the “cd” command, press the Space key to leave a space, and then copy and paste the directory name. Next, press Enter.
![specify the directory for the target MKV file](https://images.minitool.com/videoconvert.minitool.com/images/uploads/2024/08/ffmpeg-mkv-to-mp4-1.jpg)
Step 4. Start FFmpeg MKV to MP4 Conversion
After finishing the above preparations, let’s learn how to start converting MKV to MP4 using FFmpeg. Type into the below command:
ffmpeg -i filename.mkv filename.mp4
You should replace the first filename in the command with the true name of your MKV file. Also, you can change the second filename with the name you want to give to the converted MP4 file.
![enter the conversion command](https://images.minitool.com/videoconvert.minitool.com/images/uploads/2024/08/ffmpeg-mkv-to-mp4-2.jpg)
Then press Enter to initiate the conversion process. The conversion will be completed in a few seconds. Once the conversion is successful, you can get the scene shown in the following screenshot. If you fail to convert MKV to MP4, you need to go back and check your command.
![the page of successful conversion](https://images.minitool.com/videoconvert.minitool.com/images/uploads/2024/08/ffmpeg-mkv-to-mp4-3.jpg)
How to Batch FFmpeg MKV to MP4 Conversion
Furthermore, FFmpeg also supports batch video conversion. After repeating the above Step 1 and Step 2 to install and launch the Command Prompt window, you can follow the below steps to batch FFmpeg MKV to MP4 conversion.
Step 1. Enter the “cd” command, press the Space key to leave a space, and copy and paste the directory name of the folder that contains MKV files. Press Enter to process to the next step.
![copy the directory name of the MKV folder](https://images.minitool.com/videoconvert.minitool.com/images/uploads/2024/08/ffmpeg-mkv-to-mp4-4.jpg)
Step 2. Then you need to type into the below command:
for /R %f IN (*.mkv) DO ffmpeg -i “%f” -c copy “%~nf.mp4”
Next, press Enter to start the conversion process.
![enter the command for batch conversion](https://images.minitool.com/videoconvert.minitool.com/images/uploads/2024/08/ffmpeg-mkv-to-mp4-5.jpg)
Step 3. You will get the result as shown in the below screenshot. And you can go to the MKV folder to find the converted MP4 files.
![the window of successful batch conversion](https://images.minitool.com/videoconvert.minitool.com/images/uploads/2024/08/ffmpeg-mkv-to-mp4-6.jpg)
An Easy Way to Convert MKV to MP4 or Vice Versa
MiniTool Video Converter is an easy-to-use video converter that is suitable for beginners. It supports converting various video formats, such as MP4, MKV, M4V, MOV, 3GP, WebM, etc. Moreover, it allows you to adjust the output format parameters, including the codec, resolution, frame rate, as well as the bit rate of the video, and the codec, channel, sample rate, and the bit rate of the audio.
![interface of MiniTool Video Converter](https://images.minitool.com/videoconvert.minitool.com/images/uploads/2024/08/ffmpeg-mkv-to-mp4-7.jpg)
Besides, MiniTool Video Converter, as a file converter, supports converting audio to audio, audio to video, and vice versa. You can also use its batch file conversion feature to save conversion time.
MiniTool MovieMakerClick to Download100%Clean & Safe
Conclusion
How to use FFmpeg for MKV to MP4 conversion? This post has offered a detailed tutorial. Hopefully, this post will be helpful to you.