Thumbnail preview generation

Hi folks,
I’ve got a personal Nexcloud home installation on an old Raspberry Pi second generation and a huge 4TB external drive. I’ve successfully loaded about 500GB of data into my account (a simple cp into position and then a manual scan on the cli), now since the computing power of the system is very limited I’d like to precompute all image previews to have them available when using the mobile app. Is it possible? How?
Thanks a million

1 Like

Yes is is, but it will take a looong time.

How do you do it? Can I run it only for specific directories?


The guide says preview works for .mp4 files.
Do you @Sanook have any idea why it’s not working with my settings?

You need to install ffmpeg

I have it.
/opt/bin/ffmpeg -version
ffmpeg version git-2018-05-24-7c333dc Copyright © 2000-2018 the FFm
peg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-28)

Does Nextcloud know that path to ffmpeg?

Typically it is installed in /usr/bin

Thanks! That was it!
Env[PATH] needed /opt/bin

Please wrote your message to the my thread, so I can mark it as solution. Thank You!

@Sanook @MeiRos
Could you please clarify where the Env is set? From command line? Added to any file? Nextcloud’s config.php file? How to make it permament?

Thank you in advance,

I have it in the php-fpm.conf file. Don’t remove other paths, just add /opt/bin.
Make sure your ffmpg is in that path, or it will not help.

@MeiRos thank you for your reply! :+1:

My steps:

sudo apt-get install ffmpeg
sudo nano /etc/php/7.3/fpm/php-fpm.conf
to the end

Should we still add the below code to Nextcloud’s config.php ? Given a Nextcloud v17 setup.

‘enable_previews’ => true,
‘enabledPreviewProviders’ =>
array (
13 => ‘OC\Preview\Movie’,
14 => ‘OC\Preview\MKV’,
15 => ‘OC\Preview\MP4’,
16 => ‘OC\Preview\AVI’,

Array numbers modified as needed, of course.

Thank you in advance,

1 Like

I don’t know if something have changed, but I added needed lines (like your example) to the config.php.