filmout_manager/scripts/cli_video.sh

31 lines
633 B
Bash

#!/bin/bash
VIDEO="${1}"
EXPOSURE="${2}"
if [[ -z "${1}" ]]; then
echo "Please include path to video as the first argument"
exit 1
fi
if [[ -z "${2}" ]]; then
echo "Please include an exposure time in ms as the second argument"
exit 2
fi
TMPDIR=$(mktemp -d)
TMPFILE=$(mktemp)
#-vf fps=24
ffmpeg -hwaccel auto -i "${VIDEO}" -vf "scale=iw*sar:ih,setsar=1" -pix_fmt rgba "${TMPDIR}/frame-%08d.tif"
ls -1 "${TMPDIR}" | while IFS= read -r line; do
echo "RGB,${TMPDIR}/${line},${EXPOSURE}" >> "${TMPFILE}"
echo "D,100" >> "${TMPFILE}"
done
node dist/cli -i "${TMPFILE}"
#cat "${TMPFILE}"
rm -rf "${TMPDIR}"
rm -f "${TMPFILE}"