Run on dedicated hardware

This commit is contained in:
Matt McWilliams 2021-11-26 22:01:07 -05:00
parent 911d6e2108
commit 8f92cc1787
2 changed files with 32 additions and 10 deletions

22
seq.sh
View File

@ -8,23 +8,41 @@
########################### ###########################
MULTIPLE=2 MULTIPLE=2
RATE=`echo "scale=0;24/${MULTIPLE}" | bc` FPS=24
RATE=`echo "scale=0;${FPS}/${MULTIPLE}" | bc`
TIMESTR=""
INPUT="${1}" INPUT="${1}"
OUTPUT="${2}" OUTPUT="${2}"
INVERT="${3}" INVERT="${3}"
START_FRAME=${4}
END_FRAME=${5}
WIDTH=323 WIDTH=323
HEIGHT=242 HEIGHT=242
if [[ "${INVERT}" != "" ]]; then if [[ "${INVERT}" != "" ]] && [[ "${INVERT}" == "negative" ]]; then
INVERT="negate," INVERT="negate,"
else
INVERT=""
fi
if [[ "${START_FRAME}" != "" ]]; then
START=`echo "scale=6;${START_FRAME}/${FPS}" | bc`
TIMESTR="${TIMESTR} -ss ${START}"
fi
if [[ "${END_FRAME}" != "" ]]; then
TIME=`echo "scale=6;(${END_FRAME}-${START_FRAME})/${FPS}" | bc`
TIMESTR="${TIMESTR} -t ${TIME}"
fi fi
mkdir -p "${OUTPUT}" mkdir -p "${OUTPUT}"
ffmpeg -y -re -i "${INPUT}" \ ffmpeg -y -re -i "${INPUT}" \
${TIMESTR} \
-f image2 \ -f image2 \
-r ${RATE} \ -r ${RATE} \
-vf ${INVERT}crop=in_h/3*4:in_h,scale=$WIDTH:$HEIGHT,setsar=1:1 \ -vf ${INVERT}crop=in_h/3*4:in_h,scale=$WIDTH:$HEIGHT,setsar=1:1 \
-q:v 1 -qmin 1 -qmax 1 \
"${OUTPUT}/image_%06d.png" "${OUTPUT}/image_%06d.png"

View File

@ -27,14 +27,17 @@ mkdir -p "${OUTPUT}"
FRAMERATE=12 FRAMERATE=12
WIDTH=404 WIDTH=404
HEIGHT=374 HEIGHT=374
DOTSIZE=4 DOTSIZE=5
MAXGENERATIONS=25 MAXGENERATIONS=50
MAXPARTICLES=400 MAXPARTICLES=1000
MINDOTSIZE=0.8 MINDOTSIZE=0.3
LINE=0.8 LINE=0.3
FILL=true FILL=true
MODE="stipple" MODE="stipple" #stipple/tsp
INVERT="false"
if [[ "${INVERT}" == "" ]]; then
INVERT="false"
fi
IMAGES="" IMAGES=""
@ -69,12 +72,13 @@ for png in "${INPUT}/"*.png ; do
--mode $MODE \ --mode $MODE \
--invert $INVERT --invert $INVERT
if [[ "${INVERT}" != "" ]]; then if [[ "${INVERT}" != "false" ]]; then
convert "${OUTPUT}/${name}_rendered.png" -channel RGB -negate "${OUTPUT}/${name}_rendered.png" convert "${OUTPUT}/${name}_rendered.png" -channel RGB -negate "${OUTPUT}/${name}_rendered.png"
fi fi
rm "${tmp}" rm "${tmp}"
cd ~/src/animation/ cd ~/src/animation/
if [ "${MODE}" != "tsp" ]; then if [ "${MODE}" != "tsp" ]; then
opt=`mktemp`.svg opt=`mktemp`.svg
svgsort "${OUTPUT}/${name}.svg" "${opt}" svgsort "${OUTPUT}/${name}.svg" "${opt}"