[6.x] Fix video thumbnails showing as a broken image - #15291
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Problem
If you don't have
ffmpeginstalled (which is normal on macOS at least) you see a broken image when you upload a video, like belowI 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:
How to Reproduce
/cp/assetslocally on macOS and you'll probably get a broken thumbnail unless you've gone to the trouble of installing ffmpeg