Skip to content

Use nv15 as intermediate format for 2-pass rkrga scaling #13313

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

Merged
merged 4 commits into from
Jan 2, 2025

Conversation

gnattu
Copy link
Member

@gnattu gnattu commented Jan 2, 2025

It seems like RKRGA is expecting no zero padding bits during 2 pass scaling which distorts P010 frames after scale. This breaks trickplay image generation for HDR videos. Workaround this by specifying nv15 frame format.

This might cause issues with other ffmpeg implementations, as NV15 is not supported everywhere. However, rockchip users should use jellyfin-ffmpeg for proper hardware acceleration anyway.

Changes

Issues

Fixes this:
image

It seems like RKRGA is expecting no zero padding bits during 2 pass scaling which distorts P010 frames after scale. This breaks trickplay image generation for HDR videos. Workaround this by specifying nv15 frame format.

This might cause issues with other ffmpeg implementations, as NV15 is not supported everywhere. However, rockchip users should use jellyfin-ffmpeg for proper hardware acceleration anyway.
@gnattu gnattu added the stable backport Backport into the next stable release label Jan 2, 2025
@gnattu gnattu requested review from a team January 2, 2025 07:37
gnattu added 2 commits January 2, 2025 15:37
The trailing columns of pixels will get distorted for frames not having a divisible by 4 width.
@nyanmisaka
Copy link
Member

RGA3 does support nv15 and p010 inputs, but there is a kernel issue that needs to be fixed via a patch. Most common distros include it. Without it RGA3 will treat p010 as nv15.

armbian/linux-rockchip@03384d1

https://github.com/search?q=repo%3Aarmbian%2Flinux-rockchip+nyanmisaka&type=commits)

@gnattu
Copy link
Member Author

gnattu commented Jan 2, 2025

RGA3 does support nv15 and p010 inputs, but there is a kernel issue that needs to be fixed via a patch. Most common distros include it. Without it RGA3 will treat p010 as nv15.

Now the million dollar question: how can we tell from the server? Because most if not all kernels shipped by board vendors are affected and buggy and those are the kernels being used most.

@nyanmisaka
Copy link
Member

RGA3 does support nv15 and p010 inputs, but there is a kernel issue that needs to be fixed via a patch. Most common distros include it. Without it RGA3 will treat p010 as nv15.

Now the million dollar question: how can we tell from the server? Because most if not all kernels shipped by board vendors are affected and buggy and those are the kernels being used most.

Just memcmp one rawvideo frame of p010 testsrc with the p010->p010 output after the rkrga filter.

Their checksums are the same when there is no glitches.

Copy link
Member

@nyanmisaka nyanmisaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But that's a bit of overkill. To mitigate the unpatched vendor kernel, this PR should be enough.

@crobibero crobibero merged commit 5c6317f into jellyfin:release-10.10.z Jan 2, 2025
15 of 16 checks passed
@gnattu gnattu deleted the fix-rkrga-tonemap branch January 3, 2025 02:07
Bond-009 pushed a commit that referenced this pull request Feb 3, 2025
Use nv15 as intermediate format for 2-pass rkrga scaling

Original-merge: 5c6317f

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Bond_009 <bond.009@outlook.com>
@jellyfin-bot jellyfin-bot removed the stable backport Backport into the next stable release label Feb 3, 2025
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

Successfully merging this pull request may close these issues.

6 participants