YunoHost-Apps / lychee_ynh

Lychee package for YunoHost
https://lycheeorg.github.io/
GNU General Public License v3.0
10 stars 3 forks source link

Thumbnails not generated for videos #28

Closed avephill closed 3 months ago

avephill commented 3 years ago

Uploading video file does not generate thumbnail image

Context

Steps to reproduce

Uploaded .mp4 through my browser (Firefox)

Expected behavior

The generation of a thumbnail for the uploaded video

Logs

Lychee Log error -- App\Actions\Photo\Strategies\StrategyPhoto::generate_thumbs -- 112 -- Unable to load FFProbe

ericgaspar commented 3 years ago

Have you check issues upstream? I found this.:(I don't know if it's any help) https://github.com/LycheeOrg/Lychee/issues/772

avephill commented 3 years ago

Thanks for looking. I couldn't find anything that was too relevant in that thread but that may because of the shallowness of my understanding. I'll open an issue upstream. Thanks!

nagmat84 commented 3 years ago

In order to generate thumbnail for videos Lychee requires FFmpeg and must be able to execute it (not part of Lychee). The error message indicates that Lychee is unable to do so. So either FFmpeg is not installed, Lychee cannot find it or has insufficient rights to run it or FFmpeg is deactivated by your configuration.

Please post your diagnostic output.

kamil4 commented 3 years ago

Also make sure that you follow the detailed instructions from the following FAQ: https://lycheeorg.github.io/docs/faq.html#why-dont-my-videos-have-thumbnails

avephill commented 3 years ago

Great, thank you for the help. Using the link to the FAQ I replaced protected $toolPath; with protected $toolPath = '/usr/bin/ffprobe'; in /var/ww/lychee/vendor/lychee-org/php-exif/lib/PHPExif/Adapter/FFprobe.php

and $ffmpeg = FFMpeg::create(); with

$ffmpeg = FFMpeg::create(array(
        'ffmpeg.binaries'  => '/usr/bin/ffmpeg',
        'ffprobe.binaries' => '/usr/bin/ffprobe',
));

in /var/ww/lychee/app/Actions/Photo/Extensions/VideoEditing.php

and it seems to work now

ericgaspar commented 3 years ago

Thanks @avephill I will try to make a patch to modify the files on installation. (even if I don't know how to do it yet ...)

avephill commented 3 years ago

great, thanks! I'll note that I think I replaced $ffmpeg = FFMpeg::create(); and protected $toolPath; multiple times in each script.

Also, I don't have time to open another proper issue with this upstream but it's worth sharing that it wasn't properly generating thumbnails for .mp4 files (it would just create a black thumbnail), however I could get it to work with an .m4v

kamil4 commented 3 years ago

Upstream here :smiley:.

If Lychee can generate thumbnails for any video files then in my experience it indicates that it's been configured correctly. The problem with .mp4 files you're seeing is more likely to be elsewhere then, such as with ffmpeg. Though I will say that thumbnail generation from .mp4 files works just fine here. Your report is unusual, because we typically see the opposite problem: thumbnails get generated fine, but videos don't play, which is due to ffmpeg typically having a much broader video codec support than the web browser.

Anyway, if you want, you can upload (or provide a link) to an .mp4 file that's giving you problems, and I'll check it out on my end. While we would ideally prefer to have you open a new issue about it in our upstream repo, we can deal with it here as well, so long as @ericgaspar doesn't mind :wink:.

tituspijean commented 1 year ago

Any news on this? Should we close and report it upstream?