Fix log.sh, stipple.sh and seq.sh

This commit is contained in:
Matt McWilliams 2021-12-08 17:27:00 -05:00
parent 55a7d83854
commit 015e2fe226
3 changed files with 17 additions and 28 deletions

8
log.sh
View File

@ -21,12 +21,6 @@ xmax=$(echo "$bboxclean" | awk -F', ' '{print $2}')
ymin=$(echo "$bboxclean" | awk -F', ' '{print $3}')
ymax=$(echo "$bboxclean" | awk -F', ' '{print $4}')
if [[ "${pen}" != "" ]]; then
pen="'${pen}'"
else
pen=null
fi
query="INSERT OR IGNORE INTO svg (id, file, drawn, moved, starttime, endtime, pen, hash, paths, total, ratio, xmin, xmax, ymin, ymax) VALUES (\
'$id', \
'$file',\
@ -34,7 +28,7 @@ query="INSERT OR IGNORE INTO svg (id, file, drawn, moved, starttime, endtime, pe
$moved,\
$starttime,\
$endtime,\
$pen,\
'$pen',\
'$hash',\
$paths,\
$total,\

4
seq.sh
View File

@ -7,7 +7,7 @@
#
###########################
MULTIPLE=2
MULTIPLE=3
FPS=24
RATE=`echo "scale=0;${FPS}/${MULTIPLE}" | bc`
TIMESTR=""
@ -39,7 +39,7 @@ fi
mkdir -p "${OUTPUT}"
ffmpeg -y -re -i "${INPUT}" \
ffmpeg -y -re -r ${FPS} -i "${INPUT}" \
${TIMESTR} \
-f image2 \
-r ${RATE} \

View File

@ -15,7 +15,7 @@ fi
INPUT=`realpath "${1}"`
OUTPUT=`realpath "${2}"`
INVERT="${3}"
CONFIG="${3}"
SINGLE="${4}"
if [ ! -d "${INPUT}" ]; then
@ -25,7 +25,10 @@ fi
mkdir -p "${OUTPUT}"
FRAMERATE=12
MULTIPLE=3
FPS=24
RATE=`echo "scale=0;${FPS}/${MULTIPLE}" | bc`
WIDTH=404
HEIGHT=374
DOTSIZE=2
@ -36,8 +39,9 @@ LINE=1.5
FILL=true
MODE="stipple" #stipple/tsp
if [[ "${INVERT}" == "" ]]; then
INVERT="false"
if [[ "${CONFIG}" == "" ]]; then
echo "Please provide a config file"
exit 1
fi
IMAGES=""
@ -52,26 +56,16 @@ stipple () {
bash white.sh "${png}" "${tmp}"
source "${CONFIG}"
cd ~/src/stipple_gen/
bash stipple_gen.sh \
--display "false" \
--inputImage "${tmp}" \
--outputImage "${OUTPUT}/${name}_rendered.png" \
--outputSVG "${OUTPUT}/${name}.svg" \
--canvasWidth $WIDTH \
--canvasHeight $HEIGHT \
--dotSizeFactor $DOTSIZE \
--windowWidth $WIDTH \
--windowHeight $HEIGHT \
--maxGenerations $MAXGENERATIONS \
--minDotSize $MINDOTSIZE \
--line $LINE \
--fill $FILL \
--maxParticles $MAXPARTICLES \
--mode $MODE \
--invert $INVERT
--config "${CONFIG}"
if [[ "${INVERT}" != "false" ]]; then
if [[ "${invert}" == "true" ]]; then
convert "${OUTPUT}/${name}_rendered.png" -channel RGB -negate "${OUTPUT}/${name}_rendered.png"
fi
@ -113,6 +107,7 @@ if [[ "${IMAGES}" == "" ]]; then
VIDEO="${OUTPUT}/${part}.mov"
fi
ffmpeg -y -r ${FRAMERATE} -f image2 -i "${IMAGES}" \
ffmpeg -y -r ${RATE} -f image2 -i "${IMAGES}" \
-r ${FPS} \
-c:v prores_ks -profile:v 3 \
"${VIDEO}"