At moment I use the single video command of:

avconv -i File_name1.mkv -codec copy File_name1.mp4

To change format but I need a method to do this for over 400 videos what would the batch command be?

  • 4
    You should be able to use something like for i in *.mkv; avconv -i $i -codec copy "$i.mp4"; done but I can't test it right now. – Seth Jun 14 '14 at 20:48
for f in *.mkv; do avconv -i "$f" -codec copy "${f%.mkv}.mp4"; done

You can use mencoder. Install with:

sudo apt install mencoder


for f in *.mkv; do mencoder "$f" -o "$f".mp4 -ovc lavc -oac lavc;done

The default output formats without any options are MPEG-4 for video and MP2 for audio.
Refer to man mencoder for more help.


Try winFF which is the gui for FFmgeg to batch convert audit & video files either from software center or;

sudo apt-get install winff

Another one through find command,

find /path -name '*.mkv' -exec bash -c 'avconv -i "$1" -codec copy "${1%.mkv}.mp4"' _ {} \;

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.