artyversary/record.sh

16 lines
476 B
Bash
Raw Normal View History

2021-08-15 19:28:42 +00:00
#!/bin/bash
set -e
if [[ -z $1 ]]; then
echo "plays the thingy and records it"
echo "example:"
echo -e "\t$0 packagename"
else
2021-08-24 18:41:36 +00:00
rm -rf "recordings/$1/frames"
2021-08-15 19:28:42 +00:00
cargo run --release --package $1 -- -record
2021-08-21 15:59:46 +00:00
filename="video$(( $(find recordings/$1/videos -type f -exec basename -s .mp4 {} \; | sed 's/^video//' | sort -n | tail -n1) + 1)).mp4"
ffmpeg -framerate 60 -i "recordings/$1/frames/%03d.png" -pix_fmt yuv420p "recordings/$1/videos/$filename"
2021-08-15 19:28:42 +00:00
echo "done"
fi