-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
hwdec: support videotoolbox with libplacebo #12776
Conversation
Download the artifacts for this pull request: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if hwdec_vt_pl
is supposed to work on ios or not. I'm guessing no and if so, you would need to change the checks a bit so that doesn't slip through.
I tried to address all comments except objective-c one (the check seems to be false for me?): @Dudemanguy, @rcombs, what do you think? |
That was what I had in mind except I'm not sure if
I don't think it's needed at all? The struct members are already guarded by |
Hmm, we need at least
Do you mean to keep the c or objective-c code? #if HAVE_VIDEOTOOLBOX_PL
void* mtl_texture_cache;
void* mtl_planes[MP_MAX_PLANES];
#endif but I can't build this one: #if HAVE_VIDEOTOOLBOX_PL
CVMetalTextureCacheRef mtl_texture_cache;
CVMetalTextureRef mtl_planes[MP_MAX_PLANES];
#endif
|
Sure cocoa sounds fine. No ideal about that particular error, but
I guess you need to include |
Rename hwdec_vt.c -> hwdec_vt.m ; hwdec_mac_gl.c -> hwdec_mac_gl.m and it should work.
Should do it. Perhaps it would also be nicer to define it in the same way as videotoolbox_gl.
|
Okay, let's use cocoa then.
That works, thank you!
Not sure about this. Should be a separate PR probably.
I agree, added too. Updated patch: https://github.com/m154k1/mpv/commit/b5c5ec92e9407c5490345f81c18c56d4fcbb7ba9 |
Does it not work without corevideo_metal? |
Well, it works. I just wasn't sure if it's available across different devices/OSes. But I guess it should be available everywhere since 10.15+ is required. Added here: https://github.com/m154k1/mpv/commit/4e03db3ae7bdba3ca41762b4677b6fea38c53cc2 |
f36910d
to
f38b5d9
Compare
Re-pushed. There's no support for vulkan on iOS currently (as there's no support for vulkan embedding anywhere yet, nor wid embedding on iOS), but this should work fine there once either of those things is added. |
f38b5d9
to
f726ecf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't speak for any of the mac specifics but LGTM from just a general overview.
f726ecf
to
4bd27fd
Compare
the technicalities of hwdec are not really my expertise, though the code looks fine and i checked that everything works like before (at least on macOS, can't check iOS). i also checked that the none-copy vt works as expected now with the macvk backend. LGTM and works as expected. think it would be good to get this merged before the next release, so we get some testing in with the new backend. any problems that might pop up can be fixed afterwards/with the release after the upcoming one. |
Hi @rcombs @Akemi , thanks for the feature, any indication on how to use it for iOS and macOS. so far what i tried, but i'm not sure what to pass on for wid option
Thanks |
wid embedding is atm not supported. libmpv usage was only recently fixed by me 3f2bc2e. so make sure to use a recent enough version. |
Thanks for your answer, So then how should we use it ? is there any sample or maybe can you provide quick guide on what should we do |
@byMohamedali did you manage to make it work in iOS or tvOS? maybe @Akemi can help, but right now i'm getting this assert: |
I did a few more tests and it works in iOS!! |
hey @andrefmsilva i was not able to make it work, if you can share the implementation it would be nice :) |
Yes, for me it's working in iOS (using the vo in #7857). You just need to use the code in that PR and make meson compile the file.
|
Thanks i will test and let you know for tvOS |
By the way have you test videos with subtitles ? is it working with this implementation ? |
No, I only did some basic tests in a sample app that I have. |
subtitle works in this implementation (this is a patch that works on latest git master) with the latest code, some of the old patch code may not be necessary test on iPad, gpu-next works too
|
Thanks @karelrooted , that is basically what i did to get it working. The image has quality? i only did some quick tests but the image was low quality. Tried to use another profile in MPV but it didn't work. Is it working for you in tvOS or do you get the same crash? |
@andrefmsilva for the low quality you need to set the drawableSize of the metalLayer to the size of the video you're reading. so for example for a 1920x1080
I tried in tvOS, i don't have a crash but a bluescreen is anyone of you has the same issue ? |
did you set contentsScale ?
without setting this property, 4k video works fine, 1080p video's quality will seems low
tvOS doesn't work too(compile with all latest git master), crash triggered when using vo=libmpv && vf=libplacebo when using vo=gpu/gpu-next , no crash is triggered, but mpv play video file with audio but no video , fulllog |
Thanks! Please keep me updated if you find new things about this. Maybe @karelrooted can create a PR with that patch so we can get "oficial" support for iOS The erros in tvOS is this one? |
the original PR is closed, mpv team must have other plan for this
error is similar, but not the same iOS and MacOS has another interesting bug when under vo=libmpv && vf=libplacebo , crash under Xcode debug mode, but works fine when run app normally without Xcode debug (it seems gpu-context=moltenvk will trigger the same debug mode bug too, but only triggerd occasionally , not like vf=libplacebo 's will surely triggered ,usually within 60 second) |
Relevant now that #7482 is merged. Also removes some code duplication between the macOS and iOS paths.