Pastebin
Paste #172:
< previous paste - next paste>
Pasted by LARS
#!/bin/bash
if [ $# -ne 2 ]
then
echo "Wrong parameter count."
exit 2
fi
WWW_ROOT="/data/www/virtual/framegrabber.mobilenation.dk/htdocs"
WWW_SYSTEM="/data/www/virtual/framegrabber.mobilenation.dk/system"
CURRENT_DATE=`date +%Y-%m-%d_%H.%M.%S`
URL_HASH=$1
TARGET_FOLDER=$WWW_ROOT/frames/$CURRENT_DATE.$URL_HASH
#TEMP_FOLDER=$WWW_SYSTEM/tmp/$CURRENT_DATE.$URL_HASH
TEMP_FOLDER=$TARGET_FOLDER
case "$2" in
http*)
URL=$2
#echo ------------------------------------------------------------------------
#echo WWW_ROOT: $WWW_ROOT
#echo WWW_SYSTEM: $WWW_SYSTEM
#echo TARGET_FOLDER: $TARGET_FOLDER
#echo TEMP_FOLDER $TEMP_FOLDER
#echo ------------------------------------------------------------------------
#echo Creating folders...
mkdir -p $TEMP_FOLDER
mkdir -p $TARGET_FOLDER
#echo Folders created!
#echo Changing working directory to $TEMP_FOLDER
cd $TEMP_FOLDER
#echo Downloading movie from $URL...
wget -nv $URL
#echo Movie downloaded!
#echo Changing working directory to $TARGET_FOLDER
#cd $TARGET_FOLDER
#echo Current working dir is:
#pwd
#echo Grabbing frames...
#/usr/bin/ffmpeg -i *.3gp -f image -img gif -t 5.0 $TARGET_FOLDER/frame.%04d.gif
#/usr/bin/ffmpeg -r 0.50 -s 480x360 frame_%04d.jpg -i
#/usr/bin/ffmpeg -r 0.50 -s 240x180 $TARGET_FOLDER/frame_%04d.jpg -i *.3gp
#/usr/bin/ffmpeg -r 0.25 -s 240x180 $TARGET_FOLDER/frame_%04d.jpg -i *.3gp
# August, 22-2006 Lars har lavet denne linie for at fa mere filunderstottelse paa, samt at faa flere billeder paa.
#/usr/bin/ffmpeg -r 0.50 -s 240x180 $TARGET_FOLDER/frame_%04d.jpg -i *.*
#/usr/bin/ffmpeg -r 0.50 -s 180x160 $TARGET_FOLDER/frame_%04d.jpg -i *.*
/usr/bin/ffmpeg -r 0.50 -s 176x144 $TARGET_FOLDER/frame_%04d.jpg -i *.*
# CREATE A FLV FILE
# /usr/bin/ffmpeg -s 176x144 -i *.3gp $TARGET_FOLDER/flv.flv
# /usr/bin/ffmpeg -i *.3gp $TARGET_FOLDER/flv.flv
/usr/bin/ffmpeg -i *.3gp $TARGET_FOLDER/flv.flv
#echo Frames grabbed to $TARGET_FOLDER
echo http://framegrabber.mobilenation.dk:2080/frames/$CURRENT_DATE.$URL_HASH
echo $TARGET_FOLDER
;;
*)
echo "Usage: $0 <GUID> <url>"
exit 1
esac
exit 0
New Paste
Go to most recent paste.