libopenshot icon indicating copy to clipboard operation
libopenshot copied to clipboard

Support AMD GPU acceleration

Open kspeakman opened this issue 10 months ago • 7 comments

Currently OpenShot only supports Nvidia/Intel GPU-accelerated encoding. I believe OpenShot uses FFmpeg which also supports *_amf codecs for AMD GPUs. So this issue is to request support for AMD GPU acceleration.

According to this table with more details in this section, these are the codecs supported for HW acceleration for AMD GPUs.

Options Decode Windows Decode Linux Encode
-hwaccel dxva2
-hwaccel d3d11va
VA-API
VDPAU
-c:v h264_amf
-c:v hevc_amf
-c:v av1_amf

kspeakman avatar Mar 12 '25 01:03 kspeakman

In my opinion, it's not that simple. I don’t think adding another hardware acceleration layer would improve performance much.

Right now, only the encoding step is hardware-accelerated. This happens after a frame has already been scaled or had effects applied—then it gets sent to the GPU for encoding. From what I’ve seen, applying effects takes up most of the rendering time. So you’d only see a real benefit if you’re using OpenShot just to combine clips without any effects or edits.

Instead, I’d recommend upgrading your RAM and switching to a CPU with more cores. Since libopenshot makes great use of multithreading, that should give you a much better performance boost with a cheaper price.

aperture147 avatar Jun 03 '25 04:06 aperture147

Encoding is the exact scenario I had in mind. It's much faster on the GPU vs CPU. AMD 9000 series improved encoder quality to be competitive with intel/nvidia. But just a suggestion. I understand if it's low priority.

kspeakman avatar Jun 03 '25 05:06 kspeakman

Encoding is the exact scenario I had in mind. It's much faster on the GPU vs CPU. AMD 9000 series improved encoder quality to be competitive with intel/nvidia. But just a suggestion. I understand if it's low priority.

Yeah... AFAIK all frame effects (like blur, chroma key) and modifications (like scaling, transposing) use CPU. To maximize the performance, all frame effects and modifications requires a refactor to take the advantages of GPU. One thing that I can think of is using a cross platform HW Accel API to rule them all, like Vulkan library. It's a story for another day.

Btw actually I'm just a contributor, not in the team 📃

aperture147 avatar Jun 03 '25 09:06 aperture147

Apologies, I didn't communicate clearly. My main interest was video export. If the encoder can be used for more than that, bonus.

kspeakman avatar Jun 03 '25 18:06 kspeakman

Hmm if you only need video transcoding (like h264 to h265 or h264 to av1), there are plenty of choices which could utilize GPU like Handbrake and pure FFMPEG CLI. Using a video editor just to export video is kinda overkill for the task and GPU encoding is prone to reduce image quality. In my experience using CPU encoding always achieve better image quality than GPU, at least with video_toolbox and h264_nvenc compare to libx264

Btw OpenShot only supports CBR, which is not storage efficient. If you want to transcode a video to be a smaller one then this might not be the factor you want.

aperture147 avatar Jun 04 '25 03:06 aperture147

The idea was I'm already editing video with OpenShot, so also using its export functionality seems like a natural transition. But yeah, handbrake could be a better option.

kspeakman avatar Jun 04 '25 17:06 kspeakman

Oh so you do need to edit video with OpenShot 👍 Currently Handbrake only supports transcoding, not video editing so this would not fit your need. If you still want an opensource video editing software, my best idea for this is upgrading the CPU, buy some more RAM, edit the video, export it with high bitrate and convert it to VBR with Handbrake of you need to reduce the video size. If you want a video editor with HW Acceleration, I guess we don't have any better choice beside buying a close-source software like DaVinci (the free version does not support GPU encoding), Premiere or Sony Vegas Pro and that's suck tbh. Hope you find the most suitable solution.

aperture147 avatar Jun 05 '25 05:06 aperture147