Skip to content

Instantly share code, notes, and snippets.

@ilyaevseev
Created October 18, 2018 12:13
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 ilyaevseev/fc75df36fe27f1ab580e6afb285b9ab7 to your computer and use it in GitHub Desktop.
Save ilyaevseev/fc75df36fe27f1ab580e6afb285b9ab7 to your computer and use it in GitHub Desktop.
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