[Libav-user] Why is HTTP streaming so slow?
kalileo at universalx.net
Fri May 25 06:21:28 CEST 2012
On May 25, 2012, at 04:35 , Michael Bradshaw wrote:
> On Thu, May 24, 2012 at 2:05 PM, Andrey Utkin
> <andrey.krieger.utkin at gmail.com> wrote:
>>> Is there a particular reason FFmpeg streams so slowly?
>> Coz while you decode, you don't fetch, and while you fetch, you don't
>> decode. That's what switching overhead and lack of parallelism in your app
>> result in.
> Hmmm... that seems like it would make sense, but I just ran a simple
> test program that simply loops and calls av_read_frame() (no decoding)
> and I get the same results (uses <5% of the CPU, so it doesn't look
> like the network is waiting on the CPU). Here's what I've found (and
> these numbers seem pretty consistent on my machine):
There is no reason why FFMPEG would not stream fast enough. However, a lot depends on your code. If you run decoding and streaming in different threads there should be no reason why streaming would be slower than required.
You talk about passing the decoded frames to a separate encoder, then you talk about using FFMPEG for streaming over HTTP, I don't really see how that fits together.
More information about the Libav-user