-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix(nvenc): Enable opt-in client refresh by client #3415
base: master
Are you sure you want to change the base?
fix(nvenc): Enable opt-in client refresh by client #3415
Conversation
Quality Gate passedIssues Measures |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3415 +/- ##
==========================================
- Coverage 11.13% 11.12% -0.01%
==========================================
Files 99 99
Lines 17253 17261 +8
Branches 8045 8048 +3
==========================================
Hits 1921 1921
- Misses 12639 12785 +146
+ Partials 2693 2555 -138
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Do we need to wait for the moonlight-common-c PR to be merged for this? |
Not really. The SDP attribute looks fine and that's the only part of the network protocol that's affected by this change. If we wanted to do this for real, I would suggest allowing the client to specify the parameters of the intra-refresh period, but since this is basically a hack, I'm fine just having a single flag to indicate it. I'm pretty convinced we (or FFmpeg) probably have a bug here though because I've seen this "artifacting on mostly static images" pop up on other clients too. It's just really tricky to catch in a way that can actually be analyzed. We would need to write the whole video stream to disk, so we could run it through a bitstream analyzer it after the fact. Maybe it's feasible to do on Xbox where it occurs relatively soon, but in other cases it can take hours of streaming for it to happen. |
@@ -321,6 +321,12 @@ namespace nvenc { | |||
set_ref_frames(format_config.maxNumRefFramesInDPB, format_config.numRefL0, 5); | |||
set_minqp_if_enabled(config.min_qp_hevc); | |||
fill_h264_hevc_vui(format_config.hevcVUIParameters); | |||
if (client_config.enableIntraRefresh == 1) { | |||
format_config.enableIntraRefresh = 1; | |||
format_config.singleSliceIntraRefresh = 1; |
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 think singleSliceIntraRefresh
is a special feature that's not supported by all NVENC encoders. Do we need that?
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.
It's possible to check for NV_ENC_CAPS_SINGLE_SLICE_INTRA_REFRESH
cap and enable single slice conditionally.
Description
Context in TheElixZammuto/moonlight-xbox#117
This type of degradation can be fixed on nvidia cards by implementing intra-refresh.
I do not have an nvidia card so I wasn't be able to test, but this change has been validated by the commenters in the issue above using a custom Sunshine build made by me and by other forks of Sunshine made by other people, and it seems to fix the issue.
This change is completely opt-in by the client, so this change should only apply to the Xbox/UWP Client
Related to:
moonlight-xbox: TheElixZammuto/moonlight-xbox#155
moonlight-common-c: moonlight-stream/moonlight-common-c#97
Screenshot
Issues Fixed or Closed
TheElixZammuto/moonlight-xbox#117
Type of Change
.github/...
)Checklist