Skip to content

fix video thumbnail generation for limited-range YUV videos#1610

Merged
claudiulataretu merged 1 commit into
developmentfrom
fix/ffmpeg-video-convert
Jun 18, 2026
Merged

fix video thumbnail generation for limited-range YUV videos#1610
claudiulataretu merged 1 commit into
developmentfrom
fix/ffmpeg-video-convert

Conversation

@claudiulataretu

Copy link
Copy Markdown

Reasoning

  • Since ffmpeg 8.0 the MJPEG/JPEG encoder strictly rejects limited-range (tv) YUV input, failing with Non full-range YUV is non-standard
  • Video NFTs authored with limited color range (e.g. iOS "Core Media Video" exports) therefore produced no screenshot, so extractScreenshotFromVideo returned no frame and thumbnail generation failed.

Proposed Changes

  • In NftThumbnailService.extractScreenshotFromVideo, write the intermediate frame screenshots as .png instead of .jpg.
  • PNG (RGB) has no full-range-YUV constraint, so frame extraction succeeds for every video format; the final JPEG thumbnail is still produced downstream by sharp in extractThumbnailFromImage, so the uploaded output is unchanged.

How to test

  • Trigger thumbnail generation for a video NFT whose stream reports yuv420p(tv, ...) (limited range) and confirm a JPEG thumbnail is produced and uploaded.

Signed-off-by: Claudiu Lataretu <claudiu.lataretu@gmail.com>
@github-actions

Copy link
Copy Markdown

k6 load testing comparison.
Base Commit Hash: 64adf08
Target Commit Hash: cf34213

Metric Base Target Diff
AvgMax9095AvgMax9095AvgMax9095
Accounts48.311284.9458.5260.7144.12956.2654.2557.08-8.68% ✅-25.58% ✅-7.30% ✅-5.98% ✅
Nodes45.94530.4558.2360.4941.73489.4853.9356.36-9.17% ✅-7.72% ✅-7.38% ✅-6.82% ✅
Transactions55.151258.2459.1762.4652.861860.1969.5377.64-4.14% ✅+47.84% 🔴+17.50% 🔴+24.30% 🔴
Mex45.61294.2158.1460.2841.64345.1053.9156.39-8.71% ✅+17.30% 🔴-7.28% ✅-6.46% ✅
Blocks51.68577.5459.0961.6648.58509.9561.1270.79-6.01% ✅-11.70% ✅+3.43% 🔴+14.80% 🔴
Tokens45.56293.9258.1260.3041.60510.5453.9556.44-8.69% ✅+73.70% 🔴-7.19% ✅-6.40% ✅
Pool46.05538.5258.2160.4641.40235.7253.9256.40-10.10% ✅-56.23% ✅-7.36% ✅-6.72% ✅
Test Run Duration60002.4160001.91

Legend: Avg - Average Response Time, Max - Maximum Response Time, 90 - 90th Percentile, 95 - 95th Percentile
All times are in milliseconds.

@claudiulataretu claudiulataretu merged commit 370d50f into development Jun 18, 2026
5 of 12 checks passed
@claudiulataretu claudiulataretu deleted the fix/ffmpeg-video-convert branch June 18, 2026 08:29
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.

3 participants