Preview Generation - MP4 - FFMPEG

Hi Folks,

I am currently trying to get video previews to work on my Nextcloud.
There are quite a few topics on this here, but none of them could solve my problem, so I’m hoping one of you can help me debugging this.

I am running my Nextclound on a Synology NAS.
Installed “ffmpeg”, added video previews to the config and ran “occ preview:generate-all”.
The preview generation is running over the files without throwing any errors. However no previews are beeing shown.
During the debugging I tried to convert some of the videos by hand using ffmpeg, which worked without problems.

Now I ran out of ideas what could be the issue here.
Is there a way of debugging the logs of the previewgenerator app or the nextclouds preview generation to see what is failing?

Has one of you occurred this problem or is able to help me with this :slight_smile:

The whole implementation process is being described here:

I think the most important points are, that you have to make sure that

  • the ffmpeg binary can be found by the web servers user using the search path and not an absolute path.
  • the web server user is allowed to execute the ffmpeg binary.

Hi j-ed,

thanks for the super quick response!
I have to admit that I am a bit lost here… I’m not quite an Linux expert and the whole Synology setup is a bit “different from normal” as well.

When I login via SSH to the NAS I can find with my admin/root user “ffmpeg” directly without an absolute path (I assume that is using the search path?).
However I can not login with the web servers http user to verify. Is there a way to check on the command line using the root user if the http user has access to those binaries?
Or maybe log whats happening on the PHP end, to see what is missing?

I’m not a Synology specialist but you might try:

  1. Switch to ‘http’ user: sudo -u http /bin/sh
  2. Check if the user has been changed: id
  3. Check if the binary can be found: type ffmpeg
  4. Check if can be executed: ffmpeg -version
  5. Exit session: exit

Thanks again :slight_smile:

I tried that and it worked. The user has access to ffmpeg and I could check the version with it, so it seems like that is not the issue :confused:

I guess you have to enable movie previews in your config.php

Something like this should work:

occ config:system:set enabledPreviewProviders 20 --value="OC\\Preview\\Movie"

Thanks for the feeback!
In fact I had already added Movies to my config.php (see below).
But I still ran the command and tried to generate the previews again, unfortunately with the same result, no previews showing :frowning:

Is there any way to debug the preview generation and see possible errors?

‘enable_previews’ => true,
‘enabledPreviewProviders’ =>
array (
0 => ‘OC\Preview\Image’,
1 => ‘OC\Preview\Movie’,
2 => ‘OC\Preview\TXT’,
3 => ‘OC\Preview\MP3’,
4 => ‘OC\Preview\MKV’,
5 => ‘OC\Preview\MP4’,
6 => ‘OC\Preview\AVI’,
),

Maybe this is the issue:
You could try to use double-backslashes like this:
OC\\Preview\\Movie

Sorry that was a problem with the quote here in the Forum, in fact the // are in place :slight_smile:

image

1 Like

May be a bit necro-posting here, but I have managed to enable it (Debian system).
I was running the command to update the previews and it was not pulling in any of the movie files:
su - www-data -s /bin/bash -c “/path/to/nextcloud/occ preview:generate-all -vvv”
I ended up trawling through here looking for inspiration, and I saw that Movie providers are disabled due to performance concerns. Going by and checking my config.php more closely, I saw that the OC\Preview\Movie line was actually incorrectly parsed and looked like “OCPreviewMovie”. Updating config and re-running the following commands enabled previews

su - www-data -s /bin/bash -c "/path/to/nextcloud/occ maintenance:mimetype:update-js"
su - www-data -s /bin/bash -c "/path/to/nextcloud/occ maintenance:mimetype:update-db"
su - www-data -s /bin/bash -c "/path/to/nextcloud/occ preview:generate-all -vvv"

You may have to keep an eye out for any errors on the console and re-run the last command if it errors for any reason. I hope this helps future person.

1 Like

thank you… I was missing the OC\Preview\Movie… I thought …\MP4 was enough…

1 Like

Thank you soo much I solved my problem by adding this to my config.php file!

For the inexpert users (as me) I let the path of the file here (./html/config/config.php)

PD: I run my NC on a truenas scale with the ffmpeg installed

1 Like