Szimpla videókonverter bash script-ben ffmpeg-gel
Létrehozva: 2010. február 3. 12:09
Bash-ban írtam egy egyszerű parancssort ami egy adott mappában található videóállományokból készít egy divx3 (mpeg4) változatot.
fájl tartalma:
#!/bin/bash
# converter.sh
# simple video converter
in=$1
out=$2
echo "selected input directory: $in"
echo "selected output directory: $out"
ls -1 -b "$in"|while read file
do
if [ -f "$in$file" ]; then
ffmpeg -i "$in$file" -f avi -vcodec mpeg4 -b 1800k -vtag DIVX "$out${file%.*}.avi" </dev/null
fi
done
használata:
Természetesen futtathatóvá kell tenni az állományt.sod@sod-desktop:~$ ./converter.sh /input_dir/ /output_dir/
