TubeSum ← Transcribe a video

How To Batch Convert mkv files to mp4 using FFmpeg - Step by Step Tutorial

Transcribed Jun 14, 2026 Watch on YouTube ↗
Beginner 2 min read For: Users who need to convert MKV files to MP4 using FFmpeg, likely with basic command line experience.
26.5K
Views
592
Likes
61
Comments
12
Dislikes
2.5%
📈 Moderate

AI Summary

This tutorial demonstrates how to batch convert MKV files to MP4 using FFmpeg without re-encoding, preserving quality. It covers navigating to the folder in command prompt, using a for loop to process multiple files, and cleaning up filenames.

[00:00]
Introduction and Prerequisites

The video covers batch converting MKV to MP4 with same quality using FFmpeg. Ensure FFmpeg is installed.

[00:20]
Navigating to the Folder

Open command prompt (cmd), use 'cd desktop' then 'cd mkv' to reach the folder containing MKV files.

[01:06]
Single File Conversion Command

Command: ffmpeg -i file.mkv -c copy file.mp4. This copies streams without re-encoding.

[01:43]
Batch Conversion with For Loop

Use 'for -r %f in (*.mkv) do ffmpeg -i %f -c copy %~nf.mp4' to convert all MKV files recursively.

[02:45]
Cleaning Up Filenames

Use '%~nf' to remove the .mkv extension, resulting in clean .mp4 filenames.

[03:01]
Execution and Results

Press Enter to run the loop. MKV files are copied to MP4; originals remain. Conversion is fast for files around 100-400 MB.

Batch converting MKV to MP4 with FFmpeg is straightforward using a for loop and the -c copy flag to avoid re-encoding. The process preserves quality and is efficient for multiple files.

Clickbait Check

95% Legit

"Title accurately describes the tutorial; it delivers exactly what it promises."

Mentioned in this Video

Tutorial Checklist

1 00:20 Open command prompt (cmd) via Windows search.
2 00:41 Navigate to the folder with MKV files using 'cd desktop' and 'cd mkv'.
3 01:43 Run the for loop: for -r %f in (*.mkv) do ffmpeg -i %f -c copy %~nf.mp4
4 03:01 Press Enter to execute. MKV files are converted to MP4 without re-encoding.

Study Flashcards (5)

What command converts a single MKV file to MP4 without re-encoding?

easy Click to reveal answer

ffmpeg -i file.mkv -c copy file.mp4

01:06

What flag in FFmpeg copies streams without re-encoding?

easy Click to reveal answer

-c copy

01:16

How do you batch convert all MKV files in a folder using a for loop?

medium Click to reveal answer

for -r %f in (*.mkv) do ffmpeg -i %f -c copy %~nf.mp4

01:43

What does the '%~nf' syntax do in the for loop?

medium Click to reveal answer

It removes the .mkv extension from the filename, resulting in a clean .mp4 filename.

02:45

What does the '-r' flag do in the for loop?

hard Click to reveal answer

It makes the loop recursive, processing files in subfolders as well.

01:45

💡 Key Takeaways

🔧

Single File Conversion Command

Core technique for lossless container switching.

01:06
🔧

Batch Conversion with For Loop

Efficient method to process multiple files automatically.

01:43
🔧

Filename Cleanup with %~nf

Prevents messy filenames like .mkv.mp4.

02:45

✂️ Creator Tools: Viral Hooks

AI-generated clip ideas for Shorts based on the transcript

Batch Convert MKV to MP4 with FFmpeg

45s

Shows a quick, practical solution for a common video file conversion problem.

▶ Play Clip

FFmpeg For Loop for Batch Conversion

60s

Reveals a time-saving command-line trick that many users don't know.

▶ Play Clip

Clean Filenames with Tilde N

60s

Teaches a neat trick to avoid messy filenames like 'file.mkv.mp4'.

▶ Play Clip

FFmpeg Batch Conversion Demo

60s

Visually demonstrates the conversion process, satisfying curiosity about speed and results.

▶ Play Clip

[00:00] welcome to the learning zone today we're

[00:01] gonna be batch converting mkv files to

[00:03] mp4 files with the same exact quality

[00:06] and it will not take that long but make

[00:08] sure you have ffmpeg installed on your

[00:10] computer if you don't have it already

[00:12] installed on your computer i have a

[00:13] tutorial on how to do that you can click

[00:15] the link right above but first what

