NextCloud: Enable video previews

This guide will show you how to enable video previews on NextCloud hosted on Debian/Ubuntu. You can apply the same steps if you are running the Docker version of NextCloud or different distribution.

What is NextCloud?


NextCloud allows you to share files in a similar way to Dropbox and Google Drive. It is, however, more than a file share! You can use it as a collaboration platform and customize it with a wide selection of useful apps.

What is FFmpeg?

FFmpeg is a multimedia framework that can decode, encode, transcode, mux, demux, stream, filter, and play almost anything multimedia format. Also, FFmpeg runs on a wide variety of build environments, machine architectures, and configurations.

Install FFmpeg for video previews

Follow these steps to enable video, image, and PDF previews on your NextCloud.

Standard install

First, you want to update your Linux distribution.

sudo apt update

Second, you want to install FFmpeg using the following command:

sudo apt install ffmpeg

Docker install

You can also enable video previews in NextCloud using Docker.

The example below shows you how to do this using Docker exec:

/usr/bin/docker exec -it --user root {{ your_container_name }} /bin/bash -c 'apt update && apt install -y ffmpeg'

You will, of course, need to replace “{{ your_container_name }}” with the name of your container. Additionally, note that you may need to rerun this command if you restart your container. However, you can overcome this by building a new Docker image.

Configure NextCloud previews

Next, you must edit your config.php file and add the following lines:

  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (
    0 => 'OC\\Preview\\Movie',
    1 => 'OC\\Preview\\PNG',
    2 => 'OC\\Preview\\JPEG',
    3 => 'OC\\Preview\\GIF',
    4 => 'OC\\Preview\\BMP',
    5 => 'OC\\Preview\\XBitmap',
    6 => 'OC\\Preview\\MP3',
    7 => 'OC\\Preview\\MP4',
    8 => 'OC\\Preview\\TXT',
    9 => 'OC\\Preview\\MarkDown',
    10 => 'OC\\Preview\\PDF',
  ),

The configuration mentioned above will enable the movie, PNG, JPEG, GIF, BMP, XBitmap, MP3, MP4, TXT, Markdown, and PDF preview provider within NextCloud.

Wrapping up

In conclusion, you have now configured your NextCloud to display video previews on Debian/Ubuntu installs.

You may also be interested in

Sources:

About Anto Online

Anto, a seasoned technologist with over two decades of experience, has traversed the tech landscape from Desktop Support Engineer to enterprise application consultant, specializing in AWS serverless technologies. He guides clients in leveraging serverless solutions while passionately exploring cutting-edge cloud concepts beyond his daily work. Anto's dedication to continuous learning, experimentation, and collaboration makes him a true inspiration, igniting others' interest in the transformative power of cloud computing.

View all posts by Anto Online

One Comment on “NextCloud: Enable video previews”

  1. thanks for the write up, just made my new nextcloud deployment that much better for me.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.