23 lines
359 B
Bash
23 lines
359 B
Bash
#!/bin/bash
|
|
|
|
MULTIPLE=2
|
|
RATE=`echo "scale=0;24/${MULTIPLE}" | bc`
|
|
|
|
INPUT="${1}"
|
|
OUTPUT="${2}"
|
|
INVERT="${3}"
|
|
|
|
WIDTH=323
|
|
HEIGHT=242
|
|
|
|
if [[ "${INVERT}" != "" ]]; then
|
|
INVERT="negate,"
|
|
fi
|
|
|
|
mkdir -p "${OUTPUT}"
|
|
|
|
ffmpeg -y -re -i "${INPUT}" \
|
|
-f image2 \
|
|
-r ${RATE} \
|
|
-vf ${INVERT}crop=in_h/3*4:in_h,scale=$WIDTH:$HEIGHT,setsar=1:1 \
|
|
"${OUTPUT}/image_%06d.png" |