Mark
/
celeste-ai
Archived
1
0
Fork 0

Added video script

master
Mark 2023-02-17 22:28:41 -08:00
parent 81ff731aaf
commit 2706a0af3f
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
1 changed files with 52 additions and 0 deletions

52
celeste/ffmpeg.sh Normal file
View File

@ -0,0 +1,52 @@
#!/bin/bash
SC_ROOT="screenshots"
OUTPUT_DIR="out/video"
render_dir () {
ffmpeg \
-y \
-loglevel quiet \
-framerate 30 \
-i $1/hackcel_%003d.png \
-c:v libx264 \
-pix_fmt yuv420p \
$OUTPUT_DIR/${1##*/}.mp4
}
mkdir -p $OUTPUT_DIR
echo "Making episode files..."
for D in $SC_ROOT/*; do
if [ -d "${D}" ]; then
render_dir $D
fi
done
echo "Done."
# Generate video for each run
for f in $OUTPUT_DIR/*.mp4; do
echo file \'$f\' >> merge_list;
done
# Merge videos
ffmpeg \
-loglevel quiet -stats -y \
-f concat \
-safe 0 \
-i merge_list \
-c copy \
$OUTPUT_DIR/00-all.mp4
rm merge_list
# Make accelerated video
ffmpeg \
-i $OUTPUT_DIR/00-all.mp4 -y \
-r 60 \
-filter:v "setpts=0.125*PTS" \
8x.mkv