-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Enhance: Better previews for HDR video (CLOSED, IGNORE) #51356
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
Conversation
|
(disclaimer: my knowledge about ffmpeg/HDR is limited) Is there a downside to using the hdr options for non-hdr content? It would be better to have hdr previews "just work" without having to do any special config would be better (assuming the ffmpeg has the proper support ofc). Doing the extra |
Yes. The downside of using the HDR switches on an SDR video is that previews generated are degraded (extremely dark). That's why there is a need to differentiate. Do you need a sample image? |
|
I mean always doing the logic that is gated behind |
Ah, sorry, misunderstood. No, there's no downside as long as we confirm somewhere earlier that ffmpeg was built with libzimg and ffprobe is also installed. |
|
Ok, I would be in favor then of always enabling the behavior and doing the feature detection |
I can write the routine to detect, and then have the value of Not sure where I should insert the routine for least performance impact. What did you mean by 'cache' the results earlier... I admit I don't know how to go about that. |
|
Hang on actually, just figured out a more elegant way to do this. ffmpeg/ffprobe already display compile options which is output to stderr by default, unless suppressed by I can use the same |
|
There we go. Now checks for the presence of libzimg (zscale filter) when running ffprobe on the video. |
|
@st3iny @joshtrichards Hello, I run jnto your names frequently when looking at preview generation related stuff. Would you mind taking a look? TIA! |
|
I would love for this to gain some traction or if I can get some guidance on additional steps that I may be missing. Thank you. |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
|
@invario can you resolve the formatting issues from https://github.com/nextcloud/server/actions/runs/13774792167/job/38566161541?pr=51356 |
Sorry, I'm a novice at this... working on it now, thank you. |
|
Okay, I think I fixed the formatting. Apologies for the improper commit message, did not realize it would push here. (I'm learning!) |
Signed-off-by: Nextcloud bot <[email protected]> Signed-off-by: KT <[email protected]>
Previews currently generated for HDR videos result in desaturated/washed out images because of lack of tonemapping. This enhancement detects HDR videos and adds additional switches to the ffmpeg command to generate much improved images. Signed-off-by: invario <[email protected]> Signed-off-by: KT <[email protected]>
Signed-off-by: invario <[email protected]> Signed-off-by: KT <[email protected]>
- removed preview_ffmpeg_enable_hdr option and instead check ffmpeg build options for libzimg and enable/disable based on that Signed-off-by: invario <[email protected]> Signed-off-by: KT <[email protected]>
Use of str_pos on null would result if ffprobe failed to exec. Signed-off-by: invario <[email protected]> Signed-off-by: KT <[email protected]>
Signed-off-by: KT <[email protected]>
|
Once again, apologies, but I'm making a mess of things. :( |
|
I'm going to do a new PR and close this one out. |
Hello, hopefully I did this correctly this time, thank you.
Summary
Previews currently generated for HDR videos result in desaturated/washed out images because of lack of tonemapping. This enhancement detects HDR videos and adds additional switches to the ffmpeg command to generate much improved images.
Before

After

TODO
ffmpeg -v quiet -filtersand searching its output for 'zscale'. I don't think it's necessary as HDR preview generation would be disabled by default. Any user enabling the option should be aware of the requirement before doing so.Checklist