2024-12-16 03:53:42 +11:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e ; set -u
|
2025-01-12 12:33:39 +11:00
|
|
|
source tools/fonctions.sh
|
2024-12-16 03:53:42 +11:00
|
|
|
|
2024-12-29 14:56:10 +11:00
|
|
|
SEQNAME="$1"
|
2024-12-23 01:05:36 +11:00
|
|
|
NBFRAMES=360
|
2024-12-16 03:53:42 +11:00
|
|
|
|
2024-12-31 22:51:12 +11:00
|
|
|
|
2025-01-16 08:13:42 +11:00
|
|
|
echo "Running $0 $SEQNAME" >> WS/log
|
2024-12-31 22:51:12 +11:00
|
|
|
|
2025-01-16 08:13:42 +11:00
|
|
|
DIMS="-W1024 -H768"
|
2025-01-16 11:04:49 +11:00
|
|
|
POVOPT="+q9 +A -d ${DIMS} -WT6"
|
2024-12-16 03:53:42 +11:00
|
|
|
echo $POVOPT ; echo ; sleep 2
|
|
|
|
|
2024-12-29 14:56:10 +11:00
|
|
|
TMPIMG=/dev/shm/${SEQNAME}-tmp.png
|
2024-12-16 03:53:42 +11:00
|
|
|
|
2024-12-23 01:05:36 +11:00
|
|
|
for frame in $(seq 0 $((NBFRAMES-1)))
|
2024-12-16 03:53:42 +11:00
|
|
|
do
|
|
|
|
|
2025-01-02 11:23:49 +11:00
|
|
|
img=$(printf "frames/%s/%05d.png" $SEQNAME $frame)
|
2024-12-16 03:53:42 +11:00
|
|
|
debut=$(date +%s)
|
2024-12-21 00:24:45 +11:00
|
|
|
set +e
|
2024-12-29 14:56:10 +11:00
|
|
|
povray ${POVOPT} +K${frame} -i${SEQNAME}.pov -o${TMPIMG}
|
2024-12-21 00:24:45 +11:00
|
|
|
err=$?
|
|
|
|
if [ $err != 0 ] ; then
|
2024-12-29 14:56:10 +11:00
|
|
|
echo "$SEQNAME fail $frame" >> WS/log
|
2025-01-02 11:23:49 +11:00
|
|
|
mogrify -colorspace gray $img
|
2025-01-16 08:13:42 +11:00
|
|
|
visual_sleep 12
|
2024-12-21 00:24:45 +11:00
|
|
|
continue
|
|
|
|
fi
|
|
|
|
set -e
|
2025-01-12 12:33:39 +11:00
|
|
|
txt=$(printf "%s %03d" ${SEQNAME} $frame | tr '0' 'o')
|
2025-01-02 11:23:49 +11:00
|
|
|
# echo $frame $img $txt
|
|
|
|
convert ${TMPIMG} \
|
|
|
|
-font Courier-Bold \
|
2025-01-12 12:33:39 +11:00
|
|
|
-pointsize 18 \
|
|
|
|
-fill Gray80 \
|
2025-01-02 11:23:49 +11:00
|
|
|
-gravity south \
|
|
|
|
-annotate +0+5 "$txt" \
|
2024-12-16 03:53:42 +11:00
|
|
|
${img}
|
|
|
|
fin=$(date +%s)
|
2025-01-16 08:13:42 +11:00
|
|
|
echo
|
2025-01-02 11:23:49 +11:00
|
|
|
echo ${SEQNAME} $frame $(( fin - debut )) | \
|
|
|
|
tee -a WS/mp4.timing
|
2025-01-12 12:33:39 +11:00
|
|
|
echo ; sleep 3
|
2024-12-16 03:53:42 +11:00
|
|
|
done
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
2025-01-16 08:13:42 +11:00
|
|
|
ff_encodage $SEQNAME wip-${SEQNAME}.mp4
|
2025-01-02 11:23:49 +11:00
|
|
|
|
|
|
|
echo "+------- build of $SEQNAME done"
|
|
|
|
|