I am trying to publish a stream of live video that need to get to the client side in under 3 sec in latency.
I am using vMix to capture a 720p/50 stream from a camera, that by virtual camera letting FFmpeg to encode the stream into h.264 720/25 stream using this code:
ffmpeg.exe -report -rtbufsize 256M -f dshow -i "video=vMix Video:audio=vMix Audio" -codec:v libx264 -s:v 1280x720 -pix_fmt:v yuv420p -threads 4 -bufsize:v 2000k -g:v 24 -preset:v veryfast -profile:v main -level:v 3.1 -b:v 2000k -minrate:v 2000k -maxrate:v 2000k -codec:a libfaac -b:a 64k -strict -2 -rtmp_flashver "FMLE/3.0 (compatible; vMix/220.127.116.11)" -f flv rtmp://Url/StreamName.
The stream goes through a Wowza transrating to three qualities, and than to a CDN, than to the client. Right now, with a buffer on the client player on 0.8 sec, i get just about under 3 sec but with a choppy frame rate.
I am using a HP Z440 QC E5-1620v3 workstation and I see that there is a lot of CPU power that I am not currently using. I have also a K620 Graphic card, but as i understand there is no use for it currently with FFmpeg.
How can I utilize my CPU more than I do in order to get a faster encoding using FFmpeg? I know I can set a preset "Ultrafast", but I am concerned it will effect the quality too much. My idea is to get the latency faster in order to be able to enlarge the client player's buffer so it will be able to handle the stream.
Any ideas on that matter? Thanks in advance :)