When I upload video to YouTube it has to go through the process of uploading the source then has to be processed before it's viewable.

How does it work when you see something livecast on YouTube? Even assuming a screaming fast upload connection, how is it made viewable so quickly at 1080 or even higher resolution? I get that it's not really "live", there's some lag but that's still really fast for it to be processed and made viewable.

Thanks.