Feed multiple files into ffmpeg?
I've always done things, like
for i in *.mp3; do mpg321 -w `basename $i .mp3`.wav $i; done
but for ffmpeg how can I encode many videos at once?
for i in *.3gp; do ffmpeg $i -f avi -vcodec libxvid -acodec libmp3lame `date +%H%M%S%N`.avi; done
Does not work, because ffmpeg uses the 2nd match as the output file, and asks me if I want to write over it.
From within a directory full of 3gp files, I ran
find . -iname "*.3gp" -print -exec ~/nastiness/3gp2avi.sh {} \;
, and 3gp2avi.sh contains
#!/bin/bash ffmpeg $1 -f avi -vcodec libxvid -acodec libmp3lame `date +%H%M%S%N`cv.avi
This attempt also does not work. Strangely, even using 3gp2avi.sh by itself on 1 file ffmpeg tries using the filename as the output file filename. If I type the whole ffmpeg command one by one for each 3gp file it works, though.
If anyone can help me do something like "for i in *3gp; do..." with ffmpeg I'd greatly appreciate it. Thanks.
Last edited by Anithen; 08-24-2008 at 04:41 PM.
Reason: clarification
|