Open invario opened 6 months ago
Have been researching the proper parameters to pass to FFMPEG to generate previews properly. Came across this link:
https://superuser.com/questions/1732301/convert-10bit-hdr-video-to-8bit-frames/1732304
It suggests that this parameter passed in would generate a proper preview/thumbnail for a HDR video. I tested it manually by generating a single frame and it appears to work. Interested in discussing this with anyone, thanks!
-vf zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p
edit: AAAAAND, boom goes the dynamite. zscale isn't on every ffmpeg version so this won't work for everyone. Hmm...
edit2: Wow this is turning out to be more complicated than I thought. So FFMPEG needs zscale but not every FFMPEG is compiled with zscale enabled. Then, even with zscale, you can not use the same parameters for HDR source video as you would for SDR source video because if you do, the resultant image/preview file is very, very dark and generated wrong. So in order to properly do this, the source video must be read, and then if, and only if it is HDR should the proper parameters get added to the command line for FFMPEG. Maybe a config.php parameters needs to be added to indicate if the FFMPEG installation has zscale available, otherwise default to no?
⚠️ This issue respects the following points: ⚠️
Bug description
Recently I switched on the HDR10+ setting for recording videos on my Samsung GS23+ and now previews being generated in NC looked washed out. (See still images attached of the generated preview versus a screenshot from the video being played.) From my understanding of HDR, this might be a result of needing to tonemap with some additional switches passed to FFMPEG?
NC generated preview:
Screenshot out of original video:
Steps to reproduce
Expected behavior
The preview/thumbnail shouldn't be washed out.
Installation method
Community Manual installation with Archive
Nextcloud Server version
28
Operating system
Other
PHP engine version
PHP 8.2
Web server
Nginx
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
I'm not sure if this should be considered a bug or enhancement. On the one hand, preview images are being generated but on the other hand, they're not being generated accurately to reflect the video.