Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hardware accelerated video decoding #202

Open
totaam opened this issue Nov 1, 2012 · 5 comments
Open

hardware accelerated video decoding #202

totaam opened this issue Nov 1, 2012 · 5 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Nov 1, 2012

Following #147, we should go one step further and offload x264 video decoding to the graphics card using VAAPI / libva

Some pointers:

Why VAAPI? (lwn.net) Because this is the most widely compatible/available API, with glue libraries available for both vdpau (nvidia) and xvba (ati).
If really needed we could also talk to those directly, but that is best avoided.

@totaam
Copy link
Collaborator Author

totaam commented Nov 1, 2012

2012-11-01 09:30:44: ahuillet commented


I don't think we should be using VAAPI directly for video decoding acceleration. libav is a pain, but it has a VAAPI backend, and it will probably be better to use it. Rationale: we'll need video decoding acceleration on Windows (possibly even more than on Linux). We'll want to do it through libva as well.

@totaam
Copy link
Collaborator Author

totaam commented Nov 1, 2012

decoding example

@totaam
Copy link
Collaborator Author

totaam commented Jun 17, 2013

For DXVA see #346

@totaam
Copy link
Collaborator Author

totaam commented Jul 23, 2017

From the comments section on VA-API Video Acceleration On The Linux Desktop Is Nearly Ready For Chrome:

  • Then there's the ability to output hardware decoded video to an X11 window or a pixmap, Radeon VAAPI does have that, but this is good mainly for direct display (like a dedicated video player), not for integration into a complex UI that is a web page. It's also tied to X, obviously, so not ideal also from this perspective.
  • If you want to use the opengl video output with hardware decoding on Radeon, VDPAU is probably the better option.

@totaam
Copy link
Collaborator Author

totaam commented Jun 17, 2020

Now that encoding via vaapi works (#451), can we use the same solution here? (no)

The data we feed into the decoder is relatively small (so no problem uploading it to the GPU), but the decoded data is big (full size pixel frames) and so it's a waste if we have to download it to CPU memory only to re-upload to the GPU for rendering on screen.
It probably negates most of the savings from decoding on the GPU - the server usually selects fast presets which aren't very taxing for a CPU software decoder.
Then there's also the extra decoder complexity (except on macos with h264_vda which is a drop in replacement for h264?) and usual hardware flakiness (lack of hardware for testing, differences in drivers / OS, etc).

Staying on the GPU, as we do encoding side with nvfbc #1317, will require direct use of GPU buffers (dmabuf / pixmaps on Linux, whatever else on other platforms).
This is harder, and will need to be done for each supported platform separately. PITA.

This is looking unlikely for 4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant