-
Notifications
You must be signed in to change notification settings - Fork 672
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
Support YUV 4:4:4 streaming #1282
Conversation
cea3332
to
b95eb0a
Compare
@cgutman I probably can't do more on moonlight side (moonlight-common-c included) without feedback. Format selection logic appears overcomplicated to me, so I've probably missed some corner cases, and you might prefer to do some things differently altogether. Also if you prefer, you can simply take this over after 5.1 is released, this may prevent the needless back-and-forth. |
|
Hi @ns6089, this development is planned to be developed on moonlight-android? |
Not anytime soon, no hardware support. |
16e80a7
to
6b27398
Compare
|
Keep it up! Looking forward to the success of YUV444!! For high-end computer users and those with WiFi 6 or above, we hope for higher bitrate requests and better picture encoding and transmission. |
I have obtained the version you uploaded on AppVeyor, and I know that this requires support for synchronous encoding by Sunshine, which is not currently in effect. What I want to point out is that when I enable the 444 button, my bitrate can only go up to 114mbps. If 444 is implemented, it shouldn't be limited to this range, right? |
|
@ns6089 Thank you for your work ! |
The repository with binary dependencies needs to be updated, I'm trying to get this sorted out. |
Can't be done before 6.0.1 hotfix goes live it seems. |
Even recovering v6 it doesn't build? |
If you're trying to build outside of CI on your own computer, this PR currently contains commits that revert binary deps to somewhat functional state. But you also need local vulkan headers, with %VULKAN_SDK% env variable pointing at them. installing SDK from https://vulkan.lunarg.com/sdk/home#windows should be enough. |
@ns6089 I've updated the binary deps, so this should be ready to land once you rebase and resolve the conflicts. |
@cgutman Great, I will get onto it. |
Rebased. Everything appears to be working including software decoding. |
Actually, no (something something gaslighting is not real). ANV driver seems to have support, while HASVK is stuck in a limbo. No idea about 4:4:4 though.
Yeah, windows driver at this moment seem to have this problem. Intel is actively working on this driver though. |
Yep, file fails to play. Log output from
I referred to @vadash's driver versions that produce a working example, and after doing a full clean reinstall of 537.58 after using DDU to clean my updated driver on my laptop, I can confirm that this is now fully working for me as well. This confirms that NVidia must have introduced a bug in their drivers. Thank you! |
hey guys, i'm eager to test this but it seems the api limit for downloading artifacts in appveyor was exceeded. can anyone share the appimage? or i can be patient and wait? |
Using this driver worked for me as well, but it did not work with HDR and 4:4:4 enabled at the same time. |
https://github.com/ns6089/moonlight-qt/releases/tag/pr1282 |
You're too kind, but would you happen to have the AppImage? Am on Linux. |
No, sorry. |
Needs to be software for AMD I believe. |
@Erfboom download limit reset: https://ci.appveyor.com/project/cgutman/moonlight-qt/builds/50226576/job/sf7l969npglkxddn/artifacts If you can't get it, I was able to download and can figure out how to share/send it |
I've added it to the same temporary release page https://github.com/ns6089/moonlight-qt/releases/tag/pr1282 |
Thanks guys, I was able to pull it from appveyor. Tests on AMD: works with software only. bitrate requirements go up. windows 11 with a 3080 and sunshine got wonky and i experienced hella latency. rebooting the machine fixed it. (may have helped color banding some :(, but still there). Things do look better though, sharper. can't do 4k@60 without hardware decoding. capped at 1440p@60 for stable frames, but with the bitrate lowered and no ability to change it, i started to see artifcating. Tests on Intel: lol. I don't know if my iGPU is too old (10th gen comet lake), and I admit i'm running it in a distrobox, but after some fiddling I got hardware decoding to be detected by moonlight. hw decoding works, but not with YUV4, says gpu doesn't support it. vdpauinfo backs that up, don't know how to read vainfo to tell if that's the case. software decoding allows 4:4:4, but i can't get in stream, don't know what I'm missing. This was all done using the AppImage, opensuse Aeon (tumbleweed distrobox) and opensuse tumbleweed plasma6. I can whip up a quick vm with an nvidia card to test moonlight there too, but i don't want to be heartbroken when i see that it works great on hw decoding. |
AMD lacks the support for native 4:4:4 on the hardware level. I will add a special "recombined" 4:4:4 mode a bit later, where full 4:4:4 data is spread across a larger 4:2:0 frame.
Intel does support 4:4:4 decoding on gen10 cpus and newer, so it's a driver issue. |
The latency I was talking about is definitely because my CPU can't decode that much data coming through on a higher bitrate, but I do definitely see a difference now between YUV4:4:4 and YUV4:2:0. Wish I could use it! I suspected it was a driver issue. Intel iGPUs are not in a good place in linux for media. They're fine for the most part but when you get into this stuff you can see the cracks. I tried VAAPI, so that explains it. I did notice Vulkan errors. Moonlight kept on trying to use GL. I'm not familiar with the Intel ANV driver, but maybe I can give that a shot :). Thanks for your hard work! This is really cool stuff. |
You need |
More tests. Test on Steamdeck: Crisp and clear with YUV4:4:4, with software decoding. can handle 1080p@60 just fine though and looks great! Wish i could figure out what filter gamescope / steam is using to add noise so i could turn it off. More Intel Tests: Software decoding works with or without ANV_Video_decode. After doing some digging, it looks like that's related to the new IRIS driver? If so, that only supports GEN11 and newer. I have the UHD driver for GEN10. A note on the HDR. On KDE6 Plasma, with an HDR monitor, moonlight could not properly match the inbound hdr colorspace to what the intel igpu could decode resulting in a crash. I believe that was related to libplacebo or mesa itself. This time around, the HDR button was able to be toggled without gamescope, on gnome (no hdr), probably because it's running in a distrobox and tonemapping was applied properly. Not sure what's going on there. |
It looks like the FFmpeg bug is being tracked upstream as https://trac.ffmpeg.org/ticket/10847 I'll merge this, but the Nvidia driver crash is probably a ship blocker until we can get a patch to address it (preferably upstreamed). |
@ns6089 Thanks for all your hard work on this! |
Hello all, using MoonlightPortable-x64-r2552 I can not use HW for decoding 4:4:4 despite having i5 11400T with HD 730 that should support 4:4:4 decode of H265. I can only get 4:4:4 stream from Sunshine https://github.com/LizardByte/Sunshine/actions/runs/10206571176 when using software decode in Moonlight. Maybe some issue with detection of HW decoder capabilities? |
It's because D3D11VA doesn't have YUV 4:4:4 support yet since Microsoft just updated the DXVA specification to support it and the Intel Windows driver seems to have broken Vulkan Video decoding support. The Intel drivers do support the new DXVA profiles for YUV 4:4:4 but it also requires support in FFmpeg to work. |
Actually it's the other way around. |
It's both. Modern Intel drivers expose the old Intel-specific profiles and the new Microsoft-defined official profiles. Unless FFmpeg is willing to accept Intel-specific profiles, I'm going to only support the official profiles which leaves out Ice Lake. |
I don't see why they wouldn't. It's not like they aren't already supporting proprietary extensions.. and presumably this is just a matter of trying an additional guid, if the official one fail? |
The two GUIDs correspond to different dxva structures (the bits are in different order, so it's not just as simple as switching GUIDs). Intel's dxva structure is dumped from the driver DDI and is not in any public documentation. Only Intel knows the details. Unless you want to hardcode it in FFmpeg instead of including the dx header files from Microsoft. |
It looks like the bitrate slider isn't working when YUV 4:4:4 is enabled. It calculates a default value, but changing the slider doesn't persist when you close the settings with the back arrow in the upper left and immediately reopen the menu. Since this is already merged, I created a bug report for this: #1387 |
Add support for YUV 4:4:4 streaming
moonlight-common-c pull request: moonlight-stream/moonlight-common-c#91 merged
sunshine pull request: LizardByte/Sunshine#2533 draft
Todo, in no particular order:
VK_COLOR_SPACE_HDR10_ST2084_EXT
and it fails when display is not in HDR mode