#!/bin/sh # rapid script to get video from camera and convert it into divx5 format # need: # libavc1394_0-testools # dvgrab # transcode # divx5 codec # kernel with i1394 support EXT=mpeg case $1 in mod|m) echo echo " - Loading module" modprobe ohci1394 modprobe raw1394 echo ;; view|v) echo echo "Take screenshot of .avi file" echo for i in `ls *.$EXT` do transcode -a 0 -c 1 -x dv -i $i -I 5 -y jpg -o screenshot-$i convert -verbose -size 320x200 screenshot-${i}000000.jpg screenshot-${i}000000.jpg done ;; thb|t) for i in `ls *.$EXT` # for i in `cat list_thumbs` do echo "thumbnailer of $i" totem-video-thumbnailer $i $i.png convert -verbose -resize 74% $i.png $i.png done ;; grab|g) echo echo "-------------------------------------------------------" echo " Press entrer when ready to get the file !" read echo " Getting video from Sony PC120E !" echo " -----------------------------------" echo dvgrab -i --format dv2 --timestamp --autosplit outfile echo ;; convert|c) echo echo "-------------------------------------------------------" if [ -z $2 ] ; then echo " Second argument should be the name of file to convert !" echo " Exiting !!!!" else echo " - Transcoding to divx5 format..." echo " With TWO pass... may take a while" if [ -e divx*.log ] ; then rm -rf divx*.log ; fi if [ -z "$3" ]; then #### DVD mode ###### transcode -a 0 -x dv -i $2 -w 5000 -b 192,0,5 -f 25 -Q 5,5 --print_status 10 -g 720x576 -q 1 -I 3 -o $2-tcod.avi -u 10,2 -R 1 -y divx5 transcode -a 0 -x dv -i $2 -w 5000 -b 192,0,5 -f 25 -Q 5,5 --print_status 10 -g 720x576 -q 1 -I 3 -o $2-tcod.avi -u 10,2 -R 2 -y divx5 ################### else ####CD mode ##### #### 700MB / 30min, 720x576 --> 640x480 #### # bitrate="2900"; rescale="6,5,16" #### 700MB / 60min, 720x576 --> 448x336 #### bitrate="1400"; rescale="15,17,16" transcode -i $2 -w ${bitrate} -k -z -B ${rescale} -R 1 -J smartdeinter=diffmode=2:highq=1:cubic=1 -y divx5,null -o /dev/null --print_status 10 transcode -i $2 -w ${bitrate} -k -z -B ${rescale} -R 2 -J smartdeinter=diffmode=2:highq=1:cubic=1 -b 128,0,0 -y divx5 -o ${name}.avi --print_status 10 fi echo " - Done for file : $2" echo "++++++++++++++++++" echo " - size of file before:" t=`du $2` echo $t echo " - Size AFTER:" y=`du $2-tcod.avi` echo $y echo "++++++++++++++++++" fi ;; split|s) echo echo " - Splitting file if more than one CD (700MB)" avisplit -i $2 -o $2-cd2.avi -s 700 echo ;; *) echo echo "****************************************************" echo "* Choose the option:" echo "* m|mod : load needed i1394 modules" echo "* g|grab : get file from Camera" echo "* v|view : screenshot of .avi files" echo "* t|thb : video thumbnailer by totem" echo "* c|convert : convert DV file into Divx5 file :-)" echo "* s|split : split file in 700MB part" echo "****************************************************" echo ;; esac