Last active
April 1, 2020 15:43
-
-
Save Luzifer/b1f86b43691996c12d6c6c81781f45cb to your computer and use it in GitHub Desktop.
Generate test-videos, black with white number, increases 1/frame
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 | |
set -euxo pipefail | |
FPS=(25 30) | |
CODEC=(libx264 nvenc_h264) | |
rm -f out*.mp4 | |
for n in $(seq -f '%03.0f' 0 999); do | |
[ -f "${n}.png" ] || convert \ | |
-size 1920x1080 \ | |
xc:black \ | |
-font 'DejaVu-Sans-Mono' \ | |
-pointsize 150 \ | |
-fill white \ | |
-gravity center \ | |
-draw "text 0,0 '${n}'" \ | |
"${n}.png" | |
done | |
for fps in "${FPS[@]}"; do | |
for codec in "${CODEC[@]}"; do | |
ffmpeg \ | |
-f lavfi \ | |
-i "anullsrc=channel_layout=stereo:sample_rate=44100" \ | |
-framerate ${fps} \ | |
-i %03d.png \ | |
-c:v ${codec} \ | |
-c:a aac \ | |
-filter_complex "fps=${fps},format=yuv420p,loop=loop=100:size=1000:start=0" \ | |
-g ${fps} \ | |
-t 00:10:00.000 \ | |
"out_${codec}_${fps}.mp4" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment