From b54cf8ec69a922ab608a4666a0398a775c39791b Mon Sep 17 00:00:00 2001 From: Brooke Vibber Date: Fri, 30 Aug 2024 19:34:55 -0700 Subject: [PATCH] wip --- video-rickroll/combine.sh | 10 ++++++++++ video-rickroll/extract.sh | 17 +++++++++++++++++ video-rickroll/video.sh | 15 +++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 video-rickroll/combine.sh create mode 100644 video-rickroll/extract.sh create mode 100644 video-rickroll/video.sh diff --git a/video-rickroll/combine.sh b/video-rickroll/combine.sh new file mode 100644 index 0000000..3c833f3 --- /dev/null +++ b/video-rickroll/combine.sh @@ -0,0 +1,10 @@ +ffmpeg \ + -r 60000/1001 \ + -i 'frames/dither-%04d.png' \ + -i 'rickroll-audio.wav' \ + -ac 2 \ + -ar 48000 \ + -vf 'pad=w=534,setsar=9/10' \ + -pix_fmt yuv420p \ + -movflags +faststart \ + -y rickroll-dither.mp4 diff --git a/video-rickroll/extract.sh b/video-rickroll/extract.sh new file mode 100644 index 0000000..115bb1e --- /dev/null +++ b/video-rickroll/extract.sh @@ -0,0 +1,17 @@ +set -a + +mkdir -p frames + +ffmpeg \ + -i rickclip.mp4 \ + -vf 'scale=320:192,framerate=60000/1001' \ + -an \ + -y 'frames/rickroll-%04d.png' + +ffmpeg \ + -i rickclip.mp4 \ + -vn \ + -ac 1 \ + -ar 15734 \ + -acodec pcm_u8 \ + -y 'rickroll-audio.wav' diff --git a/video-rickroll/video.sh b/video-rickroll/video.sh new file mode 100644 index 0000000..4553490 --- /dev/null +++ b/video-rickroll/video.sh @@ -0,0 +1,15 @@ +set -e + +for frame in frames/rickroll-[0-9][0-9][0-9][0-9].png +do + n="${frame#frames/rickroll-}" + 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