Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 38 lines (32 sloc) 1.14 KB
#!/bin/bash
. ~/.shell-colors
if [ -z "$1" ]; then
echo -e "\n $red OOPS...\n Usage: dubb-short movie_name\n $reset"
exit
fi
vid="$1"
#printf " \t $yell Add time for conversion (in secs): \n \t [ or hit enter to convert the whole file ] \n \t :- "
#read input
#if [ "$input" = "" ]; then
convtime=""
#else
# convtime="-t $input"
#fi
if [ -f "$1" ]; then
echo -e "\n $cyan *** Converting the movie - one pass ***\n"
name=$(basename $vid | cut -d "." -f1 | tr - _ | tr ' ' _ | tr -s '_')
name=./$name.1.avi
echo -e "\n ***Saving to $name***\n $green"
starting_time=`date +%s`
nice -n 8 ffmpeg $convtime -i "$vid" -y -threads 3 -s 720x576 -aspect 16:9 -f avi -b:v 1100k -async 25 -acodec libmp3lame -b:a 96k -ac 2 -vol 512 $name
end_time=`date +%s`
answer=$(($end_time-$starting_time))
[ "$answer" -ge "60" ] && \
minutes=$(($answer/60)) && seconds=$(($answer-($minutes*60))) && \
printf "\n $cyan $minutes mins $seconds secs overall... \n \n" || \
printf "\n $cyan $answer seconds overall... \n\n"
echo -e "\n $yell ALL DONE NOW !!!\n $reset"
else
echo -e "\n $red Wrong name for movie... \n Try Again $reset \n"
fi
exit 0