Step 1: install cuda & nvenc
e.g. emerge nvidia-cuda-sdk
git clone git://github.com/libav/libav
cd libav
./configure --enable-nvenc --extra-cflags="-I/path/to/cuda/include -I/path/to/nvenc/include"
make -j 18
cat test.sh
for a in `seq 1 $1`; do
./avconv -nostats -t 60 -filter_complex testsrc=hd720 -c:v $2 -f null - &
done
wait
time bash test.sh 10 nvenc_h264 2>/dev/null
real 0m34.799s
user 0m22.281s
sys 0m2.012s
time bash test.sh 20 nvenc_h264 2>/dev/null
real 1m28.207s
user 3m58.867s
sys 0m18.647s
40 concurrent instances sometimes do fail because the system goes out of video memory...
time bash test.sh 40 nvenc_h264 2>/dev/null
real 2m55.787s
user 8m20.173s
sys 0m46.804s