/ Published in: Bash

URL: http://affix.me
convert a directory of AVI files into mpegs
Expand |
Embed | Plain Text
#!/bin/bash # # run FFMPeg to convert a directory of AVI into mpeg # if [ -d ${args[0]} ]; then echo "Directory to be Converted : ${args[0]}" else echo "Directory ${args[0]} does not exist" exit; fi if [ -d ${args[0]}/out ]; then echo "Output Directory : ${args[0]}/out" else echo "Creating output directory!" mkdir ${args[0]}/out echo "Output Directory : ${args[0]}/out" fi for f in ${args[0]}/* do if [ -d $f ]; then echo "Will not recurse into directory" else if [ "$f" == "*.avi" ]; then echo "Processing $f file..." ffmpeg -i $f -target pal-dvd -ps 2000000000 -aspect 16:9 ${args[0]}/out/$f.mpeg > /dev/null 2>&1 else echo "$f is of invalid type!" fi fi done
You need to login to post a comment.