Mark
/
celeste-ai
Archived
1
0
Fork 0

Improved ffmpeg script

master
Mark 2023-02-24 14:11:56 -08:00
parent ab355475d5
commit 672d330b62
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
1 changed files with 10 additions and 5 deletions

View File

@ -1,10 +1,15 @@
#!/bin/bash
# Where screenshots are saved
SC_ROOT="model_data/tau_small/screenshots"
SC_ROOT="model_data/current"
# WILL BE DELETED
OUTPUT_DIR="out/video_output"
OUTPUT_DIR="model_data/video_output"
# To make with fade in and out:
# ffmpeg -framerate 30 -i %03d.png -vf "scale=1024x1024:flags=neighbor,fade=in:0:45,fade=out:1040:45" out.webm
render_dir () {
ffmpeg \
@ -24,7 +29,7 @@ mkdir -p $OUTPUT_DIR
echo "Making episode files..."
for D in $SC_ROOT/*; do
for D in $SC_ROOT/screenshots/*; do
if [ -d "${D}" ]; then
render_dir $D
fi
@ -44,7 +49,7 @@ ffmpeg \
-f concat \
-safe 0 \
-i video_merge_list \
-c copy \
-vf "scale=1024x1024:flags=neighbor" \
$OUTPUT_DIR/00-all.mp4
rm video_merge_list
@ -55,7 +60,7 @@ ffmpeg \
-i $OUTPUT_DIR/00-all.mp4 \
-framerate 60 \
-filter:v "setpts=0.125*PTS" \
8x.mp4
$SC_ROOT/8x.mp4
echo "Cleaning up..."
rm -dr $OUTPUT_DIR