cross_platform_video_thumbnails
0.1.1, released a year ago by bechattaoui.dev
Cross‑platform Flutter package that generates video thumbnails in JPEG, PNG or WebP.
What it does
It extracts a frame from a video file and returns it as image bytes. Supports Android, iOS, Web, Windows, macOS and Linux via platform channels, FFmpeg or HTML5 Canvas.
AI-written summary of version 0.1.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need thumbnails for a video library or gallery.
- You target multiple platforms including Web and desktop.
- You want fine control over size, quality and format.
- You prefer a pure Dart API without external build steps.
Skip it when
- You only need a single thumbnail on a single platform and prefer a lightweight native plugin.
- You need advanced video editing or playback features beyond thumbnails.
Strengths
- Full cross‑platform support including WASM for Web.
- Batch generation and customizable dimensions, quality and format.
- Comprehensive error handling via ThumbnailException.
- No dart:io in public API, making it safe for Web.
Weaknesses
- Requires native FFmpeg installation on desktop targets.
- Platform channel setup is needed for mobile (no extra build steps, but native code is required).
- Limited to JPEG, PNG, WebP output; no GIF or TIFF yet.
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 3
Add dependency, call CrossPlatformVideoThumbnails.initialize(); on mobile platforms native code is already bundled, no extra permissions needed.
import 'package:cross_platform_video_thumbnails/cross_platform_video_thumbnails.dart';
void main() async {
await CrossPlatformVideoThumbnails.initialize();
final thumb = await CrossPlatformVideoThumbnails.generateThumbnail(
'assets/video.mp4',
ThumbnailOptions(timePosition: 5.0, width: 320, height: 240, format: ThumbnailFormat.jpeg),
);
print('Thumbnail size: ${thumb.size} bytes');
}Alternatives
Packages that do the same job and could replace cross_platform_video_thumbnails.
- video_player
Provides native video playback but not thumbnail generation; could be used together for UI.
93Compare
Works with
Packages commonly used together with cross_platform_video_thumbnails: ones it builds on, ones built on it, and its own family.