Skip to content

Instantly share code, notes, and snippets.

@Luzifer
Last active April 1, 2020 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Luzifer/b1f86b43691996c12d6c6c81781f45cb to your computer and use it in GitHub Desktop.
Save Luzifer/b1f86b43691996c12d6c6c81781f45cb to your computer and use it in GitHub Desktop.
Generate test-videos, black with white number, increases 1/frame
#!/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