Nextcloud Video Thumbnails

Hey there, was anyone able to get video previews to work on Nextcloud, running on an Umbrel server?
Thanx?

The post was two years ago now. Unfortunately, no one has responded yet.

I think this is the solution:

After many attempts, I finally found the best way to generate previews in Nextcloud under Umbrel. :love_you_gesture:

Here is a short step by step guide:

  1. Install the App “Preview Generator” directly from Nextcloud: Preview Generator - Apps - App Store - Nextcloud

  2. Open a terminal window on your computer. On macOS, you can open the Terminal app that’s installed by default on every Mac. On Windows, you can open Command Prompt or the PowerShell app.

  3. Type in the following command ssh -t umbrel@umbrel.local and press the Enter key.

  4. Type sudo docker exec -it nextcloud_web_1 /bin/bash to get into the container.

  5. Type apt update to update the repository.

  6. To preview documents, install Libre Office and its dependencies using the following command: apt install libreoffice libreoffice-l10n-de libreoffice-help-de

  7. To preview many video and photo formats, use the following command: apt install ffmpeg imagemagick ghostscript

  8. After everything is installed, the container can be closed with the exit command.

  9. Important: Do not close the terminal after this action!

  10. Now open your Nextcloud configuration file: sudo nano ./umbrel/app-data/nextcloud/data/nextcloud/config/config.php

  11. Add the following lines to the file:

'enable_previews' => true,
'enabledPreviewProviders' =>
array (
  0 => 'OC\\Preview\\PNG',
  1 => 'OC\\Preview\\JPEG',
  2 => 'OC\\Preview\\GIF',
  3 => 'OC\\Preview\\HEIC',
  4 => 'OC\\Preview\\BMP',
  5 => 'OC\\Preview\\XBitmap',
  6 => 'OC\\Preview\\MP3',
  7 => 'OC\\Preview\\TXT',
  8 => 'OC\\Preview\\MarkDown',
  9 => 'OC\\Preview\\Movie',
  10 => 'OC\\Preview\\MKV',
  11 => 'OC\\Preview\\MP4',
  12 => 'OC\\Preview\\AVI',
  13 => 'OC\\Preview\\PDF',
),
  1. Save the file with CTRL+O and exit with CTRL+X.

  2. Now go back with the command: cd ~

  3. The configuration of the preview generator is now complete. This can now be started with the following command: sudo docker exec -u www-data -it nextcloud_web_1 php -d memory_limit=1024M occ preview:generate-all -vvv

  4. Attention: Depending on the data size of the cloud and the performance of the server, this command can take a very long time!

  5. FYI: The -vvv at the end just causes the command to print something more, such as the file that is currently being previewed. Without this addition, nothing would happen for a long time, so you quickly wonder whether the command is still running properly.

  6. Optional: As soon as this first run of the preview generator has been successfully completed, all you have to do is add a cron job for the Nextcloud. This then ensures that files that are newly uploaded to the cloud are also recognized by the preview generator so that it can do its job: sudo apt install cron , then type crontab -e and add the following line: */10 * * * * php -f /var/www/nextcloud/occ preview:pre-generate

  7. This will run this command every 10 minutes.

  8. The terminal can now be closed.

  9. That’s it. If everything went through without an error message, all previews should have been generated. From now on, previews for all possible file types and especially images should be displayed much faster in the cloud. Simply switch to the Photos app and scroll through a few pictures, it should now be much faster than before.


If something goes wrong and the previews need to be regenerated, the preview folder can easily be deleted and the whole thing regenerated. To do this, you must proceed as follows:

  1. Open a terminal and enter the following command: sudo docker exec -it nextcloud_web_1 /bin/bash

  2. Delete the Preview folder in the Appdata folder:
    root@YOUR NC ID:/var/www/html/data/appdata_YOUR NC ID# rm -rf preview/*

  3. Leave the container with exit

  4. Now type: docker exec -u www-data -it nextcloud_web_1 php occ files:scan-app-data to reload and scan the database

  5. All steps in these instructions should now be carried out again.


I hope everything works out as well as it did for me. :muscle: :sunglasses: