I'm using ffmpeg libx264 to encode a 720p screen captured from x11 in realtime with a fps of 30.
when I use -tune zerolatency paramenter, the average encode time per-frame can be as large as 12ms with profile baseline.
After a study of the ffmpeg x264 source code, I found that the key parameter leading to such long encode time is sliced-threads which enabled by -tune zerolatency. After disabled using -x264-params sliced-threads=0 the encode time can be as low as 2ms
And with sliced-threads disabled, the CPU usage will be 40%, while only 20% when enabled.
Can someone explain the details about this sliced-thread? Especially in realtime encoding(assume no frame is buffered to be encoded. only encode when a frame is captured).
解决方案
The documentation shows that frame-based threading has better throughput than slice-based. It also notes that the latte