Skip to content

[6.x] Fix video thumbnails showing as a broken image - #15291

Merged
jasonvarga merged 8 commits into
6.xfrom
fix-video-thumbnails-showing-as-a-broken-image
Aug 28, 2026
Merged

[6.x] Fix video thumbnails showing as a broken image#15291
jasonvarga merged 8 commits into
6.xfrom
fix-video-thumbnails-showing-as-a-broken-image

Conversation

@jaygeorge

Copy link
Copy Markdown
Contributor

Description of the Problem

If you don't have ffmpeg installed (which is normal on macOS at least) you see a broken image when you upload a video, like below

2026-08-27 at 15 43 14@2x

I believe this behaviour was introduced in #11841

What this PR Does

Before: Videos always got a thumbnail URL; without FFmpeg that request 500’d → broken .

After:

  • Only emit a thumbnail URL if FFmpeg is actually available (and a configured binary is executable)
  • If generation still fails, return the video filetype SVG instead of Glide
  • UI @error falls back to the file icon
  • FFmpeg lookup is per-request (once()), so Octane-style workers don’t stick with a stale “missing” result
  • So MP4s show a proper file/video icon without FFmpeg, and real frame thumbs still work when FFmpeg is installed.

How to Reproduce

  1. Drop an mp4 in /cp/assets locally on macOS and you'll probably get a broken thumbnail unless you've gone to the trouble of installing ffmpeg

A stale or mistyped ffmpeg.binary path was treated as available, so
video thumbnail URLs were still emitted and the CP hit failing requests.
A process-static cache could leave long-lived workers (e.g. Octane)
stuck with a stale missing-binary result across requests.
Assert the video filetype SVG body, and cover video_thumbnails being
disabled so Glide never tries to manipulate an MP4.
Laravel once() is instance-scoped and Ffmpeg is not a singleton, so each
asset re-resolved the binary. Use a static cache cleared on Octane
RequestReceived (and via clearBinaryCache) instead of Once::flush().
Browser Grid/Thumbnail already cleared a broken thumbnail URL on
img error; Assets fieldtype tiles and rows did not, so failed video
thumbs still showed as broken images there.
which/where can return a stale non-executable path; treat that the same
as a missing binary so video thumbnail URLs are not emitted.
@jasonvarga
jasonvarga merged commit 04d2802 into 6.x Aug 28, 2026
64 checks passed
@jasonvarga
jasonvarga deleted the fix-video-thumbnails-showing-as-a-broken-image branch August 28, 2026 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants