View Full Version : Explanatory animation about CBR and VBV


leoenc
20th August 2014, 11:52
Hi all,

This topic applies also to other MPEG codecs, but I believe since H.264 is the most common codec today, it should belong here.

Since I believe it is very important to understand how buffer works when doing encoding for streaming, and since I couldn't find a clear visual explanation for this, I decided to try and make one myself.
Here's my first quick animation draft to try and explain it using the leaky bucket analogy:
https://vimeo.com/103891217

Your feedback please!
Do you think it's doing a good job explaining this or does it totally suck? :)
Did I get anything wrong?

Leo

LoRd_MuldeR
21st August 2014, 13:53
Nice anymation, though I'd probably do the analogy the other way around :)

If the bucket represents the buffer, it would be filled at a constant rate (VBV Maxrate, e.g. the network bandwidth) and, depending on the individual frame, different amounts of "water" need to be taken out of the bucket for each frame. VBV ensures we will always have enough "water" left in the bucket to satisfy the next frame. If that's not the case, i.e. we run dry, we have a buffer underflow.

(With your current analogy, the filling level of the bucket is the inverse of the decoder's video buffer's filling level)

nevcairiel
21st August 2014, 14:16
I guess it depends if you see it on the side of an encoder (ie. constant rate flowing out) or on the decoders side (constant rate flowing in).
It makes more sense to me this way around, because only the encoder actually has any control about the flow into the bucket.

LoRd_MuldeR
21st August 2014, 14:48
I guess it depends if you see it on the side of an encoder (ie. constant rate flowing out) or on the decoders side (constant rate flowing in).

You a right. I was thinking more about what is happening at playback time, so looking at it from the decoder side. Both perspectives are equally valid. But I think the animation should at least make clear from which side we are looking at it.

(Or maybe, for a more complete picture of the whole streaming process, the "outlet" of his current bucket could lead to a pipe, leading to another bucket of same size, representing the decoder buffer)

poisondeathray
21st August 2014, 15:21
Just curious, What did you use for the fluid simulation ?

leoenc
21st August 2014, 16:19
@LoRd_MuldeR, @nevcairiel - Thanks for your feedback! Didn't think about showing the decoder as well. You're right - I will make it more clear that it's about the encoding.

@poisondeathray - I own a copy of Softimage (using ICE). It's just a really quick simulation though, without fine-tuning the fluid properties, which obviously doesn't look real.