-
Notifications
You must be signed in to change notification settings - Fork 50
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
Comments
From a little more digging it looks like what is actually missing is the ability to call |
@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. |
I'm really looking to add this to |
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 If it doesn't work then it building a full c version is probably the only way. |
I'll be honest, until I understand properly how it should work it's hard to come up with the best API for |
The only code I could find related to it is this: https://github.com/search?q=avfilter_get_by_name%28%22scale_vaapi%22%29+avfilter_get_by_name%28%22scale_cuda%22%29&type=code |
FYI I've added the following in
I've also transformed the Could you
|
@Tryanks @voxeljorge did you have time to check the |
I've been busy with recent affairs, so I haven't had the time to try out this new feature I've been looking forward to. I will submit the test results on CUDA soon, if I have time, because it's not an easy task to immediately clean up my WSL environment and resolve the 7.0 compilation (with CUDA adaptation). Additionally, could you provide an command example for |
Thanks! If you could first run Then you can try adding |
This comment was marked as outdated.
This comment was marked as outdated.
Why is it not working with |
This comment was marked as outdated.
This comment was marked as outdated.
I think the most important lines are
The rest is just a consequence of both of them. Can you confirm |
This comment was marked as outdated.
This comment was marked as outdated.
@Tryanks it may be linked to this issue. Could you try with |
You are right. In version I think manually adding In the //#cgo pkg-config: libpostproc
import "C" It finally compiled successfully.👍 |
Step 1: Run test command./hardware_decoding_filtering -i video.mp4 -c h264_cuvid -n 0 -t cuda It could through:
When this command is running, I noticed a slight change in the GPU Video Decode usage (0% → 2%) through hardware monitoring, so I believe it is indeed working. Step 2: Add filter./hardware_decoding_filtering -i video.mp4 -c h264_cuvid -n 0 -t cuda -f "scale_cuda=4096:2160" Not execute :(
Full outputs when enabled filter
|
🧠 ❤️ Unfortunately that's not something I can add in |
It indeed is working, thanks for testing this first use case! 👍 ❤️ |
OK that means I'll have to tweak a little bit how buffersrc and buffersink are initialized 👍 Thanks again for testing all this ❤️ I'll let you know when I have a fix |
Step 2: Add filterCould you try again with |
still got this:
Full outputs when enabled filter in new version
|
Thanks for the quick reply 👍 Could you fetch the |
Outputs with new branch
|
Damn that's really weird 🤔 Can you fetch the last changes on the branch (I've force pushed) and paste the outputs here? (it should succeed but in fact no filtering is done, I'm trying to understand if we get a valid |
I have plenty of time to help you test this issue. Please feel free to let me know if there's anything you need me to do :) It outputted 'success'! Does this mean it finally ran successfully? Outputs
|
❤️
Unfortunately no, I've disabled filtering in order to get more logs. Could you fetch the last changes in the branch and paste the output? |
Outputs
|
FYI, I have created a script and a Docker container that automates pulling the To prevent misuse, the final step is still done manually. |
🧠 |
@Tryanks could you try again? Now if "success" is printed, it should mean it really worked 👍 |
Outputs
|
Nice, I think it works 👍 Can you confirm you're seeing your GPU working for the filtering part? |
My GPU Video Decoder does indeed show a 1% usage fluctuation, similar to the performance observed when running the test command for Step 1. |
Great! I've merged the fix in I'll close this PR but thanks for all your help! ❤️ |
@Tryanks I've added the update of the hardware device context of filters in a filter graph in the hardware filtering example, would you be so kind as checking whether it still works properly? (with and without a filter flag) |
Step 1
Step 2
|
Thanks! ❤️ |
The
FilterContext
type is missing some accessors required to make it able to do hardware filtering with filters likescale_vaapi
The
transcode_vaapi.c
example in the ffmpeg repo covers the mechanism pretty well, I think something as simple as addingSetHardwareFrameContext
toFilterContext
might make this possible.The text was updated successfully, but these errors were encountered: