From 015e2fe2262d01ec49fe6e96715581fbf100b7a3 Mon Sep 17 00:00:00 2001 From: mattmcw Date: Wed, 8 Dec 2021 17:27:00 -0500 Subject: [PATCH] Fix log.sh, stipple.sh and seq.sh --- log.sh | 8 +------- seq.sh | 4 ++-- stipple.sh | 33 ++++++++++++++------------------- 3 files changed, 17 insertions(+), 28 deletions(-) diff --git a/log.sh b/log.sh index a9d2094..7238b4f 100644 --- a/log.sh +++ b/log.sh @@ -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,\ diff --git a/seq.sh b/seq.sh index 6d0aeae..54901da 100644 --- a/seq.sh +++ b/seq.sh @@ -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} \ diff --git a/stipple.sh b/stipple.sh index 3d0e75f..e947966 100644 --- a/stipple.sh +++ b/stipple.sh @@ -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}"