Generate poster thumbnails for reels (<name>_thumb.png) and use on the player - #11
Merged
Conversation
On upload, ffmpeg extracts a poster frame into <name>_thumb.png next to the video on the DATA_DIR volume; it's served at /api/media/[id]/thumb and set as the <video poster> on the /videos gallery and the dashboard. Generation is best-effort — if ffmpeg is missing the upload still succeeds with no poster. Deleting a reel also removes its thumbnail. Committed posters for the two built-in brand reels too. - lib/media.ts: thumbFilename/generateThumbnail/hasThumb (ffmpeg, 640px wide) - POST /api/media generates the thumb; DELETE removes it; mediaView exposes it - GET /api/media/[id]/thumb serves the PNG - /videos + dashboard set <video poster> - Dockerfile: install ffmpeg in the runtime image Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
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.
What
When a reel is uploaded, generate a poster thumbnail and use it as the
<video poster>so the gallery shows a still frame instead of a black box.<name>_thumb.pngnext to the video on theDATA_DIRvolume.GET /api/media/[id]/thumb;mediaViewexposes athumbURL.posteron the<video>in both the public/videosgallery and the dashboard Videos tab.public/videos/*_thumb.png), used as their posters too.Notes
null).Verified
Built clean, then ran end-to-end against a local server with an isolated DATA_DIR:
thumb: /api/media/<id>/thumb, and<id>_thumb.png(640×360) written next to<id>.mp4GET /api/media/<id>/thumb→ 200image/png/videosHTML emitsposter="…/thumb"for the upload andposter="/videos/…_thumb.png"for built-ins (both served 200).mp4and_thumb.pngremoved🤖 Generated with Claude Code