reworking the build system

This commit is contained in:
Tonton Th 2025-01-15 22:13:42 +01:00
parent 6828b25402
commit 22be42d86e
4 changed files with 53 additions and 41 deletions

View File

@ -2,7 +2,15 @@
set -eu set -eu
# -------------------------------------------------------------- # --------------------------------------------------------------
# visual_sleep ()
{
for foo in $(seq 0 $1) ; do
printf '*'
sleep 1
done
echo
}
# --------------------------------------------------------------
# un essai qui semble un echec. # un essai qui semble un echec.
# #
ralentisseur () ralentisseur ()
@ -17,7 +25,6 @@ if [ $load -gt 10 ] ; then
sleep $attente sleep $attente
fi fi
} }
# -------------------------------------------------------------- # --------------------------------------------------------------
ff_encodage() ff_encodage()

View File

@ -6,8 +6,8 @@ IDX=0
SPOOL="frames/Spool" SPOOL="frames/Spool"
SEQNAME="none" SEQNAME="none"
TMP="WS/tmp.png" TMP="WS/tmp.png"
FONTE="Palatino-Bold" FONTE="Helvetica-Bold"
TEXTCOL="orange" TEXTCOL="yellow"
STROKOL="darkblue" STROKOL="darkblue"
source tools/fonctions.sh source tools/fonctions.sh
@ -17,7 +17,7 @@ source tools/fonctions.sh
# file to the spool dir, so # file to the spool dir, so
# you can use it for tmp pics. # you can use it for tmp pics.
# #
addfile () copy_a_file ()
{ {
src="$1" src="$1"
dstname=$(printf "%s/%05d.png" $SPOOL $IDX) dstname=$(printf "%s/%05d.png" $SPOOL $IDX)
@ -27,25 +27,33 @@ cp -f $src $dstname
IDX=$(( IDX + 1 )) IDX=$(( IDX + 1 ))
} }
# ------------------------------------------------------- # -------------------------------------------------------
linkfarm () linkfarm ()
{ {
SRC="frames/$1" SRC="frames/$1"
echo "linkfarm $SRC" | tee -a WS/log echo "linkfarm $SRC" | tee -a WS/log
tools/plot-timing.sh $1
local NBRE=60
local NBRE=30
for foo in $(seq 0 $NBRE) for foo in $(seq 0 $NBRE)
do 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 done
for src in "$SRC"/* for src in "$SRC"/*
do do
addfile $src copy_a_file $src
done done
for foo in $(seq 0 $NBRE) for foo in $(seq 0 $NBRE)
do do
addfile "$SRC/00359.png" copy_a_file "$SRC/00359.png"
done done
} }
# ------------------------------------------------------- # -------------------------------------------------------
@ -54,10 +62,15 @@ faire_le_titre ()
echo "faire le titre" echo "faire le titre"
local NBRE=180 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) for foo in $(seq 0 $NBRE)
do do
Ypos=$(( 210 - ( foo / 3 ) )) Ypos=$(( -175 + foo ))
convert "WS/negatif.png" \ convert ${GRAY} \
-gravity north \ -gravity north \
-font $FONTE \ -font $FONTE \
-pointsize 172 \ -pointsize 172 \
@ -67,7 +80,7 @@ do
-annotate +0+${Ypos} "HexaCone" \ -annotate +0+${Ypos} "HexaCone" \
${TMP} ${TMP}
# identify ${TMP} # identify ${TMP}
addfile ${TMP} copy_a_file ${TMP}
printf "." printf "."
done done
echo echo
@ -75,13 +88,13 @@ echo
# ------------------------------------------------------- # -------------------------------------------------------
faire_la_fin () faire_la_fin ()
{ {
local NBRE=150 local NBRE=180
datetime=$(LANG=fr date -u +"%Y/%M/%D") datetime=$(LANG=fr date -u +"%Y/%m/%d")
echo $datetime | tee -a WS/log echo $datetime | tee -a WS/log
for foo in $(seq 0 $NBRE) for foo in $(seq 0 $NBRE)
do do
Ypos=$(( foo + 100 )) Ypos=$(( foo + 20 ))
convert "WS/negatif.png" \ convert "WS/negatif.png" \
-gravity north \ -gravity north \
-font $FONTE \ -font $FONTE \
@ -89,14 +102,15 @@ do
-kerning 6 \ -kerning 6 \
-fill $TEXTCOL \ -fill $TEXTCOL \
-strokewidth 2 -stroke $STROKOL \ -strokewidth 2 -stroke $STROKOL \
-annotate +0+${Ypos} "tTh des Bourtoulots" \ -annotate +0+${Ypos} \
"un film de\ntTh des Bourtoulots" \
-pointsize 48 \ -pointsize 48 \
-strokewidth 1 \ -strokewidth 1 \
-gravity south \ -gravity south \
-annotate +0+270 "${datetime}" \ -annotate +0+170 "${datetime}" \
${TMP} ${TMP}
# identify ${TMP} # identify ${TMP}
addfile ${TMP} copy_a_file ${TMP}
printf "." printf "."
done done
echo echo
@ -107,10 +121,11 @@ figlet "Link farmer"
rm -f frames/Spool/*.png rm -f frames/Spool/*.png
tools/plot-timing.sh # tools/plot-timing.sh
faire_le_titre faire_le_titre
linkfarm hexabenz linkfarm hexabenz
linkfarm hexacone
linkfarm escadrille linkfarm escadrille
linkfarm topview linkfarm topview
linkfarm passage linkfarm passage
@ -124,7 +139,8 @@ faire_la_fin
ff_encodage Spool full.mp4 ff_encodage Spool full.mp4
echo "linkfarmed $IDX files" | tee -a WS/log nb=$(( $IDX - 1 ))
echo "linkfarmed $nb files" | tee -a WS/log

View File

@ -3,27 +3,20 @@
set -e ; set -u set -e ; set -u
source tools/fonctions.sh source tools/fonctions.sh
TYPE="mp4"
SEQNAME="$1" SEQNAME="$1"
NBFRAMES=360 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 echo $POVOPT ; echo ; sleep 2
TMPIMG=/dev/shm/${SEQNAME}-tmp.png TMPIMG=/dev/shm/${SEQNAME}-tmp.png
for frame in $(seq 0 $((NBFRAMES-1))) for frame in $(seq 0 $((NBFRAMES-1)))
do do
# figlet -k $frame ; sleep 1
# ralentisseur 20 ; echo "go"
img=$(printf "frames/%s/%05d.png" $SEQNAME $frame) img=$(printf "frames/%s/%05d.png" $SEQNAME $frame)
debut=$(date +%s) debut=$(date +%s)
@ -33,7 +26,7 @@ do
if [ $err != 0 ] ; then if [ $err != 0 ] ; then
echo "$SEQNAME fail $frame" >> WS/log echo "$SEQNAME fail $frame" >> WS/log
mogrify -colorspace gray $img mogrify -colorspace gray $img
sleep 6 visual_sleep 12
continue continue
fi fi
set -e set -e
@ -47,7 +40,7 @@ do
-annotate +0+5 "$txt" \ -annotate +0+5 "$txt" \
${img} ${img}
fin=$(date +%s) fin=$(date +%s)
echo ; sleep 1 echo
echo ${SEQNAME} $frame $(( fin - debut )) | \ echo ${SEQNAME} $frame $(( fin - debut )) | \
tee -a WS/mp4.timing tee -a WS/mp4.timing
echo ; sleep 3 echo ; sleep 3
@ -55,11 +48,7 @@ done
echo echo
case $TYPE in ff_encodage $SEQNAME wip-${SEQNAME}.mp4
"gif89a") convert -delay 8 -dither none \
-colors 102 frames/* foo.gif ;;
"mp4") ff_encodage $SEQNAME wip-${SEQNAME}.mp4 ;;
esac
echo "+------- build of $SEQNAME done" echo "+------- build of $SEQNAME done"

View File

@ -5,9 +5,6 @@ set -ue
TMPFILE="/dev/shm/plot-timing.tmp" TMPFILE="/dev/shm/plot-timing.tmp"
IMAGE="timing.png" IMAGE="timing.png"
echo ; figlet "plot timing" ; echo
wc WS/mp4.timing | tee -a WS/log
if [ $# == 1 ] if [ $# == 1 ]
then then
sequence=$1 sequence=$1
@ -15,7 +12,10 @@ else
sequence="escadrille" sequence="escadrille"
fi 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 { \ BEGIN { \
nbrames=360; \ nbrames=360; \
for (foo=0; foo<nbrames; foo++) { \ for (foo=0; foo<nbrames; foo++) { \