Skip to content

Instantly share code, notes, and snippets.

@juniovitorino
Created March 10, 2010 22:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save juniovitorino/328482 to your computer and use it in GitHub Desktop.
Save juniovitorino/328482 to your computer and use it in GitHub Desktop.
#!/bin/bash
OUTPUT_PATH='~/app/webroot/files/depoimentos/flv'
MOVIES_PATH='~/app/webroot/files/depoimentos/videos'
ORIGINAL_PATH='~/app/webroot/files/depoimentos/videos_originais'
cd $MOVIES_PATH
for filename in *.*
do
if [ -e $filename ]; then
file="${filename%.*}"
/usr/local/bin/ffmpeg -i $filename -ar 22050 -qscale .1 -s 320x240 $OUTPUT_PATH/$file.flv
mv $filename $ORIGINAL_PATH
echo "${filename} converted on $(date) to $file.flv" >> ~/app/tmp/logs/converted_log
fi
done
echo "Last execution on $(date)" >> ~/app/tmp/logs/scheduled_log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment