From a72f544b4bd07971afea70f52aa731322cf9f702 Mon Sep 17 00:00:00 2001 From: tTh Date: Sat, 11 Feb 2023 21:03:33 +0100 Subject: [PATCH] nice effects list with vidz --- contrib/.gitignore | 4 ++ contrib/README.md | 8 +-- contrib/do_eff_spass.sh | 115 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 124 insertions(+), 3 deletions(-) create mode 100755 contrib/do_eff_spass.sh diff --git a/contrib/.gitignore b/contrib/.gitignore index a87249e7..566c40fe 100644 --- a/contrib/.gitignore +++ b/contrib/.gitignore @@ -2,8 +2,12 @@ fimg2povhf demo_fmorph +toto + *.tga *.png *.pnm *.gif *.fimg +*.mp4 + diff --git a/contrib/README.md b/contrib/README.md index b4be3318..9983eeb0 100644 --- a/contrib/README.md +++ b/contrib/README.md @@ -4,9 +4,11 @@ Need some external garbage, sorry. -Try to compile this really old code: - http://la.buvette.org/devel/libimage/libimage.html +## do_eff_spass.sh + +Script shell permettant (en théorie) de faire un montage +d'une petite séquence de chacun des effets disponibles +dans la Fonderie. `singlepass` inside. -Use the code, frtk ! diff --git a/contrib/do_eff_spass.sh b/contrib/do_eff_spass.sh new file mode 100755 index 00000000..4902026c --- /dev/null +++ b/contrib/do_eff_spass.sh @@ -0,0 +1,115 @@ +#!/bin/bash + +set -e + +SPASS="../Fonderie/singlepass" + +SRCDIR=$HOME"/Essais/PS-eye/frames/" +DSTPOL=$HOME"/TMP/" +echo "source = " $SRCDIR " spool = " $DSTPOL + +LINKFARM=$DSTPOL"LinkFarm" +echo "linkfarm = " $LINKFARM + +VIDZ="$HOME/BU/vrac/all_effects.mp4" +echo "lolvidz = " $VIDZ + +LINKNUM=0 + +# -------------------------------------------- + +do_an_effect_pass() +{ +local effect=$1 +local ddir=$2 +figlet "$effect" ; echo + +echo " ===> " $ddir +ls $ddir | wc + +rm -f $ddir/?????.png +ls $ddir | wc + +$SPASS -F $effect \ + -g $SRCDIR/'?????.fimg' \ + -O $ddir \ + -r 2 +ls $ddir | wc +} + +# -------------------------------------------- + +make_the_linkfarm_from() +{ +local effname=$1 +local sdir=$2 + +echo "====== Linkfarming from " $sdir \ + "====== avec" $(ls $sdir | wc -l) "images" + +for img in $(ls -1 $sdir/?????.png) +do + + linkname=$(printf "%s/L%05d.png" $LINKFARM $LINKNUM) + # echo "image = " $img + # echo "link = " $linkname + + mogrify \ + -font Noto-Serif-Bold \ + -pointsize 70 \ + -kerning 4 \ + -fill Gray90 \ + -stroke Gray10 \ + -strokewidth 3 \ + -annotate +35+85 $effname \ + $img + + ln --force --symbolic $img $linkname + + LINKNUM=$(( LINKNUM + 1 )) +done +echo "linkfarming done" +} +# -------------------------------------------- +# traite tous les effets + +do_all_the_effects() +{ +EFFECTS=$( $SPASS -L | sort ) + +for effect in $EFFECTS +do + DDIR=$DSTPOL"/$effect" + + if [ -d $DDIR ] ; then + rm -f $DDIR"/?????.png" + fi + if [ ! -r $DDIR ] ; then + mkdir -v $DDIR + fi + + do_an_effect_pass $effect $DDIR + make_the_linkfarm_from $effect $DDIR + +done +} + +# -------------------------------------------- +# MAIN + +rm -v -f $LINKFARM/L?????.png + + + +do_all_the_effects + +banner encoding + +ffmpeg -nostdin \ + -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 +