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