Closed HawaiianPizza closed 3 years ago
What makes you think that Nextcloud generates video thumbnails? There are no video thumbnails on the official Nextcloud demo for me.
Video preview thumbnails require FFmpeg: https://github.com/nextcloud/docker/tree/master/.examples#ffmpeg
What makes you think that Nextcloud generates video thumbnails? There are no video thumbnails on the official Nextcloud demo for me.
As @J0WI pointed out it does support generating video thumbnails if you have FFmpeg installed, my suggestion would be to have a full version of nextcloud with that pre-installed if possible. But that aside, we can just create our own Dockerfile and upload to dockerhub, you can either grab the full example and just build and upload or create one with just FFmpeg.
FROM nextcloud:apache
RUN set -ex; \
apt-get update; \
apt-get install -y ffmpeg; \
CMD ["apache2-foreground"]
My guess is something like that should work
If you want to test you can also just drop in the shell in your container, and install FFmpeg manually
You will also need to add this:
'enable_previews' => true,
'enabledPreviewProviders' =>
array (
0 => 'OC\\Preview\\TXT',
1 => 'OC\\Preview\\MarkDown',
2 => 'OC\\Preview\\OpenDocument',
3 => 'OC\\Preview\\PDF',
4 => 'OC\\Preview\\MSOffice2003',
5 => 'OC\\Preview\\MSOfficeDoc',
6 => 'OC\\Preview\\Image',
7 => 'OC\\Preview\\Photoshop',
8 => 'OC\\Preview\\TIFF',
9 => 'OC\\Preview\\SVG',
10 => 'OC\\Preview\\Font',
11 => 'OC\\Preview\\MP3',
12 => 'OC\\Preview\\Movie',
13 => 'OC\\Preview\\MKV',
14 => 'OC\\Preview\\MP4',
15 => 'OC\\Preview\\AVI',
)
To your config.php
Any chance a ffmpeg/video or full variant can be provided as a tag similar to alpine? I imagine video previews is a rather common desired feature.
I would also rather just use a package from the maintaner rather than having to build my own, but @boombatower I'm going to build one and put it on dockerhub, since I'm using it as well 😄
I built such an image (just install ffmpeg on base production
image). Could do it fancy and mimic all the tags with ffmpeg, but... I think the new repository linking does not work properly for official images like it used to so I'll probably have to setup a trigger to rebuild it.
Would much prefer and official image.
Hi to all, i am new in here. I am sorry but I have the same problem too. No video previews. I have asked my server provider to install ffmpeg as I have no root privileges. Nothing has changed. All the videos uploaded before and after the ffmpeg installation have no previews. I have also added a cron job /public_html/occ preview:pre-generate -vvv but nothing happened. I have installed the app Preview Generator and follow their instructions: "The first time you install this app, before using a cron job, you properly want to generate all previews via: ./occ preview:generate-all -vvv
Important: To enable pre-generation of previews you must add php /var/www/nextcloud/occ preview:pre-generate to a system cron job that runs at times of your choosing." But nothing happened. Do you have any suggestions? Is there a chance to have a support for this issue? Is this a problem that it will show up on every nextcloud installation? Thanks in advance for your support. Regards
I have asked my server provider to install ffmpeg as I have no root privileges.
This issue is only for the Docker image.
You should to compare your enabledPreviewProviders
with https://github.com/nextcloud/docker/issues/1432#issuecomment-806654679.
Hi @J0WI, thanks for your reply. I have already in my config.php file following: 'enable_previews' => true, 'enabledPreviewProviders' => array ( 0 => 'OC\Preview\TXT', 1 => 'OC\Preview\MarkDown', 2 => 'OC\Preview\OpenDocument', 3 => 'OC\Preview\PDF', 4 => 'OC\Preview\MSOffice2003', 5 => 'OC\Preview\MSOfficeDoc', 6 => 'OC\Preview\Image', 7 => 'OC\Preview\Photoshop', 8 => 'OC\Preview\TIFF', 9 => 'OC\Preview\SVG', 10 => 'OC\Preview\Font', 11 => 'OC\Preview\MP3', 12 => 'OC\Preview\Movie', 13 => 'OC\Preview\MKV', 14 => 'OC\Preview\MP4', 15 => 'OC\Preview\AVI', ) What I have found out since now is. I am on a shared hosting server and also nextcloud app Preview Generator works fine but creates only image previews not video previews. I believe the only ffmpeg creates video previews but I do not know where ffmpeg creates thumbnails (path) and what is the ssh comand to let ffmpeg generates all previews. hope you can help
I have run this comand: /home/st9284/ffmpeg/ffmpeg -version ffmpeg version N-53260-ga37109d555-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2020 the FFmpeg developers built with gcc 8 (Debian 8.3.0-6) configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg libavutil 56. 55.100 / 56. 55.100 libavcodec 58. 92.100 / 58. 92.100 libavformat 58. 46.101 / 58. 46.101 libavdevice 58. 11.100 / 58. 11.100 libavfilter 7. 86.100 / 7. 86.100 libswscale 5. 8.100 / 5. 8.100 libswresample 3. 8.100 / 3. 8.100 libpostproc 55. 8.100 / 55. 8.100
what is Docker?
Nextcloud expects th ffmpeg in one these directories: https://github.com/nextcloud/server/blob/v21.0.1/lib/private/legacy/OC_Helper.php#L469
Please use https://help.nextcloud.com/ for arbitrary questions.
I'm closing the issue, because the initial cause was already solved in https://github.com/nextcloud/docker/issues/1432#issuecomment-798952368
@J0WI Do we need to open another issue then for providing a container image flavor with ffmpeg installed?
The package can easily be added on top of the current image. We don't include every optional dependency for every app. See also: https://github.com/nextcloud/docker/issues/63#issuecomment-299688083 https://github.com/nextcloud/photos/issues/362
Different definitions of easy I suppose. One of the primary points of using an official docker image is that I do not have to maintain the software stack within. Having to install something into an official container and do so every time it updates is not zero work. If I had to do this for all the software I host I would go cross-eyed.
We don't include every optional dependency for every app.
No one asked for this, just one dependency for one app. If this is not valued or commonly used, as was put forth in this issue, that is a valid reason not to, but this statement is irrelevant.
I'll take your response as indication that upstream is not interested in considering this and that I will need to look into a maintained method for rebuilding an image with a one-line addition whenever the official image updates. :( :( :(
I would put forth there is more value in an ffmpeg variant than apache, fpm, and fpm-alpine, but to each their own.
Adding the package is easier than removing it. It's as easy as having a docker exec apk add --no-cache ffmpeg
hook somewhere. There was a similar discussion about imagemagick
in https://github.com/nextcloud/docker/issues/1414.
hook somewhere
The somewhere is the key part. The command you referenced is what I did it ensure that was all that was needed and have been running it that way until I decide how to proceed.
The problem is that when using automated or managed update systems they are generally designed with the assumption that you have an image containing what you want and when the source image changes you update the local one.
Thanks for the other issue pointer.
Did it really easy with docker-compose:
Now you only have to exec the ffmpeg.sh script after updating the file.
Hope this helps.
My solution with docker-compose:
command: bash -c "apt update && apt install ffmpeg -y && apache2-foreground"
docker-compose up
) take longerconfig.php
for example like in this comment: https://github.com/nextcloud/docker/issues/1432#issuecomment-806654679@FunctionDJ --- I believe there's an issue in using the above command flag, and it will cause side effects. Nextcloud upgrades are not working properly when using the above mentioned "command" in docker-compose. I looked a bit into this, and I think I found the reason, as described below.
The "command" flag will overwrite nextcloud's image "CMD" flag. That's fine, since instead of doing just "apache2-foreground", with the command flag, we'll end up installing ffmpeg first, and then calling apache2-foreground.
The problem is how this command / CMD will interact with the ENTRYPOINT, and particularly the entrypoint.sh script that nextloud container is calling. In docker, CMD commands will be passed at the end of the ENTRYPOINT commands. Looking at nextcloud's Dockerfile, we have:
ENTRYPOINT ["/entrypoint.sh"] CMD ["apache2-foreground"]
When the above container is ran, the final command will be:
/entrypoint.sh apache2-foreground".
But when we use the "command" flag to install ffmpeg, the final command will be:
/entrypoint.sh bash -c "apt update && apt install ffmpeg -y && apache2-foreground"
The entrypoint.sh script is important to run well, because this is where upgrades are handled / started. Looking inside the that script, there are checks for the 1st argument to that script, where it looks if it's "apache" or "php-fpm". Because we modified these positional argument by using the docker-compose "command", the upgrade doesn't seem to start. Similar thing happens on first time install --- the above command will make the installation unsuccessful.
I really think this video preview feature should be properly supported by the official image. I don't agree with the maintainers' position of avoiding to support it, resulting in a basic nextcloud feature not functioning properly.
For the time being, my proposed solution is to use the following in docker-compose.yml:
entrypoint: bash -c "apt update && apt install ffmpeg -y && /entrypoint.sh apache2-foreground"
I haven't tested it during an upgrade, but I would expect it to work.
I'm not 100% happy with this kind of "band-aid hacks", as they rely on specific knowledge of the internals (i.e entrypoint.sh). These internal scripts could easily change in the future and might invalidate this or other similar solutions.
You might need to set NEXTCLOUD_UPDATE=1
as described in https://github.com/nextcloud/docker#adding-features for updates to work
For anyone else having this issue, you need both ffmpeg
and imagemagick-common
installed on both the main app
container and the image generation container (cron
in my case)
this is my docker file both app
and cron
FROM nextcloud:apache
RUN apt-get update && apt-get install -y \
imagemagick-common \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
I'm also using Preview Generator
@adimol adimol
I haven't tested it during an upgrade, but I would expect it to work.
Did you have any issues with updates so far ? I prefer this solution so i don't have to build my own image all the time.
@Trufax - I've been using that solution and I haven't had any issues so far. All the updates worked well.
Unfortunately, I still have no video preview thumbnail under 27.1.3 (installed via snap) even though the following installed/added:
imagemagick-common
'preview_ffmpeg_path' => '/usr/bin/ffmpeg',¬
'enable_previews' => true,¬
'enabledPreviewProviders' =>¬
array (¬
0 => 'OC\\Preview\\TXT',¬
1 => 'OC\\Preview\\MarkDown',¬
2 => 'OC\\Preview\\OpenDocument',¬
3 => 'OC\\Preview\\PDF',¬
4 => 'OC\\Preview\\Image',¬
5 => 'OC\\Preview\\TIFF',¬
6 => 'OC\\Preview\\SVG',¬
7 => 'OC\\Preview\\Font',¬
8 => 'OC\\Preview\\MP3',¬
9 => 'OC\\Preview\\Movie',¬
10 => 'OC\\Preview\\MKV',¬
11 => 'OC\\Preview\\MP4',¬
12 => 'OC\\Preview\\AVI',¬
),
I really don't know what else I could do to make this thing work.
I have thumbnail preview for pics and MarkDown, but no for videos.
Last resort before I give up. Is it anything to do with the fact I don't have a login shell set for www-data
user?
Edit: I enabled shell login for this user, re-ran the generator under it, and still not working.
@faxotherapy The Snap is an entirely different animal. This thread is about the micro-services Docker image. The approaches described here will not help you.
You need to look around here:
https://github.com/nextcloud-snap/nextcloud-snap/
E.g. https://github.com/nextcloud-snap/nextcloud-snap/issues/1327
Hi every one I have the same problem (No video preview) I use TrueNAS-13.0-U5.3 as server, and install nextcloud version 27.1.3 but No video preview can some one help me how to fix it?
Maybe this post can help…
As it's still not in the official nextcloud images, I'm using the 'hetorusnl/nextcloud-ffmpeg' image, that's automagically built by Github Actions on a weekly basis based on the nextcloud:apache
image.
Github repo link: https://github.com/HetorusNL/custom-docker-images/
Dockerhub link: https://hub.docker.com/r/hetorusnl/nextcloud-ffmpeg
And the following configuration in config/config.php
for the video previews:
'enabledPreviewProviders' =>
array (
0 => 'OC\\Preview\\BMP',
1 => 'OC\\Preview\\GIF',
2 => 'OC\\Preview\\JPEG',
3 => 'OC\\Preview\\MarkDown',
4 => 'OC\\Preview\\MP3',
5 => 'OC\\Preview\\PNG',
6 => 'OC\\Preview\\TXT',
7 => 'OC\\Preview\\XBitmap',
8 => 'OC\\Preview\\OpenDocument',
9 => 'OC\\Preview\\Krita',
10 => 'OC\\Preview\\HEIC',
11 => 'OC\\Preview\\SVG',
12 => 'OC\\Preview\\Movie',
13 => 'OC\\Preview\\MKV',
14 => 'OC\\Preview\\MP4',
15 => 'OC\\Preview\\AVI',
),
I'm baffled that core components needed for NC to function at full are left out of docker. I installed the following manually just to get the health warnings page to settle down and restore features.
ffmpeg pdlib bzip
Please include in the official image or have tags so people can install images that allow full features.
I'm getting thumbnails for most file types, just gifs seem to be left out. Does anyone happen to know what is needed for gifs to get previews?
Nextcloud version:
20.0.7
Operating system and version:Ubuntu 20.04.2 LTS on Raspberry Pi 4
None of my videos uploaded onto my Nextcloud (installed via Docker-Compose) are showing any thumbnails. Images (GIF, JPEG, PNG) are fine and thumbnails are generated. However, it's not the same for videos.
I've attached an image of how my videos look like.