2021-08-10 22:07:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-09-09 00:53:32 +00:00
|
|
|
MULTIPLE=2
|
|
|
|
RATE=`echo "scale=0;24/${MULTIPLE}" | bc`
|
|
|
|
|
2021-08-10 22:07:38 +00:00
|
|
|
INPUT="${1}"
|
|
|
|
OUTPUT="${2}"
|
2021-09-09 00:53:32 +00:00
|
|
|
INVERT="${3}"
|
2021-08-10 22:07:38 +00:00
|
|
|
|
|
|
|
WIDTH=323
|
|
|
|
HEIGHT=242
|
|
|
|
|
2021-09-09 00:53:32 +00:00
|
|
|
if [[ "${INVERT}" != "" ]]; then
|
|
|
|
INVERT="-vf negate"
|
|
|
|
fi
|
|
|
|
|
2021-08-10 22:07:38 +00:00
|
|
|
mkdir -p "${OUTPUT}"
|
|
|
|
|
|
|
|
ffmpeg -re -i "${INPUT}" \
|
|
|
|
-f image2 \
|
2021-09-09 00:53:32 +00:00
|
|
|
-r ${RATE} \
|
|
|
|
"${INVERT}" \
|
2021-08-10 22:07:38 +00:00
|
|
|
-vf crop=in_h/3*4:in_h,scale=$WIDTH:$HEIGHT,setsar=1:1 \
|
|
|
|
"${OUTPUT}/image_%06d.png"
|