-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Add more separate hardware decoding toggles, support videotoolbox #2809
Conversation
I can't remember, but I believe that there were some situations where 10bit h264 isn't hw supported either. Should we expand the 10bit toggle to include it? I've been working with #2873 I think it might benefit from this PR. The i3 cpu seems to be missing some hw profiles. |
Currently, only HEVC/VP9 may have a 10-bit hardware decoder. Therefore, in addition to these two formats, a software decoder should be used when encountering 10-bit video. |
I'll review shortly, but otherwise I find this approach a bit wrong. I mean, we should be able to do a few tests on the real HW to determine which ticks work and which don't automatically. So the ticks should be for overriding when stuff works but with some glitches. That's just me thinking out loud, though, not a blocker for this PR (and not to be addressed here). |
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 so sure about blanket "enable/disable 10-bit HW support", what if chip can decode 10-bit HEVC but cannot do 10-bit VP9?..
@nyanmisaka is there a companion PR for jf-web to add the checkbox and localisation? |
|
This may indeed happen. So I need to add another toggle to distinguish them. Or is there any other good way? |
I also have the idea of being able to detect system and HWA capabilities through a utility program. And that's what Emby next door did. They wrote a |
Maybe just list those as separate toggle-able codecs, like
Cannot we just call ffmpeg and tell it to transcode some still image to a video using HWA? Maybe we can even do without image and just make a |
You will need the image because you need to check output colors. I've toyed with the idea, but the problem is reported support is not reliable. It was much more complicated you essentially need to try every single one and then do a bitmap compare and have some threshold as to when it's "unusable" But really the toggles would need to be a matrix almost, one side the APIs and the top side the codecs (including YUV4:2:2 vs YUV4:2:0 etc but also resolution) with an auto detection thing too. I tried to make it but not in C#. It worked but was slow and took a good 15 minutes to complete. But then we can fill the matrix with tick marks of what we think works and then let the user adjust if required. And put warnings and crosses in there too if it doesn't work or if it's broken in some way. The added difficulty of HDR is a whole other ball game. It's basically not supported right now, but for nvenc someone made a stream post processor. |
Updated comments are here nyanmisaka#4 I also added a few sections for videotoolbox, I'll add a few more in a bit This also includes the same fix for #2127 and allows it to be closed. |
graphical subtitles can be off-center in some cases
When using vaapi the command vainfo outputs what codecs are supported. Have we tried |
Kodi has a list of sample files: https://kodi.wiki/view/Samples I wonder if we could find a set of files in public domain for each codec and profile and just try each to see what is supported on JF startup. |
Updated to split HEVC/VP9 10bit. Changed video toolbox's decoder to |
.Append(encodingOptions.VaapiDevice) | ||
.Append(" "); | ||
} | ||
else if (!isVaapiDecoder && isVaapiEncoder) |
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.
isVaapiDecoder
is always false here.
Blocked pending web reviews and my PR's being commited |
public bool EnableDecodingColorDepth10Hevc { get; set; } | ||
public bool EnableDecodingColorDepth10Vp9 { get; set; } |
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.
To be more future-proof we might want to nest a structure of bools, so it would become EnableDecodingColorDepth10.CodecName
. Could be done later if needed, though.
/azp run |
Commenter does not have sufficient privileges for PR 2809 in repo jellyfin/jellyfin |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
This is really good and worked for me (I disabled 10-Bit hardware decoding for HEVC), but still there should be auto detection and fallback to software. For me I got playback error in client which doesn't really say much.
Which also is pretty useless, I see that ffmpeg failed. Okay so then I run this command manually to find out that ffmpeg says
And only now I know what's the issue. Terrible user experience. I shouldn't have to know about any of this. |
@davispuh You're not wrong, but don't be an ass about it. Feel free to submit a PR to fix it 🙂 |
Changes
Allow users to customize whether to use the hardware decoder in a specific format when using VAAPI or AMF.
Allow hardware decoding to be turned off when transcoding HEVC or VP9 10-Bit videos. (Especially for older GPUs that do not support 10-Bit decoding)
Provide support for VP9/VP8 QSV decoder and VP9/VP8 NVDEC decoder coming in FFmpeg 4.3 in the future.
Continue to fix errors encountered in UTF-16 format SRT subtitles. (see 2503)
Completing some unlisted codecs that should be supported.