Batch Convert .mp4 to .avi with ffmpeg

7,608

If you have a list of file you can use something like:

cat list-of-files.txt | while read file; do ffmpeg -i $file -codec copy ${file%%.mp4}.avi; done

or simply

cd /path/; ls *.mp4 | while read file; do ffmpeg -i $file -codec copy ${file%%.mp4}.avi; done
Share:
7,608

Related videos on Youtube

Kaobear
Author by

Kaobear

A Programming Poet.

Updated on September 18, 2022

Comments

  • Kaobear
    Kaobear almost 2 years

    Running Ubuntu 13.10 with a fully compiled ffmpeg. I know the code for the actual conversion is ffmpeg -i video.mp4 -codec copy video.avi

    I just need a plain and simple Bash script to do that for, say, forty or fifty of the .mp4 files.

  • Rahul Patil
    Rahul Patil over 10 years
    you can avoid cat using while ..do..done < list-of-files.txt