<p>Probably "-threads" option may help. Try this:</p>

<pre><code>ffmpeg -threads 6 -report ...
</code></pre>

<p>Add more thread as your CPU can handle.</p>

CC BY-SA 4.0
2020-06-16T12:54:22.413Z
I do use `threads` in the command. should I start with it?
TLM
CC BY-SA 4.0
2018-12-03T04:24:23.933Z
2018-12-03T04:24:23.933Z
Teocci
<p>I am trying to publish a stream of live video that need to get to the client side in under 3 sec in latency.</p>

<p>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:</p>

<pre><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/15.0.0.74)" -f flv rtmp://Url/StreamName.
</code></pre>

<p>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.</p>

<p><em>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.</em></p>

<h3>Question</h3>

<p>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.</p>

<p>Any ideas on that matter? Thanks in advance :)</p>

<ffmpeg><streaming><encoding><live><latency>
best way to publish low latency video on ffmpeg
TLM
# best way to publish low latency video on ffmpeg

(Asked by: username_0 on 2015-11-18)

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/15.0.0.74)" -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.
Question
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 :)

**Tags:** ffmpeg, streaming, encoding, live, latency


---

## 1 answers

### Answer by username_1 on 2018-12-03. Score: 0

Probably "-threads" option may help. Try this:
ffmpeg -threads 6 -report ...

Add more thread as your CPU can handle.

> **Comments:**
> **username_0**: I do use `threads` in the command. should I start with it?  

---

