How to Batch Convert MKV to MP4 Quickly Using FFmpeg on WindowsHow to Batch Convert MKV to MP4 Quickly Using FFmpeg on Windows

about 15 hours ago
How to Batch Convert MKV to MP4 Quickly Using FFmpeg on Windows

If you deal with video files frequently, you know the struggle of having a folder full of .mkv files that won't play correctly in certain media players or video editing software (like Adobe Premiere Pro). While there are hundreds of bulky "video converter" apps online, they are often slow, packed with ads, or put watermarks on your videos.

The absolute best and fastest way to convert video files is by using FFmpeg combined with a simple Windows Batch script. Because we are only swapping the container (from MKV to MP4) and copying the video track without re-encoding, this method takes seconds rather than hours, and there is absolutely zero quality loss.

Here is how you can set up a script to batch convert a whole folder of MKV files instantly.

Step 1: Install FFmpeg

If you don't already have FFmpeg installed:

  1. Download it from the official FFmpeg website or install it via winget:
    cmd
    winget install ffmpeg
  2. Make sure it is added to your Windows PATH environment variable so you can run it from any folder.

Step 2: Create the Batch Script

  1. Open up Notepad.
  2. Paste the following code into the editor:
bat
@echo off for %%f in (*.mkv) do ( echo Converting "%%~nf.mkv" to "%%~nf.mp4" ffmpeg -i "%%~nf.mkv" -c:v copy -c:a aac -strict experimental "%%~nf.mp4" ) echo All files converted! pause
  1. Save the file and name it something like mkv_to_mp4.bat. Make sure you change the "Save as type" from "Text Documents (*.txt)" to "All Files" so it saves with the .bat extension.

How the Script Works

Let's break down why this script is so powerful:

  • for %%f in (*.mkv) do (...): This loop looks for every single .mkv file in the folder where you run the script.
  • -c:v copy: This is the magic command. It tells FFmpeg to copy the video stream directly without re-encoding it. This is why the conversion happens instantly and without quality degradation.
  • -c:a aac: It converts the audio to standard AAC format, ensuring perfect compatibility with MP4 players and editing tools.

Step 3: Run the Script

  1. Place your newly created mkv_to_mp4.bat script into the folder containing your MKV videos.
  2. Double-click the .bat file.
  3. A command prompt window will open, and you will see FFmpeg instantly converting every file in the folder!

Conclusion

Automating simple, repetitive tasks like video conversion can save you hours of waiting time. By leveraging the power of FFmpeg and a simple Windows Batch script, you get the fastest, highest-quality MKV to MP4 conversion process possible.

Tech Stack: Windows Batch, FFmpeg, Command Line

Command Palette

Search for a command to run...