hi!
i need help with a script resizing all kind of movies (avi or mpg)
full automatically to 700MB
my script i have right now only works with avi files
THX for help
SchwipSchwap
--------------------------------------------------------------------------------------
my script:
#!/bin/bash
#*********************************************************************
#* WHAT YOU NEED: *
#* *
#* transcode tcprobe *
#* mplayer --> mencoder *
#* mp3lame / divx *
#* bc / perl / grep ... *
#* *
#*********************************************************************
#---------------------------------------------------------------------
#GET FILM LENGTH
#---------------------------------------------------------------------
tcprobe -i "$*" > movieinfo.tmp
FRAMES=`grep '\[avilib\] V:' movieinfo.tmp | \
perl -e ' $line=<STDIN> ; $line =~ /frames=(\d+)/ ; print $1' `
MIN_TOTAL=`echo "scale=0 ; ($FRAMES / 1440)"| bc -l`
#echo $MIN_TOTAL
rm movieinfo.tmp -f
#---------------------------------------------------------------------
# GET MAX VIDEO BITRATE
#---------------------------------------------------------------------
MAXSIZE=700000
SEGUNDOS=$(($MIN_TOTAL*60))
MINUTOS=$MIN_TOTAL
#Audio rate is 128bits/s which is 16kbytes/s
AUDIOSIZE=$((16*$SEGUNDOS))
LIBRE=$(($MAXSIZE - $AUDIOSIZE))
RATE=$((($LIBRE*8) / $SEGUNDOS))
echo $RATE
#---------------------------------------------------------------------
# ENCODE MOVIE
#---------------------------------------------------------------------
#mencoder "$*" -ovc lavc \
# -lavcopts vcodec=mpeg4:vhq:vbitrate=$RATE \
# -vop scale -zoom -xy 640 -oac mp3lame \
# -lameopts abr:br=128 -o "$*".resize.avi