Hardware video acceleration

With certain newer, more powerful graphics boards and newer device drivers, there is the potential for enhanced decode and encode performance. Decode refers to loading and playing video in CINELERRA-GG. The GPU, Graphics Processing Unit, on the graphics board is accessed via one of the following libraries: vdpau or vaapi. The hardware acceleration done by the graphics card increases performance by activating certain functions in connection with a few of the FFmpeg decoders. This use makes it possible for the graphics card to decode video, thus offloading the CPU.

NOTE: Hardware acceleration in Linux is constantly evolving and causes numerous problems (but if it doesn't work, it automatically reverts in CINELERRA-GG to software mode with the CPU). It depends on the generation and brand of the video card; on proprietary or open source drivers and on mesa user space drivers. Drivers change constantly, especially with the succession of new graphics card models, and what worked before may no longer work afterwards, or vice versa. Furthermore, being able to take advantage of hardware acceleration could mean having to compile CINELERRA-GG yourself by activating specific flags that are necessary (for example: having hardware acceleration in decoding and encoding the ffv1 codec requires compiling with the libplacebo library). Another case is having to start the program with environment variables (for example, for older AMD cards, before RDNA, use RADV_PERFTEST="video_decode,video_encode" to get hardware acceleration via Vulkan. Or use ANV_DEBUG="video-decode,
video-encode"
for acceleration via Intel, etc.). It should also be noted that sometimes software decoding can be more efficient than hardware acceleration. You need to experiment to see what works best for your use case.

Decode operations are described here next. They are located in: Settings Preferences... Tab Performance Use HW Device.

Encode refers to rendering video and is described at the end of this section under GPU hardware encoding.

VDPAU, Video Decode and Presentation API for Unix, is an open source library to offload portions of the video decoding process and video post-processing to the GPU of graphics boards, such as Nvidia. It may also apply to Nouveau and Amdgpu boards (by wrapper), but that has not been verified.

VA-API, Video Acceleration API, is an open source library which provides both hardware accelerated video encoding and decoding for use mostly with Intel (and AMD) graphics boards.

VULKAN (experimental) Vulkan, like OpenGL and unlike Vdpau and Vaapi, is hardware agnostic and could work for any type and brand of video card. Vulkan is direct GPU access, with better performance, efficient multithreading, and reduced driver overhead compared to the older OpenGL standard, It emulates OpenGL functionality. Vulkan requires initialization of its device type. This is done automatically by CINELERRA-GG for decoding but still needs to be made explicit in the encoding presets. (CIN_HW_DEV=vulkan).

AppImage will probably not allow for either VDPAU or VA-API hardware acceleration because the computer where AppImage is created will not have the same graphics card and/or vaapi/vdpau libraries as yours. It is recommended for best results that you build CINELERRA-GG on your specific computer as described in 1.3.2. So in summary:

Currently only the most common codecs, such as MPEG-1, MPEG-2, MPEG-4, H.264 /MPEG-4 and h265 (hevc), are accelerated/optimized by the graphics card to play these particular video formats efficiently. The other formats are not optimized so you will see no performance improvement since the CPU will handle them as before, just as if no hardware acceleration was activated. There are many different graphics cards and computer systems setup, so you will have to test which specific settings work best for you. So far this has been tested at least with Nvidia, Radeon, and Broadwell graphics boards on some AMD and Intel computers; depending on the graphics card, two to ten times higher processing speeds can be achieved. However, most graphic operations are single-threaded so that performing the operations in the hardware may actually be slower than in software making use of multiple CPUs, which frequently multi-thread many operations simultaneously.



Subsections
The CINELERRA-GG Community, 2021
https://www.cinelerra-gg.org