No thumbnails generated for videos

I've uploaded a bunch of photos and videos from my phone to oC. The photos are all listed with the thumbnails, but the videos don't have any.

I have ffmpeg installed (version 3.2.4) and the php-ffmpeg extension (0.7.16) with GD-support enabled. What else am I missing?

My oC installation just updated itself to the latest 9.x. Using php-7...

Video previews are not generated by default and you need to enable these as described in [1]. There are also unknown dependencies and undocumented stuff like shell_exec which needs to be enabled in your PHP configuration [2]

[1] https://doc.owncloud.org/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#previews

[2]

Ok, I explicitly rewrote the enabledPreviewProviders to contain 'OC\Preview\Movie' -- to no avail. I then added debugging output here and there and found, that when findBinaryPath looks for the ffmpeg-executable, it obtains the list of directories to check by calling getenv(PATH).

According to the debug output I inserted, that call returns: /sbin:/bin:/usr/sbin:/usr/bin, whereas the ffmpeg on my system is in /opt/bin/ffmpeg. This explains, why ffmpeg is not found.

According to phpinfo(), the PATH environment variable is set to /opt/bin:/usr/bin:/bin, but the $_SERVER['PATH'] contains the string, that Apache was started with and does not contain the /opt/bin. For some reason, a call to getenv('PATH') returns the latter instead of the former... I do not know, why Apache's setting trumps the value I explicitly configured for the PHP FPM pool. But, after adding SetEnv PATH /opt/bin:/bin:/usr/bin to Apache's config, I got the thumbnails working. Woo-hoo!

It still annoys me, that oC forks/execs a separate process to generate each thumbnail -- why wouldn't it use the php-ffmpeg module, where installed, instead? Maybe, I should implement my own replacement for OC\Preview\Movie...