pixop / video-compare

Split screen video comparison tool using FFmpeg and SDL2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add ffmpeg vulkan support

tormento opened this issue · comments

There is vulkan implementation in some builds of ffmpeg.

Would be possible to decode video by hardware, thus accelerating the output?

Hi @tormento,

Thanks for sharing your idea!

Yes, it should be doable by lending some ideas and patterns from https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/hw_decode.c

I'm not going to work on this (there is a fair amount of work involved and I rarely need the extra performance boost), but I'm open to PRs.

In theory Vulkan decoding should be supported in the latest Windows build from what I can see (https://www.gyan.dev/ffmpeg/builds/). I don't have the drivers or hardware to test it myself, though.

Please see: #42 (comment)

I'm closing this for now. Let me know if it works for you.

@tormento: I've added support for HW accelerated decoding in today's release (this is separate from the decoder selection I did in July). You can now enable Vulkan decoding via --left-hwaccel vulkan and/or --right-hwaccel vulkan.

Thank you!

I think you should keep it as default, as I can't see a reason why not to.

Cheers!

Hardware acceleration with FFmpeg's libraries is a complex topic. Its effectiveness and compatibility depend on several factors, including the specific hardware, drivers, codec, and pixel format used. While CPU decoding offers a more universally compatible solution, hardware acceleration can provide significant performance benefits like you know.

If hardware acceleration via Vulkan GPU decoding works well in your specific setup, I recommend creating a shell alias or a .bat command for convenience when launching the tool. This approach allows you to leverage the benefits of GPU decoding while maintaining the fallback option of CPU decoding. However, I have no plans for making HW acceleration the default for now, as I aim to ensure the tool remains as universally compatible as possible.

What about a ,ini file?

That's fine for Windows, but it has to be done in a cross-platform fashion (https://github.com/Malvineous/cfgpath could be an option perhaps). I'm open to PRs.

Why? You can store settings in txt or xml file in Linux too. Enough that the program can read files in its own directory.

Adding XML parsing would likely require integrating a library (and I'm not a fan of the XML format in general). I'm keen to keep the tool's dependencies limited to SDL2 and FFmpeg libraries to maintain simplicity and reduce the potential for issues associated with additional dependencies.

Something like mpv's config file format (https://github.com/mpv-player/mpv/blob/master/etc/mpv.conf) would be a better option.

You had time to sort out some solution?

My fingers are getting old and painful to type all that switches ;)

Haha, sorry... I'm not working on this - a shell alias or script is still the quick fix for now. It should help ease the typing strain ;)