# # $1 = input AVI file # $2 = output AVI file # it is assumed 30fps and 640x480 (ie. Canon camera output) # #get clip digitization time TIME=$(midentify $1 | grep CLIP_INFO | grep VALUE$(midentify $1 | grep CLIP_INFO | grep Digitization | cut -c 18-18) | cut -d "=" -f 2 | sed -e 's:\\::g' | sed -e 's: :_:g') rm -f max-video.mp4 tmp.fifo.yuv audiodump.wav audiodump.aac mplayer -ao pcm -vc null -vo null $1 # for AAC conversion faac --mpeg-vers 4 audiodump.wav # for MP3 conversion #lame audiodump.wav #on with the show mkfifo tmp.fifo.yuv #no rotation #mencoder -vf format=i420 -nosound -ovc raw -of rawvideo -ofps 30 -o tmp.fifo.yuv $1 2>&1 >/dev/null & #x264 -o max-video.mp4 --fps 30 --crf 26 --progress tmp.fifo.yuv 640x480 #rotate clockwise mencoder -vf format=i420 -vf rotate=1 -nosound -ovc raw -of rawvideo -ofps 30 -o tmp.fifo.yuv $1 2>&1 >/dev/null & x264 -o max-video.mp4 --fps 30 --crf 26 --progress tmp.fifo.yuv 480x640 #mencoder max-video.mp4 -ovc copy -info comment="Creation date:$TIME" -aoc copy -o max-video.avi #mencoder $1 -nosound -info comment="Creation date:$TIME" -ovc x264 -o max-video.mp4 -of rawvideo -ofps 30 -x264encopts crf=22:frameref=5:bframes=3:b_adapt:b_pyramid:weight_b:8x8dct:me=umh:subq=7:chroma_me:mixed_refs:trellis=2:brdo:bime:nofast_pskip:direct_pred=auto MP4Box -add max-video.mp4 -add audiodump.aac -fps 30 $2-$TIME.avi echo "TIME:$TIME" rm -f max-video.mp4 tmp.fifo.yuv audiodump.wav audiodump.aac