How is video playback done on a computer? It's obviously not relying purely on the CPU, since video playback continues when a user performs another activity, such as typing into a YouTube comment field. This task seems further complicated in the case of streaming video, where data presumably needs to be transferred from the network interface to the video/graphics controller.
EDIT: I should have made clear that I understand that the CPU switches among multiple processes and threads all of the time. My question was meant to be more specifically about video playback. Is the video processing done on the graphics chipset/card? Do those typically offer buffering? Or can it all be handled by a single-core CPU with time to spare for other tasks, or am I wrong to think that low-end CPUs can play back video without (not-network) delays?
Asked By : espertus
Answered By : user35945
A modern graphics card works more or less (somewhat) the same as a regular cpu.
On a graphics card, you will have (sometimes) multiple processors, each processor will have (sometimes) multiple multiprocessors, which each have multiple cores.
When a video is loaded into a graphics card it gets transcoded into the output buffer by a certain allocation of multiprocessor cores. This output buffer is generally globally accessible memory, which means that any core from any multiprocessor from at least one processor (but often all) has direct r/w access to it.
Usually one multiprocessor is limited to one instruction set, which means that a graphics card can only concurrently operate as many different "flavours" of threads as there are multiprocessors on the card. A "flavour" might for instance be a physics simulation, a video render, an OS render, or a cryptographic function. Naturally one multiprocessor can schedule multiple thread types to run intermittently, but this is usually not necessary.
Decoding a video is often a lot of work, considering how it's usually compressed and sometimes encrypted, so the displaybuffer isn't always busy. Thus it's relatively easy to render a mouse cursor traveling over a video frame. However, sometimes this doesn't quite work, and you will see how in some applications your cursor disappears. This is not necessarily because the application is "on top" of the os, but simply because it's hogging part of the output buffer.
Best Answer from StackOverflow
Question Source : http://cs.stackexchange.com/questions/29673
0 comments:
Post a Comment
Let us know your responses and feedback