2022-03-08 20:36:32 +11:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-04-01 07:14:11 +11:00
|
|
|
POVOPT=" -d +q9 +a +W1280 +H1024 -v +WT2"
|
|
|
|
PASS=999
|
2022-03-08 20:36:32 +11:00
|
|
|
ERR="/tmp/pov.error"
|
2022-03-19 09:36:56 +11:00
|
|
|
POVINC="WS/pickover.inc"
|
2022-04-01 07:14:11 +11:00
|
|
|
TMPF="/dev/shm/pickover.png"
|
|
|
|
|
|
|
|
make pickover
|
|
|
|
if [ $? -ne 0 ] ; then
|
|
|
|
echo
|
|
|
|
echo "Make error " $?
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-03-08 20:36:32 +11:00
|
|
|
|
2022-03-19 09:36:56 +11:00
|
|
|
./pickover foo.pgm | awk -f pick2pov.awk > $POVINC
|
2022-04-01 07:14:11 +11:00
|
|
|
# head $POVINC
|
2022-03-19 09:36:56 +11:00
|
|
|
|
|
|
|
for pass in $(seq 0 $(( PASS-1 )) )
|
2022-03-08 20:36:32 +11:00
|
|
|
do
|
|
|
|
|
|
|
|
dstname=$(printf "frames/pick3d/%05d.png" $pass)
|
|
|
|
echo $dstname
|
|
|
|
|
|
|
|
povray -ipick3d.pov -K${pass} \
|
|
|
|
Declare=NBPASS=${PASS} \
|
2022-04-01 07:14:11 +11:00
|
|
|
$POVOPT -O${TMPF} 2> $ERR
|
2022-03-08 20:36:32 +11:00
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
2022-04-01 07:14:11 +11:00
|
|
|
tail -20 $ERR
|
2022-03-08 20:36:32 +11:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2022-04-01 07:14:11 +11:00
|
|
|
convert ${TMPF} \
|
|
|
|
-fill Gray50 \
|
|
|
|
-gravity South-West \
|
|
|
|
-pointsize 24 \
|
|
|
|
-annotate +20+10 "tTh" \
|
|
|
|
$dstname
|
2022-03-08 20:36:32 +11:00
|
|
|
|
2022-04-01 07:14:11 +11:00
|
|
|
sleep 10
|
2022-03-08 20:36:32 +11:00
|
|
|
|
2022-04-01 07:14:11 +11:00
|
|
|
done
|
2022-03-08 20:36:32 +11: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
|