Added video script
parent
81ff731aaf
commit
2706a0af3f
|
@ -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
|
||||
|
||||
|
Reference in New Issue