question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Handle thumbnail creation of video files correctly

See original GitHub issue

On the commit https://github.com/LibrePhotos/librephotos/commit/187cfa2da9c04330cbe3402ad4b2ebd3408aff23 is_valid_media is remove then all file are processed.

On my folder there is mp4 video are processed with the bellow error :

20200118_195052.mp4

reason: delegate failed `'ffmpeg' -nostdin -v -1 -i '%i' -vframes %S -vcodec pam -an -f rawvideo -y '%u.pam' 2> '%u'' @ error/delegate.c/InvokeDelegate/1966
Traceback (most recent call last):
  File "/usr/lib/librephotos/backend/api/directory_watcher.py", line 90, in handle_new_image
    photo._generate_thumbnail()
  File "/usr/lib/librephotos/backend/api/models/photo.py", line 132, in _generate_thumbnail
    with Image(filename=self.image_path) as img:
  File "/usr/lib/librephotos/.local/lib/python3.9/site-packages/wand/image.py", line 9110, in __init__
    self.read(filename=filename)
  File "/usr/lib/librephotos/.local/lib/python3.9/site-packages/wand/image.py", line 9705, in read
    self.raise_exception()
  File "/usr/lib/librephotos/.local/lib/python3.9/site-packages/wand/resource.py", line 222, in raise_exception
    raise e
wand.exceptions.DelegateError: delegate failed `'ffmpeg' -nostdin -v -1 -i '%i' -vframes %S -vcodec pam -an -f rawvideo -y '%u.pam' 2> '%u'' @ error/delegate.c/InvokeDelegate/1966

After install ffmpeg

20200118_195052.mp4

reason: cache resources exhausted `/tmp/magick-RKvHmvmInW9R3NWGXP6FveysIVHoWR56.pam' @ error/cache.c/OpenPixelCache/4095
Traceback (most recent call last):
  File "/usr/lib/librephotos/backend/api/directory_watcher.py", line 134, in rescan_image
    photo._generate_thumbnail()
  File "/usr/lib/librephotos/backend/api/models/photo.py", line 132, in _generate_thumbnail
    with Image(filename=self.image_path) as img:
  File "/usr/lib/librephotos/.local/lib/python3.9/site-packages/wand/image.py", line 9110, in __init__
    self.read(filename=filename)
  File "/usr/lib/librephotos/.local/lib/python3.9/site-packages/wand/image.py", line 9705, in read
    self.raise_exception()
  File "/usr/lib/librephotos/.local/lib/python3.9/site-packages/wand/resource.py", line 222, in raise_exception
    raise e
wand.exceptions.CacheError: cache resources exhausted `/tmp/magick-RKvHmvmInW9R3NWGXP6FveysIVHoWR56.pam' @ error/cache.c/OpenPixelCache/4095

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
derneuerecommented, Mar 26, 2021

Maybe we should catch video files and use ffmpeg directly to create thumbnails for videos? https://github.com/kkroening/ffmpeg-python

0reactions
derneuerecommented, May 22, 2021

We now use ffmpeg to create thumbnails for videos 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Capture or change a video thumbnail - Microsoft Support
Click Change thumbnail, and then choose one of the following options: Capture a thumbnail from video.
Read more >
Video Thumbnail Guide: How to Make a Great Video Thumbnail
Learn how to make great video thumbnails for all your social network that capture your audience's attention and promtp them to watch!
Read more >
What Are Video Thumbnails and Why Do They Matter?
A video thumbnail is a still image that acts as the preview image for your video. It's kind of like a book cover....
Read more >
Video Thumbnail Guide - Tips for Design, Layout & Dimensions
Custom video thumbnails are essential if you want your content to get clicked. Step 1. Accurately portray your content in your thumbnail ......
Read more >
4 Ways To Display Thumbnail Previews For All Video Files
Click the preset drop down at the top right and change from Default to Common or Most Known for the program to recognize...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found