diff --git a/tools/fonctions.sh b/tools/fonctions.sh index a8e4e9a..098a20d 100644 --- a/tools/fonctions.sh +++ b/tools/fonctions.sh @@ -2,7 +2,15 @@ set -eu # -------------------------------------------------------------- -# +visual_sleep () +{ +for foo in $(seq 0 $1) ; do + printf '*' + sleep 1 +done +echo +} +# -------------------------------------------------------------- # un essai qui semble un echec. # ralentisseur () @@ -17,7 +25,6 @@ if [ $load -gt 10 ] ; then sleep $attente fi } - # -------------------------------------------------------------- ff_encodage() diff --git a/tools/linkfarmer.sh b/tools/linkfarmer.sh index e3e3d7c..d7493c6 100755 --- a/tools/linkfarmer.sh +++ b/tools/linkfarmer.sh @@ -6,8 +6,8 @@ IDX=0 SPOOL="frames/Spool" SEQNAME="none" TMP="WS/tmp.png" -FONTE="Palatino-Bold" -TEXTCOL="orange" +FONTE="Helvetica-Bold" +TEXTCOL="yellow" STROKOL="darkblue" source tools/fonctions.sh @@ -17,7 +17,7 @@ source tools/fonctions.sh # file to the spool dir, so # you can use it for tmp pics. # -addfile () +copy_a_file () { src="$1" dstname=$(printf "%s/%05d.png" $SPOOL $IDX) @@ -27,25 +27,33 @@ cp -f $src $dstname IDX=$(( IDX + 1 )) } # ------------------------------------------------------- + linkfarm () { SRC="frames/$1" echo "linkfarm $SRC" | tee -a WS/log +tools/plot-timing.sh $1 + +local NBRE=60 -local NBRE=30 for foo in $(seq 0 $NBRE) do - addfile "$SRC/00000.png" + copy_a_file "WS/negatif.png" +done + +for foo in $(seq 0 $NBRE) +do + copy_a_file "$SRC/00000.png" done for src in "$SRC"/* do - addfile $src + copy_a_file $src done for foo in $(seq 0 $NBRE) do - addfile "$SRC/00359.png" + copy_a_file "$SRC/00359.png" done } # ------------------------------------------------------- @@ -54,10 +62,15 @@ faire_le_titre () echo "faire le titre" local NBRE=180 +local SRC="frames/passage/00059.png" +local GRAY="/dev/shm/tmp-titre.png" + +convert -colorspace gray -colors 27 $SRC $GRAY + for foo in $(seq 0 $NBRE) do - Ypos=$(( 210 - ( foo / 3 ) )) - convert "WS/negatif.png" \ + Ypos=$(( -175 + foo )) + convert ${GRAY} \ -gravity north \ -font $FONTE \ -pointsize 172 \ @@ -67,7 +80,7 @@ do -annotate +0+${Ypos} "HexaCone" \ ${TMP} # identify ${TMP} - addfile ${TMP} + copy_a_file ${TMP} printf "." done echo @@ -75,13 +88,13 @@ echo # ------------------------------------------------------- faire_la_fin () { -local NBRE=150 -datetime=$(LANG=fr date -u +"%Y/%M/%D") +local NBRE=180 +datetime=$(LANG=fr date -u +"%Y/%m/%d") echo $datetime | tee -a WS/log for foo in $(seq 0 $NBRE) do - Ypos=$(( foo + 100 )) + Ypos=$(( foo + 20 )) convert "WS/negatif.png" \ -gravity north \ -font $FONTE \ @@ -89,14 +102,15 @@ do -kerning 6 \ -fill $TEXTCOL \ -strokewidth 2 -stroke $STROKOL \ - -annotate +0+${Ypos} "tTh des Bourtoulots" \ + -annotate +0+${Ypos} \ + "un film de\ntTh des Bourtoulots" \ -pointsize 48 \ -strokewidth 1 \ -gravity south \ - -annotate +0+270 "${datetime}" \ + -annotate +0+170 "${datetime}" \ ${TMP} # identify ${TMP} - addfile ${TMP} + copy_a_file ${TMP} printf "." done echo @@ -107,10 +121,11 @@ figlet "Link farmer" rm -f frames/Spool/*.png -tools/plot-timing.sh +# tools/plot-timing.sh faire_le_titre linkfarm hexabenz +linkfarm hexacone linkfarm escadrille linkfarm topview linkfarm passage @@ -124,7 +139,8 @@ faire_la_fin ff_encodage Spool full.mp4 -echo "linkfarmed $IDX files" | tee -a WS/log +nb=$(( $IDX - 1 )) +echo "linkfarmed $nb files" | tee -a WS/log diff --git a/mkloop.sh b/tools/mkloop.sh similarity index 67% rename from mkloop.sh rename to tools/mkloop.sh index be43d95..863d29f 100755 --- a/mkloop.sh +++ b/tools/mkloop.sh @@ -3,27 +3,20 @@ set -e ; set -u source tools/fonctions.sh -TYPE="mp4" SEQNAME="$1" NBFRAMES=360 -case $TYPE in - "gif89a") DIMS="-W640 -H480" ;; - "mp4") DIMS="-W1024 -H768" ;; -esac -echo "Running $0 $TYPE $SEQNAME" >> WS/log +echo "Running $0 $SEQNAME" >> WS/log -POVOPT="+q9 +a0.01 -d ${DIMS} -WT6" +DIMS="-W1024 -H768" +POVOPT="+q9 -a -d ${DIMS} -WT6" echo $POVOPT ; echo ; sleep 2 TMPIMG=/dev/shm/${SEQNAME}-tmp.png for frame in $(seq 0 $((NBFRAMES-1))) do - # figlet -k $frame ; sleep 1 - - # ralentisseur 20 ; echo "go" img=$(printf "frames/%s/%05d.png" $SEQNAME $frame) debut=$(date +%s) @@ -33,7 +26,7 @@ do if [ $err != 0 ] ; then echo "$SEQNAME fail $frame" >> WS/log mogrify -colorspace gray $img - sleep 6 + visual_sleep 12 continue fi set -e @@ -47,7 +40,7 @@ do -annotate +0+5 "$txt" \ ${img} fin=$(date +%s) - echo ; sleep 1 + echo echo ${SEQNAME} $frame $(( fin - debut )) | \ tee -a WS/mp4.timing echo ; sleep 3 @@ -55,11 +48,7 @@ done echo -case $TYPE in - "gif89a") convert -delay 8 -dither none \ - -colors 102 frames/* foo.gif ;; - "mp4") ff_encodage $SEQNAME wip-${SEQNAME}.mp4 ;; -esac +ff_encodage $SEQNAME wip-${SEQNAME}.mp4 echo "+------- build of $SEQNAME done" diff --git a/tools/plot-timing.sh b/tools/plot-timing.sh index 198007e..b7d823e 100755 --- a/tools/plot-timing.sh +++ b/tools/plot-timing.sh @@ -5,9 +5,6 @@ set -ue TMPFILE="/dev/shm/plot-timing.tmp" IMAGE="timing.png" -echo ; figlet "plot timing" ; echo -wc WS/mp4.timing | tee -a WS/log - if [ $# == 1 ] then sequence=$1 @@ -15,7 +12,10 @@ else sequence="escadrille" fi -grep $sequence WS/mp4.timing | tail -3600 | awk ' \ +echo "plot timing $sequence" | tee -a WS/log +# wc WS/mp4.timing | tee -a WS/log + +grep $sequence WS/mp4.timing | tail -3600 | awk ' \ BEGIN { \ nbrames=360; \ for (foo=0; foo