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
Related videos on Youtube
![Kaobear](https://i.stack.imgur.com/6synb.jpg?s=256&g=1)
Comments
-
Kaobear almost 2 years
Running Ubuntu 13.10 with a fully compiled
ffmpeg
. I know the code for the actual conversion isffmpeg -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 over 10 yearsyou can avoid
cat
usingwhile ..do..done < list-of-files.txt