[Morphix-cvs] SF.net SVN: morphix: [2544]
trunk/mmaker/utils/auto-testing/ video-qemu-booting-iso.sh
From: <bms...@us...> - 2007-07-29 00:02:10
|
Revision: 2544 http://morphix.svn.sourceforge.net/morphix/?rev=2544&view=rev Author: bmsleight Date: 2007-07-28 17:01:08 -0700 (Sat, 28 Jul 2007) Log Message: ----------- Working progress Modified Paths: -------------- trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh Modified: trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh =================================================================== --- trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh 2007-07-28 07:22:24 UTC (rev 2543) +++ trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh 2007-07-29 00:01:08 UTC (rev 2544) @@ -6,18 +6,40 @@ OLD_DISPLAY="$DISPLAY" TMP_DIR=/tmp/vqbi.$$.tmp IPADDRESS=$(sudo ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}') - -ISO="/home/morph/webconverger/debian-live-sid-i386-gnome-desktop.iso" -SENDKEYS="spc,l,i,v,e,spc,kp_enter" -QEMU_MONITOR_PORT=4444 -GEOMETRY="1280x960" -CONVERT_DIM="800x600" -MCODER_DIM="w=800:h=600" -VIDEO="/tmp/qemu.avi" -TIME_Q="6" VNCREC_MOVIE_FRAMERATE=1 } +get_options_and_defaults () +{ +if [ "$SENDKEYS" = "" ]; then + SENDKEYS="spc,l,i,v,e,spc,kp_enter" +fi +if [ "$QEMU_MONITOR_PORT" = "" ]; then + QEMU_MONITOR_PORT=4444 +fi +if [ "$GEOMETRY" = "" ]; then + GEOMETRY="1280x960" +fi +if [ "$CONVERT_DIM" = "" ]; then + CONVERT_DIM="800x600" +fi +if [ "$MCODER_DIM" = "" ]; then + MCODER_DIM="w=800:h=600" +fi +MCODER_DIM_SCALE=$(echo "$MCODER_DIM" | sed s/x/,/g) +if [ "$TIME_Q" = "" ]; then + TIME_Q="60" +fi +if [ "$LOGO" = "" ]; then + LOGO="/home/morph/webconverger/openlogo-75.png" +fi +if [ "$QEMU_BIN" = "" ]; then + QEMU_BIN="qemu" + #qemu_0.8.4-etch1 +fi +} + + set_up_workspace () { mkdir $TMP_DIR 2>/dev/null @@ -43,11 +65,11 @@ start_vnc_sessions () { -vncserver -nocursor -geometry $GEOMETRY >$TMP_DIR/vncserver.txt 2>&1 +vncserver -nocursor -geometry $GEOMETRY >$TMP_DIR/vncserver.txt 2>&1 VNSERVER_QEMU=$(cat $TMP_DIR/vncserver.txt | grep 'New' | awk '{ print $5}' ) VNCSERVER_QMEU_NUMBER=$(cat $TMP_DIR/vncserver.txt | grep 'New' | cut -d: -f2) echo "Launched vncserver $VNSERVER_QEMU" -vncserver -nocursor -geometry 1600x1200 >$TMP_DIR/vncserver.txt 2>&1 +vncserver -nocursor -geometry 1600x1200 >$TMP_DIR/vncserver.txt 2>&1 VNSERVER_VNCREC=$(cat $TMP_DIR/vncserver.txt | grep 'New' | awk '{ print $5}' ) VNCSERVER_VNCREC_NUMBER=$(cat $TMP_DIR/vncserver.txt | grep 'New' | cut -d: -f2) echo "Launched vncserver $VNSERVER_VNCREC" @@ -55,7 +77,8 @@ start_vnc_record () { -#export DISPLAY="$VNSERVER_VNCREC" +export DISPLAY="$VNSERVER_VNCREC" +#export DISPLAY="$OLD_DISPLAY" rm /tmp/qemu.1.vnc export VNCREC_MOVIE_FRAMERATE echo "Starting vncrec, recording :$VNCSERVER_QMEU_NUMBER. Local display :$VNCSERVER_VNCREC_NUMBER" @@ -66,8 +89,8 @@ { export DISPLAY=$VNSERVER_QEMU echo "Starting qemu, within Dispaly $VNSERVER_QEMU" -qemu_0.8.4-etch1 -no-kqemu -full-screen -cdrom $ISO -monitor telnet:$IPADDRESS:$QEMU_MONITOR_PORT,server,nowait & -sleep 10 +$QEMU_BIN -no-kqemu -full-screen -cdrom $ISO -monitor telnet:$IPADDRESS:$QEMU_MONITOR_PORT,server,nowait & +sleep 3 i=1 REACHED_LAST_KB="" while [ -z $REACHED_LAST_KB ] @@ -81,7 +104,7 @@ fi let i=i+1 done -sleep 3 +sleep 1 } let_qemu_run () @@ -94,7 +117,7 @@ { echo "Stopping vncrec and qemu" killall vncrec -killall qemu_0.8.4-etch1 +killall $QEMU_BIN } stop_vncservers () @@ -107,14 +130,16 @@ export_frames () { +convert $LOGO -resize 200x200 -negate -gravity South -background Black -font Helvetica-Bold -fill white -splice 0x36 -pointsize 25 -draw "text 0,0 'AutoTesting'" -transparent black $TMP_DIR/minilogo.png +convert $TMP_DIR/minilogo.png -fill grey50 -colorize 40 $TMP_DIR/minilogo.png VNCREC_MOVIE_CMD='convert xpm:- '$TMP_DIR'/image-%05d.jpg' export VNCREC_MOVIE_CMD -#vncrec -movie $TMP_DIR/qemu.1.vnc 1>/dev/null 2>&1 vncrec -movie $TMP_DIR/qemu.1.vnc for i in $TMP_DIR/image-*.jpg do convert $i -resize $CONVERT_DIM $i echo "Resized $i" + composite -dissolve 15 -gravity northeast $TMP_DIR/minilogo.png $i $i done echo "Finished making Frames" } @@ -122,7 +147,14 @@ make_video () { -mencoder mf://$TMP_DIR/*.jpg -mf $MCODER_DIM:fps=4:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o $VIDEO +##Following is ideal - does not work +#mkfifo -m 660 $TMP_DIR/stream.yuv +#mplayer -vo yuv4mpeg:file=$TMP_DIR/stream.yuv -ao null -nosound -quiet "mf://$TMP_DIR/*.jpg" -mf fps=4:type=jpg & +#ffmpeg2theora -v 8 $TMP_DIR/stream.yuv -o $VIDEO +#sleep 5 + +mencoder mf://"$TMP_DIR/*.jpg" -mf w=800:h=600:fps=4:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o $TMP_DIR/tmp.avi +ffmpeg2theora -o $VIDEO $TMP_DIR/tmp.avi } clean_up () @@ -132,6 +164,46 @@ #rm $TMP_DIR -r } + +while getopts s:p:g:d:t:l:q: opt +do + case "$opt" in + s) SENDKEYS="$OPTARG";; + p) QEMU_MONITOR_PORT="$OPTARG";; + g) GEOMETRY="$OPTARG";; + d) CONVERT_DIM="$OPTARG";; + t) TIME_Q="$OPTARG";; + l) LOGO="$OPTARG";; + q) QEMU_BIN="$OPTARG";; + + + \?) # unknown flag + echo >&2 \ + "usage: $0 [-s \"keys,to,send,to,qemu\"] [-p port_number for qemu-monitor] [-g geometry of vncsession] [-d dimensions of video] [-t time to run qemu] [-l logo] [-q alternative qemu binary name] IsoToTest.iso Video.ogg " + exit 1;; + esac +done +shift `expr $OPTIND - 1` + +if [ -z "$1" -a -z "$2" ]; then + echo "usage: $0 [-s \"keys,to,send,to,qemu\"] [-p port_number for qemu-monitor] [-g geometry of vncsession] [-d dimensions of video] [-t time to run qemu] [-l logo] IsoToTest.iso Video.ogg " + echo + echo " This script boots a livecd using qemu and records a video of the process. " + echo + echo " It is worth noting that this script takes a long time to run and heavy usage of CPU." + echo " There is heavy usage of the qemu, imagemagik tools. " + echo " For every second of running qemu the script it can take up to 12s to compile the video." + echo " For example using -t 300 will about one hour." + echo + echo " Launches a couple of vncserver session, kills other vncrec and qemu session running." + echo " Requires sudo ifconfig" + exit +fi + +ISO=$1 +VIDEO=$2 + +get_options_and_defaults get_global_variables set_up_workspace start_vnc_sessions This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Morphix-cvs] SF.net SVN: morphix: [2546]
trunk/mmaker/utils/auto-testing/ video-qemu-booting-iso.sh
From: <bms...@us...> - 2007-07-29 14:22:44
|
Revision: 2546 http://morphix.svn.sourceforge.net/morphix/?rev=2546&view=rev Author: bmsleight Date: 2007-07-29 07:22:39 -0700 (Sun, 29 Jul 2007) Log Message: ----------- Missed a few lines Modified Paths: -------------- trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh Modified: trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh =================================================================== --- trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh 2007-07-29 14:18:08 UTC (rev 2545) +++ trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh 2007-07-29 14:22:39 UTC (rev 2546) @@ -27,7 +27,7 @@ exit fi VNCCONF=$(cat /etc/vnc.conf | grep "^\$vncStartup") -if [ "VNCCONF" -neq "\$vncStartup = \"~/.vnc/xstartup\";" ] +if [ "$VNCCONF" != "\$vncStartup = \"~/.vnc/xstartup\";" ] then echo "Requires vnc.conf to have the line:- " echo "\$vncStartup = \"~/.vnc/xstartup\";" @@ -201,6 +201,7 @@ DISPLAY="$OLD_DISPLAY" export DISPLAY="$OLD_DISPLAY" rm $TMP_DIR -r +rm /tmp/video-qemu-booting-iso.lock } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Morphix-cvs] SF.net SVN: morphix: [2548]
trunk/mmaker/utils/auto-testing/ video-qemu-booting-iso.sh
From: <bms...@us...> - 2007-07-30 16:40:06
|
Revision: 2548 http://morphix.svn.sourceforge.net/morphix/?rev=2548&view=rev Author: bmsleight Date: 2007-07-30 09:39:58 -0700 (Mon, 30 Jul 2007) Log Message: ----------- vncserver needs to be forced into the required depth, pixel format and colour map when running from cron rather than ssh with x-forwarding. Modified Paths: -------------- trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh Modified: trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh =================================================================== --- trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh 2007-07-29 21:51:42 UTC (rev 2547) +++ trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh 2007-07-30 16:39:58 UTC (rev 2548) @@ -104,11 +104,11 @@ start_vnc_sessions () { -vncserver -nocursor -geometry $GEOMETRY >$TMP_DIR/vncserver.txt 2>&1 +vncserver -depth 24 -pixelformat rgb888 -cc 4 -nocursor -geometry $GEOMETRY >$TMP_DIR/vncserver.txt 2>&1 VNSERVER_QEMU=$(cat $TMP_DIR/vncserver.txt | grep 'New' | awk '{ print $5}' ) VNCSERVER_QMEU_NUMBER=$(cat $TMP_DIR/vncserver.txt | grep 'New' | cut -d: -f2) echo "Launched vncserver $VNSERVER_QEMU" -vncserver -nocursor -geometry 1600x1200 >$TMP_DIR/vncserver.txt 2>&1 +vncserver -depth 24 -pixelformat rgb888 -cc 4 -nocursor -geometry 1600x1200 >$TMP_DIR/vncserver.txt 2>&1 VNSERVER_VNCREC=$(cat $TMP_DIR/vncserver.txt | grep 'New' | awk '{ print $5}' ) VNCSERVER_VNCREC_NUMBER=$(cat $TMP_DIR/vncserver.txt | grep 'New' | cut -d: -f2) echo "Launched vncserver $VNSERVER_VNCREC" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Morphix-cvs] SF.net SVN: morphix: [2549]
trunk/mmaker/utils/auto-testing/ video-qemu-booting-iso.sh
From: <bms...@us...> - 2007-07-30 16:47:35
|
Revision: 2549 http://morphix.svn.sourceforge.net/morphix/?rev=2549&view=rev Author: bmsleight Date: 2007-07-30 09:47:02 -0700 (Mon, 30 Jul 2007) Log Message: ----------- vncserver needs to be forced into the required depth, pixel format and colour map when running from cron rather than ssh with x-forwarding. Minmin geometry -g 1024x768. Modified Paths: -------------- trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh Modified: trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh =================================================================== --- trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh 2007-07-30 16:39:58 UTC (rev 2548) +++ trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh 2007-07-30 16:47:02 UTC (rev 2549) @@ -235,6 +235,8 @@ echo " For every second of running qemu the script it can take up to 12s to compile the video." echo " For example using -t 300 will about one hour." echo + echo " Minimum geometry for qemu -g 1024x768" + echo echo " Launches a couple of vncserver session, kills other vncrec and qemu sessions running." echo " Requires sudo ifconfig" exit This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Morphix-cvs] SF.net SVN: morphix: [2550]
trunk/mmaker/utils/auto-testing/ video-qemu-booting-iso.sh
From: <bms...@us...> - 2007-07-30 21:40:58
|
Revision: 2550 http://morphix.svn.sourceforge.net/morphix/?rev=2550&view=rev Author: bmsleight Date: 2007-07-30 14:40:54 -0700 (Mon, 30 Jul 2007) Log Message: ----------- Minor update Modified Paths: -------------- trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh Modified: trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh =================================================================== --- trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh 2007-07-30 16:47:02 UTC (rev 2549) +++ trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh 2007-07-30 21:40:54 UTC (rev 2550) @@ -44,7 +44,7 @@ OLD_DISPLAY="$DISPLAY" TODAY=$(date +"%F") TMP_DIR=/tmp/vqbi.$$.tmp -IPADDRESS=$(sudo ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}') +IPADDRESS="127.0.0.1" VNCREC_MOVIE_FRAMERATE=1 } @@ -104,11 +104,11 @@ start_vnc_sessions () { -vncserver -depth 24 -pixelformat rgb888 -cc 4 -nocursor -geometry $GEOMETRY >$TMP_DIR/vncserver.txt 2>&1 +vncserver -depth 24 -pixelformat rgb888 -cc 4 -nocursor -geometry $GEOMETRY >$TMP_DIR/vncserver.txt 2>&1 VNSERVER_QEMU=$(cat $TMP_DIR/vncserver.txt | grep 'New' | awk '{ print $5}' ) VNCSERVER_QMEU_NUMBER=$(cat $TMP_DIR/vncserver.txt | grep 'New' | cut -d: -f2) echo "Launched vncserver $VNSERVER_QEMU" -vncserver -depth 24 -pixelformat rgb888 -cc 4 -nocursor -geometry 1600x1200 >$TMP_DIR/vncserver.txt 2>&1 +vncserver -depth 24 -pixelformat rgb888 -cc 4 -nocursor -geometry 1600x1200 >$TMP_DIR/vncserver.txt 2>&1 VNSERVER_VNCREC=$(cat $TMP_DIR/vncserver.txt | grep 'New' | awk '{ print $5}' ) VNCSERVER_VNCREC_NUMBER=$(cat $TMP_DIR/vncserver.txt | grep 'New' | cut -d: -f2) echo "Launched vncserver $VNSERVER_VNCREC" @@ -125,7 +125,7 @@ start_qemu () { export DISPLAY=$VNSERVER_QEMU -echo "Starting qemu, within Dispaly $VNSERVER_QEMU" +echo "Starting qemu, within Display $VNSERVER_QEMU" $QEMU_BIN -no-kqemu -full-screen -cdrom $ISO -monitor telnet:$IPADDRESS:$QEMU_MONITOR_PORT,server,nowait & sleep 3 i=1 @@ -169,7 +169,7 @@ { convert $LOGO -resize 200x200 -negate -gravity South -background Black -font Helvetica-Bold -fill white -splice 0x36 -pointsize 25 -draw "text 0,0 'AutoTesting'" -transparent black $TMP_DIR/minilogo.png convert $TMP_DIR/minilogo.png -fill grey50 -colorize 40 $TMP_DIR/minilogo.png -VNCREC_MOVIE_CMD='convert xpm:- '$TMP_DIR'/image-%05d.jpg' +VNCREC_MOVIE_CMD="convert xpm:- $TMP_DIR/image-%05d.jpg" export VNCREC_MOVIE_CMD vncrec -movie $TMP_DIR/qemu.1.vnc for i in $TMP_DIR/image-*.jpg @@ -184,7 +184,7 @@ } -make_video () +gen_video () { ##Following is ideal - does not work #mkfifo -m 660 $TMP_DIR/stream.yuv @@ -238,7 +238,6 @@ echo " Minimum geometry for qemu -g 1024x768" echo echo " Launches a couple of vncserver session, kills other vncrec and qemu sessions running." - echo " Requires sudo ifconfig" exit fi @@ -255,6 +254,6 @@ let_qemu_run stop_qemu export_frames -make_video +gen_video stop_vncservers clean_up This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Morphix-cvs] SF.net SVN: morphix: [2553]
trunk/mmaker/utils/auto-testing/ video-qemu-booting-iso.sh
From: <bms...@us...> - 2007-08-15 20:51:56
|
Revision: 2553 http://morphix.svn.sourceforge.net/morphix/?rev=2553&view=rev Author: bmsleight Date: 2007-08-15 13:51:53 -0700 (Wed, 15 Aug 2007) Log Message: ----------- Now using Twibright-vncrec. Twibrihgt packages soon to be available at debian-restricted. Modified Paths: -------------- trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh Modified: trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh =================================================================== --- trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh 2007-08-02 19:20:55 UTC (rev 2552) +++ trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh 2007-08-15 20:51:53 UTC (rev 2553) @@ -3,7 +3,7 @@ # video-qemu-booting-iso.sh # # # # Copyleft (c) 2007 Brendan M. Sleight # -# <bmsleight@barwap._REMOVE_SPAM_TRAP.com> # +# <bmsleight@barwap._REMOVE_SPAM_TRAP.com> # # # # This script is licensed under the GNU GPL v2 or later. # # # @@ -11,8 +11,8 @@ # /usr/share/common-licenses/GPL # # # # Required packages/applications :- # -# bash, expect, ffmpeg2thoera, imagemagick, mencoder, # -# qemu, vncrec, vncserver # +# bash, expect, ffmpeg2thoera, imagemagick, # +# twibright-vnc, qemu, vncserver # # # # Requires /etc/vnc.conf to be ammended. # # # @@ -30,7 +30,7 @@ if [ "$VNCCONF" != "\$vncStartup = \"~/.vnc/xstartup\";" ] then echo "Requires vnc.conf to have the line:- " - echo "\$vncStartup = \"~/.vnc/xstartup\";" + echo "\$vncStartup = \"~/.vnc/xstartup\";" echo "Else two lots of windowm mangers will launched in the extra vnc sessions." exit fi @@ -42,10 +42,9 @@ PASSWD="$RANDOM.$RANDOM.$RANDOM.$RANDOM.$RANDOM" HOSTNAME=$(hostname) OLD_DISPLAY="$DISPLAY" -TODAY=$(date +"%F") +TODAY=$(date +"%F") TMP_DIR=/tmp/vqbi.$$.tmp IPADDRESS="127.0.0.1" -VNCREC_MOVIE_FRAMERATE=1 } get_options_and_defaults () @@ -62,15 +61,13 @@ if [ "$CONVERT_DIM" = "" ]; then CONVERT_DIM="800x600" fi -if [ "$MCODER_DIM" = "" ]; then - MCODER_DIM="w=800:h=600" -fi -MCODER_DIM_SCALE=$(echo "$MCODER_DIM" | sed s/x/,/g) +FFMPEG_DIM_SCALE=$(echo "$CONVERT_DIM" | sed s/x/\ -y\ /g) +FFMPEG_DIM_SCALE="-x $FFMPEG_DIM_SCALE" if [ "$TIME_Q" = "" ]; then - TIME_Q="60" + TIME_Q="600" fi -if [ "$LOGO" = "" ]; then - LOGO="/home/morph/webconverger/openlogo-75.png" +if [ "$VQUALITY" = "" ]; then + VQUALITY="5" fi if [ "$QEMU_BIN" = "" ]; then QEMU_BIN="qemu" @@ -116,7 +113,7 @@ start_vnc_record () { -export DISPLAY="$VNSERVER_VNCREC" +export DISPLAY="$VNSERVER_VNCREC" export VNCREC_MOVIE_FRAMERATE echo "Starting vncrec, recording :$VNCSERVER_QMEU_NUMBER. Local display :$VNCSERVER_VNCREC_NUMBER" vncrec -display :$VNCSERVER_VNCREC_NUMBER -passwd ~/.vnc/passwd -shared -viewonly -encoding raw -record $TMP_DIR/qemu.1.vnc :$VNCSERVER_QMEU_NUMBER & @@ -146,70 +143,28 @@ let_qemu_run () { -echo "Sleeping for $TIME_Q seconds whilst qemu runs" +echo "Sleeping for $TIME_Q seconds whilst qemu runs" sleep $TIME_Q } stop_qemu () { -echo "Stopping vncrec and qemu" +echo "Stopping vncrec and qemu" killall vncrec killall $QEMU_BIN } stop_vncservers () { -echo "Stopping vncservers" +echo "Stopping vncservers" vncserver -kill :$VNCSERVER_QMEU_NUMBER vncserver -kill :$VNCSERVER_VNCREC_NUMBER } - -export_frames () -{ -convert $LOGO -resize 200x200 -negate -gravity South -background Black -font Helvetica-Bold -fill white -splice 0x36 -pointsize 25 -draw "text 0,0 'AutoTesting'" -transparent black $TMP_DIR/minilogo.png -convert $TMP_DIR/minilogo.png -fill grey50 -colorize 40 $TMP_DIR/minilogo.png -VNCREC_MOVIE_CMD="convert xpm:- $TMP_DIR/image-%05d.jpg" -export VNCREC_MOVIE_CMD - -vncrec -movie $TMP_DIR/qemu.1.vnc >/dev/null 2>&1 & -# vncrec can hand sometimes hang and not terminate, after all frames have been generated. -# So we monitor vncrec and kill vncrec when no further frames are being generated -MORE_FRAMES=1 -NUMBER_FRAMES=0 -while [ "$MORE_FRAMES" -gt "$NUMBER_FRAMES" ] -do - NUMBER_FRAMES="$MORE_FRAMES" - sleep 60 - MORE_FRAMES=$(ls $TMP_DIR/image-*.jpg | wc -w) - echo "Frames: $NUMBER_FRAMES to $MORE_FRAMES generated" -done -ps ax | grep vncrec -killall vncrec -echo "vncrec -movie killed" - -for i in $TMP_DIR/image-*.jpg -do - convert $i -resize $CONVERT_DIM $i - echo "Resized $i" - # The logo is needed to ensure we do not have a blank frame, which mencode can not handle. - # Heck - it also looks nice IMHO. - composite -dissolve 15 -gravity northeast $TMP_DIR/minilogo.png $i $i -done -echo "Finished making Frames" -} - - gen_video () { -##Following is ideal - does not work -#mkfifo -m 660 $TMP_DIR/stream.yuv -#mplayer -vo yuv4mpeg:file=$TMP_DIR/stream.yuv -ao null -nosound -quiet "mf://$TMP_DIR/*.jpg" -mf fps=4:type=jpg & -#ffmpeg2theora -v 8 $TMP_DIR/stream.yuv -o $VIDEO -#sleep 5 - -mencoder mf://"$TMP_DIR/*.jpg" -mf w=800:h=600:fps=4:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o $TMP_DIR/tmp.avi -ffmpeg2theora -o $VIDEO $TMP_DIR/tmp.avi --artist "AutoTesting" --title "Video of Qemu booting $ISO" --date "$TODAY" +#Need to runs some tests to ensure vncrec -movie does temriante at end of session. +vncrec -movie $TMP_DIR/qemu.1.vnc | ffmpeg2theora $FFMPEG_DIM_SCALE --videoquality $VQUALITY --inputfps 40 --artist "AutoTesting" --title "Video of Qemu booting $ISO" --date "$TODAY" -o $VIDEO - } clean_up () @@ -217,11 +172,11 @@ DISPLAY="$OLD_DISPLAY" export DISPLAY="$OLD_DISPLAY" rm $TMP_DIR -r -rm /tmp/video-qemu-booting-iso.lock +rm /tmp/video-qemu-booting-iso.lock } -while getopts s:p:g:d:t:l:q: opt +while getopts s:p:g:d:t:v:q: opt do case "$opt" in s) SENDKEYS="$OPTARG";; @@ -229,30 +184,30 @@ g) GEOMETRY="$OPTARG";; d) CONVERT_DIM="$OPTARG";; t) TIME_Q="$OPTARG";; - l) LOGO="$OPTARG";; + v) VQUALITY="$OPTARG";; q) QEMU_BIN="$OPTARG";; - + \?) # unknown flag echo >&2 \ - "usage: $0 [-s \"keys,to,send,to,qemu\"] [-p port_number for qemu-monitor] [-g geometry of vncsession] [-d dimensions of video] [-t time to run qemu] [-l logo] [-q alternative qemu binary name] IsoToTest.iso Video.ogg " + "usage: $0 [-s \"keys,to,send,to,qemu\"] [-p port_number for qemu-monitor] [-g geometry of vncsession] [-d dimensions of video] [-t time to run qemu] [-v (0 to 10) encoding quality for video] [-q alternative qemu binary name] IsoToTest.iso Video.ogg " exit 1;; esac done shift `expr $OPTIND - 1` if [ -z "$1" -a -z "$2" ]; then - echo "usage: $0 [-s \"keys,to,send,to,qemu\"] [-p port_number for qemu-monitor] [-g geometry of vncsession] [-d dimensions of video] [-t time to run qemu] [-l logo] IsoToTest.iso Video.ogg " + echo "usage: $0 [-s \"keys,to,send,to,qemu\"] [-p port_number for qemu-monitor] [-g geometry of vncsession] [-d dimensions of video] [-t time to run qemu] [-v (0 to 10) encoding quality for video] [-q alternative qemu binary name] IsoToTest.iso Video.ogg " echo echo " This script boots a livecd using qemu and records a video of the process. " - echo + echo echo " It is worth noting that this script takes a long time to run and heavy usage of CPU." echo " There is heavy usage of the qemu, imagemagik tools. " echo " For every second of running qemu the script it can take up to 12s to compile the video." echo " For example using -t 300 will about one hour." echo echo " Minimum geometry for qemu -g 1024x768" - echo + echo echo " Launches a couple of vncserver session, kills other vncrec and qemu sessions running." exit fi @@ -269,7 +224,6 @@ start_qemu let_qemu_run stop_qemu -export_frames gen_video stop_vncservers clean_up This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
[Morphix-cvs] SF.net SVN: morphix: [2586]
trunk/mmaker/utils/auto-testing/ video-qemu-booting-iso.sh
From: <bms...@us...> - 2007-11-04 15:42:28
|
Revision: 2586 http://morphix.svn.sourceforge.net/morphix/?rev=2586&view=rev Author: bmsleight Date: 2007-11-04 07:42:24 -0800 (Sun, 04 Nov 2007) Log Message: ----------- Generate a Preview.jpg for the ultra-lazy. Modified Paths: -------------- trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh Modified: trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh =================================================================== --- trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh 2007-11-02 22:59:50 UTC (rev 2585) +++ trunk/mmaker/utils/auto-testing/video-qemu-booting-iso.sh 2007-11-04 15:42:24 UTC (rev 2586) @@ -174,6 +174,41 @@ vncrec -movie $TMP_DIR/qemu.1.vnc | ffmpeg2theora $FFMPEG_DIM_SCALE --videoquality $VQUALITY --inputfps 40 --artist "AutoTesting" --title "Video of Qemu booting $ISO" --date "$TODAY" -o $VIDEO - } +gen_video_preview () +{ +MONTAGE_DIR=/tmp/tp.$$.dir.montage +mkdir $MONTAGE_DIR +ffmpeg -i $VIDEO -vcodec copy $TMP_DIR/duration.ogg 2>$TMP_DIR/ffmpeg.log +DURATION_H=$(cat $TMP_DIR/ffmpeg.log | grep Duration | cut -d ' ' -f 4 | sed s/,// | cut -d ':' -f 1) +DURATION_M=$(cat $TMP_DIR/ffmpeg.log | grep Duration | cut -d ' ' -f 4 | sed s/,// | cut -d ':' -f 2) +DURATION_S=$(cat $TMP_DIR/ffmpeg.log | grep Duration | cut -d ' ' -f 4 | cut -d '.' -f 1 | sed s/,// | cut -d ':' -f 3) +LENGTH=$(($DURATION_H*3600+$DURATION_M*60+$DURATION_S)) +echo $LENGTH $DURATION_H $DURATION_M $DURATION_S +COUNTER=0 +END=5 +COUNT=1 +# Generate a Frame every 0.5 secs for the start of the video +while [ $COUNTER -lt $END ]; do + HALFSECS=$(echo $COUNTER/2|bc -l) + ffmpeg -i $VIDEO -an -ss $HALFSECS -t 01 -r 1 -y -s 320x240 $TMP_DIR/video%d.jpg 2>/dev/null + mv $TMP_DIR/video1.jpg $MONTAGE_DIR/$COUNT.jpg + LIST="$LIST $MONTAGE_DIR/$COUNT.jpg" + let COUNT=COUNT+1 + let COUNTER=COUNTER+1 +done +SPLIT=$(($LENGTH/12)) +COUNTER="$SPLIT" +while [ $COUNTER -lt $LENGTH ]; do + ffmpeg -i $VIDEO -an -ss $COUNTER -t 01 -r 1 -y $TMP_DIR/video%d.jpg 2>/dev/null + mv $TMP_DIR/video1.jpg $MONTAGE_DIR/$COUNT.jpg + LIST="$LIST $MONTAGE_DIR/$COUNT.jpg" + let COUNT=COUNT+1 + let COUNTER=$(($COUNTER+$SPLIT)) +done +montage -geometry 180x135+4+4 -frame 5 $LIST $VIDEO.jpg +rm -R $MONTAGE_DIR +} + clean_up () { DISPLAY="$OLD_DISPLAY" @@ -183,7 +218,7 @@ } -while getopts s:p:g:d:t:v:q: opt +while getopts s:p:g:d:t:v:q:n opt do case "$opt" in s) SENDKEYS="$OPTARG";; @@ -193,18 +228,19 @@ t) TIME_Q="$OPTARG";; v) VQUALITY="$OPTARG";; q) QEMU_BIN="$OPTARG";; + n) NOPREVIEW="true";; \?) # unknown flag echo >&2 \ - "usage: $0 [-s \"keys,to,send,to,qemu\"] [-p port_number for qemu-monitor] [-g geometry of vncsession] [-d dimensions of video] [-t time to run qemu] [-v (0 to 10) encoding quality for video] [-q alternative qemu binary name] IsoToTest.iso Video.ogg " + "usage: $0 [-s \"keys,to,send,to,qemu\"] [-p port_number for qemu-monitor] [-g geometry of vncsession] [-d dimensions of video] [-t time to run qemu] [-v (0 to 10) encoding quality for video] [-q alternative qemu binary name] [-n] IsoToTest.iso Video.ogg " exit 1;; esac done shift `expr $OPTIND - 1` if [ -z "$1" -a -z "$2" ]; then - echo "usage: $0 [-s \"keys,to,send,to,qemu\"] [-p port_number for qemu-monitor] [-g geometry of vncsession] [-d dimensions of video] [-t time to run qemu] [-v (0 to 10) encoding quality for video] [-q alternative qemu binary name] IsoToTest.iso Video.ogg " + echo "usage: $0 [-s \"keys,to,send,to,qemu\"] [-p port_number for qemu-monitor] [-g geometry of vncsession] [-d dimensions of video] [-t time to run qemu] [-v (0 to 10) encoding quality for video] [-q alternative qemu binary name] [-n Do not gernerate a preview of the video.ogg.jpg] IsoToTest.iso Video.ogg " echo echo " This script boots a livecd using qemu and records a video of the process. " echo @@ -232,5 +268,10 @@ let_qemu_run stop_qemu gen_video +if [ "$NOPREVIEW" = "true" ]; then + echo "Skipping jpg preview" +else + gen_video_preview +fi stop_vncservers clean_up This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |