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

VAAPI filtering #112

Open
voxeljorge opened this issue Nov 25, 2024 · 5 comments
Open

VAAPI filtering #112

voxeljorge opened this issue Nov 25, 2024 · 5 comments

Comments

@voxeljorge
Copy link

The FilterContext type is missing some accessors required to make it able to do hardware filtering with filters like scale_vaapi

The transcode_vaapi.c example in the ffmpeg repo covers the mechanism pretty well, I think something as simple as adding SetHardwareFrameContext to FilterContext might make this possible.

@voxeljorge
Copy link
Author

From a little more digging it looks like what is actually missing is the ability to call av_buffersrc_parameters_set

https://github.com/FFmpeg/FFmpeg/blob/1402a2ac3ba59dfa0b5a1e82c180694104e9d677/fftools/ffmpeg_filter.c#L1727

@voxeljorge
Copy link
Author

@asticode I'm open to opening an PR adding this functionality but i'm not sure quite what shape you'd want the API to take. This buffer parameters type is an unusual one.

@asticode
Copy link
Owner

I'm really looking to add this to go-astiav but unfortunately until we find a proper example on how it really should work we're kind of in the dark 🤔 Did you find any such example in C? If not, would you be up to come up with a working C example first?

@voxeljorge
Copy link
Author

The fftools code is the only example I'm aware of.

To be honest I think in all likelihood adding access to this parameters API for buffersrc might be enough to do the job. Hardware decoding from your example already works and when hardware frames are passed to the filter there's an error that hw_frames_ctx must be set. I think it's worth adding this API and then testing to see if it works as that would be way less work than constructing a full c example.

If it doesn't work then it building a full c version is probably the only way.

@asticode
Copy link
Owner

I'll be honest, until I understand properly how it should work it's hard to come up with the best API for go-astiav 🤔 What do you think of making the changes as you see fit until everything works properly, then sharing your results here and we'll go from there for the PR?

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

No branches or pull requests

2 participants