This commit is contained in:
Brooke Vibber 2023-03-25 21:36:14 -07:00
parent 5196adef43
commit a419685121
4 changed files with 65 additions and 3 deletions

62
video-bulk/atarifiy.sh Normal file
View file

@ -0,0 +1,62 @@
set -e
INFILE="$1"
# additional params can be input to the extraction
# for time or seek
shift
mkdir -p temp
ffmpeg \
-i "$INFILE" \
-r 60000/1001 \
-vf 'scale=256:-2' \
-an \
"$@" \
-y "temp/$INFILE-%04d.png"
ffmpeg \
-i "$INFILE" \
-vn \
-ac 1 \
-ar 15734 \
-acodec pcm_u8 \
"$@" \
-y "temp/$INFILE-audio.wav" || echo no audio
for frame in "temp/$INFILE-"[0-9][0-9][0-9][0-9].png
do
n="${frame#temp/$INFILE-}"
n="${n%.png}"
out="temp/$INFILE-dither-${n}"
last="${n:0-1}"
node ../dither-image.js "$frame" "$out" &
if (( last == 9 ))
then
echo "frame $n"
wait
fi
done
wait
if [ -f "temp/$INFILE-audio.wav" ]
then
ffmpeg \
-r 60000/1001 \
-i "temp/$INFILE-dither-%04d.png" \
-i "temp/$INFILE-audio.wav" \
-ac 2 \
-ar 48000 \
-vf 'pad=w=534' \
-pix_fmt yuv420p \
-movflags +faststart \
-y "$INFILE-dither.mp4"
else
ffmpeg \
-r 60000/1001 \
-i "temp/$INFILE-dither-%04d.png" \
-vf 'pad=w=534' \
-pix_fmt yuv420p \
-movflags +faststart \
-y "$INFILE-dither.mp4"
fi

View file

@ -4,7 +4,7 @@ mkdir -p frames
ffmpeg \ ffmpeg \
-i 'cats computer fun.mp4' \ -i 'cats computer fun.mp4' \
-vf 'scale=320:150,pad=h=192:y=5' \ -vf 'scale=256:144' \
-an \ -an \
-y 'frames/cats-%04d.png' -y 'frames/cats-%04d.png'

View file

@ -8,7 +8,7 @@ ffmpeg \
-i 'doom-speedrun.webm' \ -i 'doom-speedrun.webm' \
-t $TIME \ -t $TIME \
-r 60000/1001 \ -r 60000/1001 \
-vf 'scale=320:192' \ -vf 'scale=256:192' \
-an \ -an \
-y 'frames/doom-%04d.png' -y 'frames/doom-%04d.png'

View file

@ -4,7 +4,7 @@ mkdir -p frames
ffmpeg \ ffmpeg \
-i colamath-dv.avi \ -i colamath-dv.avi \
-vf 'yadif=1,scale=320:200,crop=h=192:y=4' \ -vf 'yadif=1,scale=256:192' \
-an \ -an \
-y 'frames/colamath-%04d.png' -y 'frames/colamath-%04d.png'