Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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
share|improve this answer

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

sudo apt-get install winff
share|improve this answer
I have installed WinFF but it does not like my system for some reason – The Werewolf of London town Jun 14 '14 at 21:52

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.

share|improve this answer

Another one through find command,

find /path -name '*.mkv' -exec bash -c 'avconv -i "$1" -codec copy "${1%.mkv}.mp4"' _ {} \;
share|improve this answer
Great, thank you! – Francesco Apr 22 '15 at 7:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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