Convert MKV to MP4 Using Avidemux Command Line?

I have several x264 MKV videos that I need to convert to MP4 format without re-encoding. With Avidemux GUI, I can easily achieve this by copying the video and audio streams from the MKV file and then changing the container to MP4. Now, I want to automate this process for all the files in a specific folder using Avidemux’s command line interface (CLI).

You can use to create a batch (.bat) file to convert MKV to MP4 using Avidemux command line. Here is some example code:

set avidemux="path\to\avidemux_cli"
set videocodec=Copy
set audiocodec=Copy
set outfmt=MP4
for %%f in (*.mkv) do %avidemux% --load "%%f" -video-codec %videocodec% --audio-codec %audiocodec% --output-format %outfmt% --save "done/%%f.mp4" --quit
  • Place this code in a text file and save it with a .bat extension (e.g. convert_mkv_to_mp4.bat).
  • Make sure to create a folder named “done” to save the converted files before running the script.
  • Double click the batch file to execute it. It will convert all MKV files in the same directory to MP4 format using Avidemux command line interface.

For More info visit avidemux official doc