Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Benchmark concurrent ffmpeg-nvenc instances.
#!/bin/sh
test $# = 1 || { echo "Usage: ${0##*/} num-loops"; exit 1; }
D="/tmp/${0##*/}"
F="$HOME/lord-inquisitor.mp4"
rm -rf "$D" || :
mkdir -p "$D"
T0=`date +%s`
for n in `seq 1 $1`; do
~/ffmpeg-build-static-binaries/bin/ffmpeg \
-hwaccel cuvid \
-c:v h264_cuvid \
-i "$F" \
-vf scale_npp=1280:720 \
-c:v h264_nvenc \
"$D/$n.mp4" >"$D/$n.log" 2>"$D/$n.err" &
done
wait
echo "Done. $1 loops elapsed $[$(date +%s) - $T0] seconds."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment