From 11a1e951460166354c469a3ba041b268772d06a5 Mon Sep 17 00:00:00 2001 From: tTh Date: Sun, 9 Apr 2023 05:28:07 +0200 Subject: [PATCH] cosmetic changes --- Fonderie/singlepass.c | 2 +- contrib/do_eff_spass.sh | 77 ++++++++++++++++++++++++++++++++++------- 2 files changed, 65 insertions(+), 14 deletions(-) diff --git a/Fonderie/singlepass.c b/Fonderie/singlepass.c index 585d30e..fe729e3 100644 --- a/Fonderie/singlepass.c +++ b/Fonderie/singlepass.c @@ -119,7 +119,7 @@ fprintf(stderr, "\n"); globfree(&globbuf); fimg_destroy(&image); -single_print_state("end of run", 0); +// single_print_state("end of run", 0); elapsed = fimg_timer_get(0); fprintf(stderr, "%s: %ld frames, elapsed %.3f s, %.3f fps\n", diff --git a/contrib/do_eff_spass.sh b/contrib/do_eff_spass.sh index d22edd4..3749dee 100755 --- a/contrib/do_eff_spass.sh +++ b/contrib/do_eff_spass.sh @@ -6,12 +6,14 @@ SPASS="../Fonderie/singlepass" SRCDIR=$HOME"/Essais/PS-eye/frames/" DSTPOL=$HOME"/TMP/" -echo "source = " $SRCDIR " spool = " $DSTPOL +echo "source = " $SRCDIR +echo "spool = " $DSTPOL LINKFARM=$DSTPOL"LinkFarm" echo "linkfarm = " $LINKFARM -VIDZ="$HOME/BU/vrac/all_effects.mp4" +# VIDZ="$HOME/BU/vrac/all_effects.mp4" +VIDZ="foo.mp4" echo "lolvidz = " $VIDZ LINKNUM=0 @@ -24,7 +26,7 @@ local effect=$1 local ddir=$2 figlet "$effect" ; echo -echo " ===> " $ddir +echo " files to ===> " $ddir rm -f $ddir/?????.png @@ -35,6 +37,29 @@ $SPASS -F $effect \ } +# -------------------------------------------- +insert_blank() +{ +local count=$1 + +local imgname="$DSTPOL/blank.fimg" + +if [ ! -r $imgname ] ; then + mkfimg -v -t black $imgname 640 480 + fimg2png -v $imgname $DSTPOL/blank.png + echo "blankimage done" | boxes + # display $DSTPOL/blank.png & + # exit +fi + +for foo in $(seq 0 $count) +do + linkname=$(printf "%s/L%05d.png" $LINKFARM $LINKNUM) + ln --force --symbolic $DSTPOL/blank.png $linkname + # file $linkname + LINKNUM=$(( LINKNUM + 1 )) +done +} # -------------------------------------------- make_the_linkfarm_from() @@ -47,13 +72,13 @@ echo "====== Linkfarming from " $sdir \ mogrify \ -font Utopia-Bold \ - -pointsize 90 \ + -pointsize 64 \ -kerning 9 \ - -fill Gray80 \ - -stroke Gray20 \ - -strokewidth 3 \ + -fill Gray90 \ + -stroke Gray10 \ + -strokewidth 2 \ -gravity South-East \ - -annotate +45+125 $effname \ + -annotate +30+20 $effname \ $sdir/*.png for img in $(ls -1 $sdir/?????.png) @@ -67,14 +92,16 @@ do LINKNUM=$(( LINKNUM + 1 )) done -echo "linkfarming done" +echo " linkfarming done" } # -------------------------------------------- # traite tous les effets do_all_the_effects() { -EFFECTS=$( $SPASS -L | sort --reverse ) +EFFECTS=$( $SPASS -L | sort ) + +banner 'FULL RUN' for effect in $EFFECTS do @@ -90,23 +117,47 @@ do do_an_effect_pass $effect $DDIR make_the_linkfarm_from $effect $DDIR + insert_blank 30 done } +# -------------------------------------------- + +debug_run() +{ +local eff=$1 +local DDIR=$DSTPOL"/$eff" + +banner 'DEBUG RUN' +echo "DDIR = " $DDIR + +do_an_effect_pass $eff $DDIR +make_the_linkfarm_from $eff $DDIR +} + # -------------------------------------------- # MAIN -rm -v -f $LINKFARM/L?????.png +echo +rm -v -f $LINKFARM/L*.png ; echo + +insert_blank 30 + +# debug_run 'rndblks' do_all_the_effects -banner encoding +banner 'encoding' ffmpeg -nostdin \ - -y -r 30 -f image2 -i ${LINKFARM}/L%05d.png \ + -loglevel warning \ + -y -r 30 -f image2 -i ${LINKFARM}/L%05d.png \ -metadata artist='---[ tTh ]---' \ -metadata title='---[ All the 'Fonderie' effects ]---' \ -preset veryslow \ -c:v libx264 -pix_fmt yuv420p \ $VIDZ +echo " encoding of " $VIDZ " . . . . . [done]" + +