HexaCone/tools/fonctions.sh

66 lines
1.5 KiB
Bash
Raw Permalink Normal View History

2025-01-05 10:41:14 +11:00
set -eu
# --------------------------------------------------------------
2025-01-16 08:13:42 +11:00
visual_sleep ()
{
for foo in $(seq 0 $1) ; do
printf '*'
sleep 1
done
echo
}
# --------------------------------------------------------------
2025-01-12 12:33:39 +11:00
# un essai qui semble un echec.
#
2025-01-05 10:41:14 +11:00
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
}
# --------------------------------------------------------------
2025-01-12 12:33:39 +11:00
#
# celui-ci n'est pas terminé !
#
2025-01-05 10:41:14 +11:00
mp_encodage()
{
#
# NOT WORKING !
#
mencoder 'mf://frames/*.png' \
-mf \
fps=24 \
-ovc lavc \
-lavcopts vcodec=mpeg4 \
-o output.avi
}
# --------------------------------------------------------------
# --------------------------------------------------------------