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.
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityIf 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
for i in *.avi; do ffmpeg -i "$i" -codec copy "`echo $i | sed 's/.avi$/.mp4/'`"; done