Created
October 5, 2022 10:49
-
-
Save issess/9a31892c73cf09a1e78d8bfd7f963745 to your computer and use it in GitHub Desktop.
test video generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
START_COUNT=0 | |
END_COUNT=2000 | |
SIZEs=( 400x400 1920x1080 ) | |
FPSs=( 30 60 75 90 120) | |
FONT_SIZE=150 | |
for size in "${SIZEs[@]}" | |
do | |
for fps in "${FPSs[@]}" | |
do | |
echo "create $fps fps, $size image..." | |
mkdir -p "${fps}_${size}" | |
for ((i=START_COUNT; i<=END_COUNT; i++)); do | |
echo -ne "generate ... ${i}\r" | |
convert -size $size xc:White -gravity Center -pointsize $FONT_SIZE -font DejaVu-Sans-Mono -annotate 0 "$i" -gravity North -pointsize 30 -annotate 1 "${fps} FPS, ${size}" ${fps}_${size}/$(printf '%04d' $i).png | |
done | |
echo "create ${fps} FPS video..." | |
ffmpeg -y -framerate $fps -pattern_type glob -i "${fps}_${size}/*.png" -c:v libx264 -vf format=yuv420p "${fps}fps_${size}.mp4" | |
echo "${fps}fps_${size}.mp4 done" | |
rm -rf "${fps}_${size}" | |
done | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment