GPU-accelerated video decoding
scalibq.wordpress.com
scalibq.wordpress.com
Implementation-wise though, I don’t think hardware decoders would use general purpose CPU cores under the hood (someone correct me if I’m wrong — been a long time since I’ve worked on this stuff), but would use dedicated fixed-function blocks. On hardware without a full fixed-function decode, I would think it would fall back to compute blocks with fixed-function blocks for acceleration. Some other implementations might make use of customized CPU cores like from Tensilica. General purpose CPU cores might instead be used for things like managing HDCP, etc.
The speedup on nvidia cards is amazing, both for the faster h.264 and h.265 (no experience with others). Note that nvidia cards to have two distinct limits: The number of hardware encoding engines on your card and the number of simultaneous streams they will allow. quadro / professional cards often have unlimited streams but similar numbers of encoders, so they are more flexible but not necessarily faster.
At least from my testing on pascal generation cards, simultaneous encodes are not faster than serial ones because the encoding speed is split. So if you're batching, go ahead and do it serially to keep things simpler.
If you're doing machine learning on video, there is a nifty library called "decord" which does gpu-accelerated decoding and zero-copy reading of frames to your dl framework. That can be nice, but remember that (1) your video samples may blow up the GPU ram if the file is too large and (2) keeping lots of video/frames on the GPU will limit the amount of memory available to your networks. In addition, it may actually be faster to do decoding on the CPU because you then use both a fast CPU and the GPU simultaneously. YMMV.
It sucks so bad that you need to Google tutorials and fiddle with command line settings, depending on your GPU and drivers (do you use VA-API, VDPAU, or NVDEC?) , just to get HW decode in browser working (if you even manage to), when this works out of the box even on $99 Chinese Android phones, which ironically, have Linux underneath.
Madness.
I would’ve thought simple RGB24 to be a more apt comparison in the context below:
With RGB32, you need 32 bits per pixel. With an YUV 4:2:0 format, for 4 pixels you need to store a total of 6 samples, so 6x8= 48 bits. That is effectively 48/4 = 12 bits per pixel, so only 37.5% of RGB32. That matters.