1515use Psr \Log \LoggerInterface ;
1616
1717class Movie extends ProviderV2 {
18- private Iconfig $ config ;
18+ private IConfig $ config ;
1919
2020 /**
2121 * @deprecated 23.0.0 pass option to \OCP\Preview\ProviderV2
@@ -127,8 +127,7 @@ private function useHdr(string $absPath): bool {
127127 proc_close ($ test_hdr_proc );
128128 // search build options for libzimg (provides zscale filter)
129129 $ ffmpeg_libzimg_installed = strpos ($ test_hdr_stderr , '--enable-libzimg ' );
130- // Only values of "smpte2084" and "arib-std-b67" indicate an HDR video. Force colorspace to '2020_ncl'
131- // because some videos are tagged incorrectly as 'reserved' resulting in fail.
130+ // Only values of "smpte2084" and "arib-std-b67" indicate an HDR video.
132131 // Only return true if video is detected as HDR and libzimg is installed.
133132 if (($ test_hdr_stdout === 'smpte2084 ' || $ test_hdr_stdout === 'arib-std-b67 ' ) && $ ffmpeg_libzimg_installed !== false ) {
134133 return true ;
@@ -149,13 +148,15 @@ private function generateThumbNail(int $maxX, int $maxY, string $absPath, int $s
149148 $ tmpPath ];
150149 } elseif ($ binaryType === 'ffmpeg ' ) {
151150 if ($ this ->useHdr ($ absPath )) {
151+ // Force colorspace to '2020_ncl' because some videos are
152+ // tagged incorrectly as 'reserved' resulting in fail if not forced.
152153 $ cmd = [$ this ->binary , '-y ' , '-ss ' , (string )$ second ,
153154 '-i ' , $ absPath ,
154155 '-f ' , 'mjpeg ' , '-vframes ' , '1 ' ,
155156 '-vf ' , 'zscale=min=2020_ncl:t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p ' ,
156157 $ tmpPath ];
157158 } else {
158- // alway default to generating preview using non-HDR command
159+ // always default to generating preview using non-HDR command
159160 $ cmd = [$ this ->binary , '-y ' , '-ss ' , (string )$ second ,
160161 '-i ' , $ absPath ,
161162 '-f ' , 'mjpeg ' , '-vframes ' , '1 ' ,
0 commit comments