vnm/scripts/vid2vnm.sh

21 行
561 B
Bash
Raw パーマリンク 通常表示 履歴

2024-05-13 21:28:48 +09:00
#!/bin/sh
clear
input_video="$1"
rm result.vnm
## Convert video to PNG frames at 30 FPS
ffmpeg -r 30 -i "$input_video" frame-%04d.png
ls
## Process the frames into farbfeld format with ff2png
find -type f . -name "*.png" -exec cat {} | ff2png >> {}.ff \;
ls
## Process the farbfeld images to VNM images
find -type f . -name "*.png.ff" -exec ff2vnm {} {}.vnm \;
ls
## Extract audio from video to an 8000hz WAV file
ffmpeg -ar 8000 -ac 1 -i "$input_video" AUDIO.raw
cat *.vnm > result.vnm
echo "A" >> result.vnm
cat AUDIO.wav >> result.vnm
rm frame*
rm AUDIO.wav