[Libav-user] Real time camera IP RTSP H264

Renaud BOBIN renaud.bobin at subsea-tech.com
Tue Feb 10 10:46:59 CET 2015

That’s is why on MJPEG there is no latency ?

Frame N doesn’t depend on N-1 nor N+1 so  each thread is independent ?



De : libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] De la part de Robin Stevens
Envoyé : mardi 10 février 2015 10:33
À : This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter.
Objet : Re: [Libav-user] Real time camera IP RTSP H264


On Tuesday, February 10, 2015, Maziar Mehrabi <maziar.mehrabi at gmail.com> wrote:


I wonder why multithreading causes latency.

My understanding is that having concurrent threads should improve performance.

Is there any explanation for this?




Without any knowledge of the code in question: concurrency can increase overall throughput (for particular kinds of task) but increased latency is a common payoff.


Imagine each thread as a separate decoder with carefully controlled access to some common data/state. To fully decode the Nth frame probably requires at least a partial decode (possibly a complete decode) of the N-1 frame. Therefore although the decoding for the Nth frame may happen on a separate processor core, it's likely not truly independent of the other cores.


So if you have 4 threads, T4 is waiting on T3, which is waiting on T2 and on T1. Even though T1 may have finished frame 1, it probably can't fully decode frame 5 until 4 is available from T4...


But that's just my guess!

Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20150210/5364f4d9/attachment.html>

More information about the Libav-user mailing list