Improved ffmpeg script
parent
ab355475d5
commit
672d330b62
|
@ -1,10 +1,15 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
# Where screenshots are saved
|
# Where screenshots are saved
|
||||||
SC_ROOT="model_data/tau_small/screenshots"
|
SC_ROOT="model_data/current"
|
||||||
|
|
||||||
# WILL BE DELETED
|
# 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 () {
|
render_dir () {
|
||||||
ffmpeg \
|
ffmpeg \
|
||||||
|
@ -24,7 +29,7 @@ mkdir -p $OUTPUT_DIR
|
||||||
|
|
||||||
|
|
||||||
echo "Making episode files..."
|
echo "Making episode files..."
|
||||||
for D in $SC_ROOT/*; do
|
for D in $SC_ROOT/screenshots/*; do
|
||||||
if [ -d "${D}" ]; then
|
if [ -d "${D}" ]; then
|
||||||
render_dir $D
|
render_dir $D
|
||||||
fi
|
fi
|
||||||
|
@ -44,7 +49,7 @@ ffmpeg \
|
||||||
-f concat \
|
-f concat \
|
||||||
-safe 0 \
|
-safe 0 \
|
||||||
-i video_merge_list \
|
-i video_merge_list \
|
||||||
-c copy \
|
-vf "scale=1024x1024:flags=neighbor" \
|
||||||
$OUTPUT_DIR/00-all.mp4
|
$OUTPUT_DIR/00-all.mp4
|
||||||
|
|
||||||
rm video_merge_list
|
rm video_merge_list
|
||||||
|
@ -55,7 +60,7 @@ ffmpeg \
|
||||||
-i $OUTPUT_DIR/00-all.mp4 \
|
-i $OUTPUT_DIR/00-all.mp4 \
|
||||||
-framerate 60 \
|
-framerate 60 \
|
||||||
-filter:v "setpts=0.125*PTS" \
|
-filter:v "setpts=0.125*PTS" \
|
||||||
8x.mp4
|
$SC_ROOT/8x.mp4
|
||||||
|
|
||||||
echo "Cleaning up..."
|
echo "Cleaning up..."
|
||||||
rm -dr $OUTPUT_DIR
|
rm -dr $OUTPUT_DIR
|
||||||
|
|
Reference in New Issue