I have a bunch of *.flv videos in a folder on my Windows computer that I would like to convert (or remux) to *.mkv. Since I have a lot of files I would like to automate this process with a batch script using mkvmerge.

To find the proper syntax I used the command line display in MKVmergeGUI and I got the following:

"D:/OneDrive/Portable applications/mkvtoolnix\mkvmerge.exe" ^"--ui-language^" ^"en^" ^"--output^" ^"C:/Users/User1/Desktop/test/Episode 01.mkv^" ^"--language^" ^"0:und^" ^"--default-track^" ^"0:yes^" ^"--language^" ^"1:und^" ^"--default-track^" ^"1:yes^" ^"--language^" ^"2:nor^" ^"--track-name^" ^"2:Norwegian subtitles^" ^"--default-track^" ^"2:yes^" ( ^"C:/Users/User1/Desktop/test/Episode 01.flv^" ) ^"--track-order^" ^"0:0,0:1,0:2^"

However these commands are not relative. I want all flv's in a folder to convert to mkv. I simply need a batch file that can remux from flv to mkv. How can I achieve this using only a batch file and mkvmerge?


I worked out an adequate solution using the following command in a batch file:

for %%A IN (*.flv) do ( mkvmerge.exe -o "remux-%%~nA.mkv" "%%~A")

This will convert the flv to mkv and name the output remux-filename

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.