[00:17] we're going to do is navigate to your

[00:20] command prompt so you can do that by

[00:21] going into the windows search bar at the

[00:23] bottom typing in cmd and the command

[00:26] prompt will show up and you can click on

[00:28] that so now that we have our command

[00:31] prompt open what we are going to do is

[00:33] navigate to the directory that has all

[00:35] of our mkv files so i have a folder on

[00:38] my desktop called mkv and so we're going

[00:41] to go there by typing in cd desktop

[00:44] and what that cd does is tells it what

[00:47] directory to go to so cd desktop and it

[00:49] goes to the desktop and now we need to

[00:51] go to our mkv folder see the mkv and now

[00:54] we are in the mkv folder on our desktop

[00:56] if you need to go back you do cd dot dot

[00:58] and it'll go back a directory so cd mkb

[01:02] so now we are where all of our files are

[01:04] at and what we can do if we just want to

[01:06] convert one is do ffmpeg

[01:08] dash i

[01:10] and then the file name file dot mkv make

[01:13] sure to have the mkv in it

[01:15] dash c

[01:16] copy so basically this is just moving it

[01:19] from the mkv container to the mp4

[01:22] container it's not re-encoding or doing

[01:23] anything like that we're just moving

[01:25] containers and it will be basically the

[01:27] same file size basically the same file

[01:29] but in dot mp4

[01:31] and then file.mp4 you can name it

[01:33] whatever you want just make sure you

[01:34] have the dot mp4 and then that is just

[01:37] for one however we want to batch convert

[01:39] we want to do a whole series of them

[01:41] but what we want to do is a for loop so

[01:43] we're going to do four

[01:45] dash r and this will look recursively in

[01:48] all of the subfolders so if you have a

[01:49] bunch of folders within these folders um

[01:52] it will also convert all of those

[01:54] and then for the files

[01:57] in

[01:58] with the name

[01:59] dot mkv

[02:02] dot

[02:04] mkv

[02:05] and we're going to tell it what to do so

[02:07] for all the files that are mkv files do

[02:10] ffmpeg pretty much what we did before

[02:14] dash i

[02:15] and then this is going to be the file

[02:17] name percent f

[02:18] so the file

[02:20] dash c

[02:22] copy which is what we did before

[02:25] and then what we want to do

[02:26] is the new file dot mp4 so we can do

[02:30] percent f dot mp4

[02:33] just like that however we also want to

[02:35] clean it up a little bit by getting rid

[02:37] of the dot mkv at the end so

[02:39] if we just did it like this it'll be

[02:41] mkv.mp4 which is a little messy looking

[02:43] so we're going to do

[02:45] tilde n

[02:46] to get rid of that mkv at the end so

[02:49] it'll now just say mp4 now if you're

[02:52] doing this within a batch already you

[02:54] can do percent percent f and then for

[02:57] everything instead of percent f and

[02:58] it'll do the same exact thing

[03:01] but this should get you what you need so

[03:03] now we're going to hit enter and it'll

[03:05] go through and convert all of our mkv's

[03:08] to mp4s it will leave all the mkvs don't

[03:10] worry it's just copying them over you

[03:12] can delete them later if you'd like and

[03:13] just like that i think that was about

[03:14] seven or so files that we converted from

[03:16] mkv to mp4 they were all somewhere

[03:18] around 100 to 400 megabytes big

[03:21] so if you have larger files it'll

[03:22] probably take a little bit longer so

[03:24] thank you for james mac white on github

[03:26] for sort of this example i kind of went

[03:28] through that if you also need that for

[03:29] mac i will leave that in the description

[03:31] that's slightly different and if you

[03:33] have any issues for example if you have

[03:34] like a different audio type free mkv

[03:36] file that mp4 doesn't support you may

[03:37] have to convert it over but if you click

[03:39] the link in the description it kind of

[03:41] goes over all of those different

[03:42] solutions so make sure to check that out

[03:44] if you have any problems and if you have

[03:45] any other problems in general you can

[03:47] let me know in the comments and i'll try

[03:48] my best to help thank you so much for

[03:50] watching make sure to leave a like and

[03:51] subscribe for more videos like these in

[03:53] the future if you have any suggestions

[03:54] for future videos let me know as well

[03:56] thank you for watching i'll see you next

[03:58] time this is the learning zone

⚡ Saved you time reading this? Transcribe any YouTube video for free — no signup needed.