From e5adb72851d82d08fddbfb05f9fdffc2edf06f52 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 25 Mar 2023 18:28:00 -0700 Subject: [PATCH] wip cats --- video-cat/combine.sh | 10 ++++++++++ video-cat/extract.sh | 17 +++++++++++++++++ video-cat/video.sh | 15 +++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 video-cat/combine.sh create mode 100644 video-cat/extract.sh create mode 100644 video-cat/video.sh diff --git a/video-cat/combine.sh b/video-cat/combine.sh new file mode 100644 index 0000000..e6a86bf --- /dev/null +++ b/video-cat/combine.sh @@ -0,0 +1,10 @@ +ffmpeg \ + -r 60000/1001 \ + -i 'frames/dither-%04d.png' \ + -i 'cats-audio.wav' \ + -ac 2 \ + -ar 48000 \ + -vf 'pad=w=640:h=360:x=52:y=20' \ + -pix_fmt yuv420p \ + -movflags +faststart \ + -y cats-dither.mp4 diff --git a/video-cat/extract.sh b/video-cat/extract.sh new file mode 100644 index 0000000..9c15aa4 --- /dev/null +++ b/video-cat/extract.sh @@ -0,0 +1,17 @@ +set -a + +mkdir -p frames + +ffmpeg \ + -i 'cats computer fun.mp4' \ + -vf 'scale=160:150,pad=h=160:y=5' \ + -an \ + -y 'frames/cats-%04d.png' + +ffmpeg \ + -i 'cats computer fun.mp4' \ + -vn \ + -ac 1 \ + -ar 15734 \ + -acodec pcm_u8 \ + -y 'cats-audio.wav' diff --git a/video-cat/video.sh b/video-cat/video.sh new file mode 100644 index 0000000..105fc48 --- /dev/null +++ b/video-cat/video.sh @@ -0,0 +1,15 @@ +set -e + +for frame in frames/cats-[0-9][0-9][0-9][0-9].png +do + n="${frame#frames/cats-}" + n="${n%.png}" + out="frames/dither-${n}" + last="${n:0-1}" + node ../dither-image.js "$frame" "$out" & + if (( last == 9 )) + then + wait + fi +done +wait