refactoring the build system, part 2

This commit is contained in:
Tonton Th 2025-01-05 00:44:36 +01:00
parent d89876b633
commit 8c548c6f0e
4 changed files with 0 additions and 195 deletions

View File

@ -1,14 +0,0 @@
#!/bin/bash
set -e ; set -u
if [ $# == 1 ]
then
srcdir=$1
else
srcdir="essai"
fi
source ./fonctions.sh
ff_encodage $srcdir wip.mp4

View File

@ -1,53 +0,0 @@
set -eu
# --------------------------------------------------------------
ralentisseur ()
{
temps=$1
load=$(awk '{print int($1)}' < /proc/loadavg)
# echo " load is $load" | tee -a WS/log
if [ $load -gt 10 ] ; then
attente=$(( $temps + ($RANDOM % 90) ))
echo "ralentir $0 $SEQNAME $attente" # | tee -a WS/log
sleep $attente
fi
}
# --------------------------------------------------------------
ff_encodage()
{
SRCDIR="$1"
FILMNAME="$2"
echo "Encoding $SRCDIR to $FILMNAME" | tee -a WS/log
ffmpeg -nostdin \
-y -r 30 -f image2 -i frames/${SRCDIR}/%05d.png \
-metadata artist='--[ tTh ]--' \
-metadata title='-- HexaCone --' \
-c:v libx264 \
-pix_fmt yuv420p \
-tune film \
$FILMNAME
# wc -c $FILMNAME | tee -a WS/log
}
# --------------------------------------------------------------
mp_encodage()
{
#
# NOT WORKING !
#
mencoder 'mf://frames/*.png' \
-mf \
fps=24 \
-ovc lavc \
-lavcopts vcodec=mpeg4 \
-o output.avi
}
# --------------------------------------------------------------
# --------------------------------------------------------------

View File

@ -1,82 +0,0 @@
#!/bin/bash
set -e ; set -u
source ./fonctions.sh
IDX=0
SPOOL="frames/Spool"
# -------------------------------------------------------
addfile ()
{
src="$1"
dstname=$(printf "%s/%05d.png" $SPOOL $IDX)
# echo "$src -> $dstname"
# ln --force --symbolic $src $dstname
cp -f $src $dstname
IDX=$(( IDX + 1 ))
}
# -------------------------------------------------------
linkfarm ()
{
SRC="frames/$1"
echo "linkfarm $SRC" | tee -a WS/log
local NBRE=30
for foo in $(seq 0 $NBRE)
do
addfile "$SRC/00000.png"
done
for src in "$SRC"/*
do
addfile $src
done
for foo in $(seq 0 $NBRE)
do
addfile "$SRC/00359.png"
done
sync
}
# -------------------------------------------------------
faire_le_titre ()
{
echo "faire le titre"
local NBRE=90
for foo in $(seq 0 $NBRE)
do
addfile "datas/cover.png"
done
}
# -------------------------------------------------------
faire_la_fin ()
{
local NBRE=90
for foo in $(seq 0 $NBRE)
do
addfile "datas/back.png"
done
}
# -------------------------------------------------------
faire_le_titre
ralentisseur 10
linkfarm orbite
linkfarm topview
linkfarm passage
linkfarm scene
linkfarm essai
faire_la_fin
ff_encodage Spool full.mp4

View File

@ -1,46 +0,0 @@
#!/bin/bash
set -ue
TMPFILE="/dev/shm/plot-timing.tmp"
IMAGE="timing.png"
tail -3600 WS/mp4.timing | awk ' \
BEGIN { \
nbrames=360;
for (foo=0; foo<nbrames; foo++) { \
mini[foo] = 666; \
maxi[foo] = -42; \
} \
}
\
$1=="passage" { \
accu[$2] += $3; \
count[$2]++; \
if (mini[$2] > $3) mini[$2] = $3; \
if (maxi[$2] < $3) maxi[$2] = $3; \
} \
END { \
for (foo=0; foo<nbrames; foo++) { \
if (count[foo] > 0) { \
mean = accu[foo] / count[foo]; \
printf "%4d %4f %4d %4d\n", foo, mean, \
mini[foo], maxi[foo]; \
} \
}
} \
' > $TMPFILE
gnuplot << __EOC__
set term png size 800,480
set output "timing.png"
set grid
set xrange [:360]
set yrange [:30]
set title "HexaCone : temps de tracé vs. numéro de séquence"
set xlabel "numéro de la trame"
set ylabel "temps en secondes"
plot "/dev/shm/plot-timing.tmp" u 1:4 w l t "maximum", \
"/dev/shm/plot-timing.tmp" u 1:3 w l t "minimum", \
"/dev/shm/plot-timing.tmp" u 1:2 w l t "moyenne",
__EOC__