Fortraneries/Fraktalism/pick3d.sh

51 lines
1003 B
Bash
Raw Normal View History

2022-03-08 10:36:32 +01:00
#!/bin/bash
2022-03-31 22:14:11 +02:00
POVOPT=" -d +q9 +a +W1280 +H1024 -v +WT2"
PASS=999
2022-03-08 10:36:32 +01:00
ERR="/tmp/pov.error"
2022-03-18 23:36:56 +01:00
POVINC="WS/pickover.inc"
2022-03-31 22:14:11 +02:00
TMPF="/dev/shm/pickover.png"
make pickover
if [ $? -ne 0 ] ; then
echo
echo "Make error " $?
exit 1
fi
2022-03-08 10:36:32 +01:00
2022-03-18 23:36:56 +01:00
./pickover foo.pgm | awk -f pick2pov.awk > $POVINC
2022-03-31 22:14:11 +02:00
# head $POVINC
2022-03-18 23:36:56 +01:00
for pass in $(seq 0 $(( PASS-1 )) )
2022-03-08 10:36:32 +01:00
do
dstname=$(printf "frames/pick3d/%05d.png" $pass)
echo $dstname
povray -ipick3d.pov -K${pass} \
Declare=NBPASS=${PASS} \
2022-03-31 22:14:11 +02:00
$POVOPT -O${TMPF} 2> $ERR
2022-03-08 10:36:32 +01:00
if [ $? -ne 0 ]
then
2022-03-31 22:14:11 +02:00
tail -20 $ERR
2022-03-08 10:36:32 +01:00
exit
fi
2022-03-31 22:14:11 +02:00
convert ${TMPF} \
-fill Gray50 \
-gravity South-West \
-pointsize 24 \
-annotate +20+10 "tTh" \
$dstname
2022-03-08 10:36:32 +01:00
2022-03-31 22:14:11 +02:00
sleep 10
2022-03-08 10:36:32 +01:00
2022-03-31 22:14:11 +02:00
done
2022-03-08 10:36:32 +01:00
ffmpeg -nostdin \
-loglevel warning \
-y -r 25 -f image2 -i frames/pick3d/%05d.png \
-metadata artist='---[ tTh ]---' \
-c:v libx264 -pix_fmt yuv420p \
pick3d.mp4