Video Thumbnails Not Generating in Nextcloud Snap Version

Environment:

  • Nextcloud Version: 29.0.7.1 (Snap version)
  • Server OS: Ubuntu Server
  • Nextcloud Install Method: Snap
  • PHP Version: Default provided by Snap
  • Database: MySQL
  • Web Server: Apache (provided by Snap)
  • Apps Installed: Preview Generator, FFMpeg

Issue:

I’ve been trying to set up the Preview Generator app on my Nextcloud Snap instance to generate thumbnails for videos (MP4) and PDF files, but I can’t seem to get it to work. Despite following the documentation, no thumbnails are generated for my video files, which was my main goal.

Steps Taken:

  1. Installed and enabled the Preview Generator app via the Applications UI.
  2. Ran the following command to generate all previews:
sudo nextcloud.occ preview:generate-all -vvv

This command returned logs of previews being generated, including for my video files:

2024-10-20T20:53:11+00:00 Generating previews for /seb/files/Seb Photos/Bin/VID_20240203_193416.mp4
2024-10-20T20:53:11+00:00 Generating previews for /seb/files/Seb Photos/Bin/VID_20240204_172712.mp4
2024-10-20T20:53:11+00:00 Generating previews for /seb/files/Seb Photos/Bin/VID_20240204_173231.mp4
...
  1. Set up a cron job for regular preview generation:
sudo crontab -e

Cron job entry:

*/10 * * * * /usr/bin/snap run nextcloud.occ preview:pre-generate
  1. Installed FFmpeg and added its path to the config.php file along with the following settings:
'enable_previews' => true,
'enabledPreviewProviders' => array (
    'OC\\Preview\\PNG',
    'OC\\Preview\\JPEG',
    'OC\\Preview\\GIF',
    'OC\\Preview\\HEIC',
    'OC\\Preview\\BMP',
    'OC\\Preview\\XBitmap',
    'OC\\Preview\\Movie',
    'OC\\Preview\\PDF',
),
'preview_ffmpeg_path' => '/usr/bin/ffmpeg',
  1. Re-ran the preview generation commands, but still no thumbnails appear for my video files when I visit Nextcloud.

Expected Result:

Thumbnails for video files (MP4 format) should be displayed in Nextcloud’s UI.

Actual Result:

Thumbnails are not generated for video files. Only image files display previews as expected.

Questions:

  • Am I missing something in the configuration or setup process for the Preview Generator?
  • Are there additional dependencies or steps specific to the Snap version of Nextcloud for generating video thumbnails?

I’m a complete newbie to Nextcloud, having set it up just two days ago, so any guidance would be much appreciated!

Thanks in advance for your help!

https://github.com/nextcloud-snap/nextcloud-snap/wiki/FAQ’s#q-nextcloud-snap-is-not-working-because-of-third-party-app-incompatibility-what-can-i-do

Hey, thank you for the link! I tried disabling the preview generator app. However, is there a way to generate thumbnails for videos (MP4)? It just doesn’t seem to work.

image

not in the snap as far as I know… that’s because ffmpeg is not contained inside the snap and because of snap confinement the files cannot be parsed to generate thumbnails.

come to think of it, why don’t you add MP4 to your array and try try again?

'OC\\Preview\\MP4

Yes, in fact, that’s how my configuration looked at first, and it didn’t work either, but then I read somewhere (I think on GitHub or here) that I didn’t need to include MP4 and only MOVIE. Anyway, everything was very confusing at first because I wasn’t aware that there were big dependency differences between the snap and the standard version. I think I’ll try to go with the standard version since thumbnails are quite important for my project. Thanks a lot for you help!

2 Likes