Help: Understanding server-side buffer for live dynamic streaming
Hi,
this is my first post but i hope you guys can help me out in any way.
Finding faults in my reasoning, or expanding the discussion further.
We are benchmarking FMS 3.5.x for live dynamic streaming and we have run across an issue.
When throttling the client from a high bandwidth (1500kbps) to a low bandwidth (325kbps) via a bandwidth shaper (a physical firewall) it takes a very long (real-) time for the client to see the new stream-quality.
During the investigation of this issue we have narrowed this down to:
1. when transition is requested from client, the client-side buffer is 1/2 i.e. 4-5seconds.
2. if transition is request on a client with unlimited bandwidth, it takes about 6 seconds for the server to process, find an acceptable switching position and send a "transition.complete" event.
3. on the throttled client however, this event takes much longer.
4. when really closely examining what happens between throttled request and throttled "transition.complete" it seems that the client is sent about 16 seconds of high-quality video before the low-quality is starting to download.
5. ofcourse, if the client has low-bw these 16 seconds may take 32-64 seconds to load!
6. Narrowing this issue down, it seems that these 16 seconds are built up like so: [REMAINING TO FILL CLIENT BUFFER TO DEFAULT 10s] + [TIME TO FIND KEYFRAME FOR SWITCHING POINT].
7. this in turn tells us that the server probably holds a certain amount of video in its own server-side cache. The size of this is at least 10 seconds.
8. when client stalls because of "buffer.empty", it expands the buffer to 30 seconds, meaning it lags 30 seconds behind "realtime".
9. when throttling a client with 30 seconds in the buffer, then un-throttling when the client is down to 5 seconds, the client is able to recover all of the 30 seconds in about 4-5 seconds.
10. this implies the sever-side buffer can hold up to 30 seconds of live video in some form of buffer/cache.
Our current questions:
11. It sounds illogical that the server-side buffer can be almost 30 seconds. Might this not be a network- or other buffer somewhere?
12. The "16" seconds of high-quality video that needs to be pushed out, wouldn't it be better that all of this video be discarded and replaced with lower quality? Our first thoughts were that this is how it works, but the testing says otherwise.
Please, this was a long post, but if you have ANY thoughts about ANY of the points, please leave a comment!
/Jonas
