For an Android or iOS app, the video_thumbnail package can extract a frame from a local video file or video URL. Use VideoThumbnail.thumbnailData when you want image bytes to display in the app, or VideoThumbnail.thumbnailFile when you need an image saved to a path. Choose the frame time, output format, dimensions, and quality as part of the call.
Choose the right thumbnail output
The package documents version 0.5.6 and Android and iOS support. Its two main methods serve different needs:
thumbnailData: returns image bytes (Uint8List), suitable for displaying an image directly in the widget tree.thumbnailFile: writes an image and returns its path, suitable when the thumbnail needs to be stored or reused as a file.
Both methods accept a video source and options including image format, maximum dimensions, a timestamp in milliseconds, and quality. The package page is the reference for the exact API available in the version you install.
Generate and display a thumbnail from a local video
1. Add the package
From the Flutter project directory, add the dependency:
Free tools Windows power users keep installed
One-click scans. No signup required.
#1 Best Overall
- 【Video Camera as Webcam】: The video camera is useful to take the beautiful photos and share it in your Youtube. It can be used as webcam when the camera connect the computer. Please operate the camera button to choose the “PC CAM” mode.When the “AMCAP ” window is opened,from which shooting object through the camera will be showed on this window. You can have a video call with your families or friends. Please download the software “AMCAP ” before use the webcam function.
- 【Multifunction Camcorder】: 1080P(15fps) Video Resolution, 24M(6000x4500) Image Resolution, image format (JPEG), video format(AVI), 16X digital zoom, camcorder with fill light, 3.0 inch LCD and supports 270°rotation, Anti-shake, Face Capture, Beauty Function, Self-timer and Webcam function, Pause function, USB 2.0, TV Output, Setting Date and Time.
- 【Pause Function】: This video camera supports Pause function,so you can pause the recording when you need,then continue recording again without starting a new one, which makes it easier for you to edit and upload the videos. This video camera included a USB cable,you can connect it directly to the computer to upload videos. This video camera included a AV cable,you can connect it directly to the TV to playback the videos.
- 【Recording While Charging】: The camcorder come with two NP-FV5 batteries. It allows you to keep recording around 60 to 90 minutes when it's fully charged. For the first time use need to charge more than 8 hours. The camcorder support the recording while charging,good to record long videos anytime.
- 【Small and Compact Camcorder】: The camcorder supports SD/SDHC card up to 128GB (not included), just remember to format the SD card before use the camcorder first time. The camcorder support the tripod(not included) connection and the hole is standard size.
flutter pub add video_thumbnail
Import the package where you want to create the thumbnail:
import 'package:video_thumbnail/video_thumbnail.dart';
2. Extract bytes and render them
This example requests a JPEG frame at the package’s default timestamp, sets a maximum width, and displays the returned bytes. It checks for a missing result before constructing the image.
import 'dart:typed_data';
import 'package:flutter/material.dart';
import 'package:video_thumbnail/video_thumbnail.dart';
class VideoPreview extends StatefulWidget {
const VideoPreview({super.key, required this.videoPath});
final String videoPath;
@override
State<VideoPreview> createState() => _VideoPreviewState();
}
class _VideoPreviewState extends State<VideoPreview> {
Uint8List? _thumbnail;
bool _loading = true;
Object? _error;
@override
void initState() {
super.initState();
_createThumbnail();
}
Future<void> _createThumbnail() async {
try {
final bytes = await VideoThumbnail.thumbnailData(
video: widget.videoPath,
imageFormat: ImageFormat.JPEG,
maxWidth: 320,
quality: 80,
);
if (!mounted) return;
setState(() {
_thumbnail = bytes;
_loading = false;
});
} catch (error) {
if (!mounted) return;
setState(() {
_error = error;
_loading = false;
});
}
}
@override
Widget build(BuildContext context) {
if (_loading) return const Center(child: CircularProgressIndicator());
if (_error != null) return const Text('Could not create video thumbnail.');
if (_thumbnail == null || _thumbnail!.isEmpty) {
return const Text('No thumbnail was returned.');
}
return Image.memory(_thumbnail!, fit: BoxFit.cover);
}
}
Pass the path for the video selected by your app as videoPath. This widget is an example of handling asynchronous extraction and a missing result; adapt its loading and error display to your screen. Confirm the return behavior against the package API version in your project.
Select a particular frame
Set timeMs to the desired position in milliseconds. For example, to request a frame approximately five seconds into the video, add timeMs: 5000 to the call. Choose a position that exists in the video; a timestamp beyond its duration cannot provide the intended frame. The package exposes the timestamp option, but the source documentation does not establish identical handling of out-of-range times across media and platforms.
Save the thumbnail as an image file
Use thumbnailFile when another part of your app needs a file path rather than bytes. The package example uses path_provider to get a temporary directory; add that dependency if you use this approach.
import 'package:path_provider/path_provider.dart';
import 'package:video_thumbnail/video_thumbnail.dart';
Future<String?> createThumbnailFile(String videoPath) async {
final directory = await getTemporaryDirectory();
return VideoThumbnail.thumbnailFile(
video: videoPath,
thumbnailPath: directory.path,
imageFormat: ImageFormat.JPEG,
maxWidth: 320,
quality: 80,
);
}
The method returns a path when it creates the image; handle a null result if the API version in your app permits one. A temporary directory is appropriate for transient previews, not a promise of permanent storage. If the thumbnail must outlive temporary files, choose a storage location and cleanup policy suited to your app.
Rank #2
- 4K & 64MP Video Camera Camcorder: Capture life in breathtaking detail with 4K Ultra HD recording and vibrant 64MP photos, powered by an advanced high-sensitivity CMOS sensor. Equipped for exploring the beautiful world, this video camera is your perfect companion! Ideal for video recording, travel vlogs, family activities, interviews, studying, and cherishing precious moments
- 18X Digital Zoom & Infrared Night Vision: This 4K camcorder powerful 18x digital zoom brings distant action right to you. Capture clear details of people and landscapes. With the push of “OK” button, activate the IR cut filter. This night vision camcorder delivers high-contrast black & white video in total darkness, providing a clearer image than standard low-light color mode
- 3.0 Inches Touchscreen with 270° Rotation: This camcorder features a brilliant 3-inch touchscreen that puts complete control in your hands. The screen rotates a full 270 degrees, making it a game-changer for vloggers. Easily frame yourself for solo shots, capture high-angle overhead videos, or get creative low-angle perspectives
- Webcam & Remote Control: Instantly transform your camcorder into webcam with a single USB cable. No complex drivers needed. Just connect and ready to go. Elevate your live streams and professional presentations with stunning 4K clarity. This video camera comes with a handy wireless remote to start/stop recording, and take photos without ever touching the device—ideal for solo creators, vloggers, and group shots
- Multifunctional Camcorder: This 4K camcorder is loaded with pro features. Like face detection, video pause, slow motion, continuous shooting, time-lapse, self-timer, recording while charging, date stamp. Resulting in consistently smooth, sharp, and stunning footage in every scene. The two high-capacity batteries and 32GB micro SD card ensure that you won't miss a single beautiful moment in life
Use a remote video URL
The package documents URL input on Android and iOS, and its example passes the URL to thumbnailFile. Encode the URL correctly before passing it; this matters especially when it contains query parameters or reserved characters. The API also accepts optional request headers, which can be relevant when the media server requires them.
final path = await VideoThumbnail.thumbnailFile(
video: encodedVideoUrl,
thumbnailPath: outputDirectory,
imageFormat: ImageFormat.JPEG,
maxWidth: 320,
quality: 80,
headers: requestHeaders,
);
Here, encodedVideoUrl, outputDirectory, and requestHeaders are values supplied by your app. Do not assume a protected or expiring video URL will work without the required encoding and headers. Test against the actual server and authentication flow you ship.
Recommended Free Tools
Generate a thumbnail from a bundled asset
A Flutter asset key is not itself the video file path used in the package example. Read the asset bytes, write them to a temporary file, then pass that file path to the thumbnail method. Declare the video in your app’s assets as usual.
import 'dart:io';
import 'package:flutter/services.dart';
import 'package:path_provider/path_provider.dart';
import 'package:video_thumbnail/video_thumbnail.dart';
Future<String?> thumbnailFromAsset() async {
const assetKey = 'assets/sample.mp4';
final data = await rootBundle.load(assetKey);
final directory = await getTemporaryDirectory();
final videoFile = File('[${directory.path}/sample.mp4');
await videoFile.writeAsBytes(data.buffer.asUint8List());
return VideoThumbnail.thumbnailFile(
video: videoFile.path,
thumbnailPath: directory.path,
imageFormat: ImageFormat.JPEG,
maxWidth: 320,
quality: 80,
);
}
Replace the asset key and filenames with values in your project. This stages both the input video and generated thumbnail in temporary storage. Account for their cleanup and storage needs rather than treating temporary files as permanent app data.
Set format, dimensions, and quality deliberately
Format
The package lists JPEG, PNG, and WebP output. JPEG is the format used in the examples above. Its package page flags a possible performance issue with WebP generation using libwebp on iOS; if WebP matters to your app, verify generation on your target iOS devices instead of assuming performance matches JPEG or other platforms.
Dimensions and aspect ratio
Use a maximum width or height to control thumbnail size. The package warns that setting both maxWidth and maxHeight behaves differently on Android: it scales to both specified dimensions. If preserving the source aspect ratio matters, start by setting just one maximum dimension, then inspect the result on each platform you support.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteRank #3
- Latest 8K Video Camera with Remote Control : This Video camera features 8K video resolution at 15FPS, with additional options for 6K at 30FPS, 5K at 30FPS, 4K at 30FPS, 1080P at 60FPS/30FPS, 720P at 60FPS/30FPS. With an impressive 88MP image resolution and 18X digital zoom, this camcorder delivers exceptional visuals. The included remote control allows for effortless self-recording and photography from any angle, making it an ideal 8K vlogging camera for bloggers and content creators.
- Experience Smooth and Stable Footage with Our 8K Camcorder : Featuring advanced 6-Axis anti-shake technology for high-precision stabilization. The 3-inch, 270-degree rotatable touch screen allows for effortless self-recording and framing, making it perfect for vlogging and self-blogging. Additionally, the digital video camera's intuitive interface and user-friendly navigation ensure easy operation, so you can focus on capturing stunning 8K video and photos.
- Infrared Night Vision Video Camera with WiFi : Stay connected and share your moments instantly with our 8K Camera's built-in Wi-Fi and companion app "iSmart DV2". Download the app on your Android/iOS device to easily transfer photos/videos, and share them directly to social media platforms like Facebook and YouTube. Additionally, this camera features infrared night vision, allowing you to capture footage in low-light environments, producing clear black and white images even in complete darkness.
- Dual-Functionality and Enhanced Audio : This 8K video camera for YouTube doubles as a high-quality webcam, simply connect via USB and switch to "Webcam" mode for seamless video calling, live streaming, vlogging, and online teaching. The included external X-Y stereo microphone reduces ambient noise and captures clear, stable audio, ensuring professional-grade sound quality for your recordings.
- Versatile camcorders video camera 8k for Every Adventure: This multifunctional camera features a range of creative modes, including continuous shooting, time-lapse, slow motion, and recording while charging. Perfect for capturing life's adventures, whether you're traveling, camping, hiking, or enjoying your favorite sports. Plus, our dedicated team is available to provide technical support, troubleshooting, and answers to any questions you may have after your purchase.
Quality
The quality option lets you select a quality value for output. The example uses 80, but that is a starting setting, not a universal optimum. Compare image appearance and file size using representative videos and the formats your app needs.
Choose a package for your target platforms
video_thumbnail 0.5.6 documents Android and iOS. If you need other targets, compare its platform coverage with flutter_video_thumbnail_plus, documented as version 1.0.7. Its page describes file and data methods on Android, iOS, macOS, and Windows, plus a byte-array method on Web. Those are package-publisher claims, not independent compatibility validation.
| Package | Documented platform/API coverage | Considerations |
|---|---|---|
video_thumbnail 0.5.6 |
Android and iOS; byte and file output methods | URL input, timestamp, dimensions, format, quality, and optional headers are documented. The package page notes a possible WebP performance issue on iOS. |
flutter_video_thumbnail_plus 1.0.7 |
File/data methods on Android, iOS, macOS, and Windows; byte-array method on Web | The publisher describes Swift Package Manager or CocoaPods options for iOS/macOS and says Windows WebP output falls back to PNG. Verify actual integration and format behavior in your project. |
Package version and declared platform support do not guarantee compatibility with every Flutter, Dart, operating-system, codec, or dependency-manager version. Check the package pages and changelogs, then build and run on the exact platforms you intend to ship. Flutter explains how packages and plugins are integrated in its package and plugin guide; adding native plugin code can require a full restart rather than hot reload.
Troubleshoot common thumbnail problems
- No image or a null result: check that the video path or URL is valid and accessible, that the requested time is within the video, and that the caller handles a missing result. Log the input type and failure details without exposing sensitive URLs or headers.
- Remote extraction fails: encode the URL properly and provide the request headers the server requires. Test the same media URL and authorization conditions used by the app.
- The image looks stretched or cropped: avoid setting both maximum dimensions until you have tested their behavior on Android. Try one maximum dimension and inspect the output aspect ratio.
- WebP is slow on iOS: the package page flags a possible performance issue. Profile on the devices and media that matter, or test another listed output format.
- Plugin changes do not appear after adding the dependency: perform a full app restart and confirm the native build completes. Flutter’s plugin guidance notes that native plugin code may require one.
- Bundled asset is not found as a video: load its bytes with
rootBundle, write them to a file, and pass that file path; the documented example does not pass an asset key directly.
Performance and reliability checks
Video decoding and thumbnail generation involve platform functionality. Flutter’s plugin-development guidance says longer-running native functions should use a helper isolate to avoid dropping frames. That is general Flutter guidance, not evidence that this particular package blocks the UI or a benchmark of its extraction time. Measure your actual app rather than assuming extraction is instantaneous.
- Test short and long videos, the timestamps your interface requests, and the formats you plan to ship.
- Exercise local files, remote URLs, and authenticated requests separately; they have different failure points.
- Test Android and iOS independently, especially if setting both size limits or using WebP.
- Keep temporary input and output files under an explicit lifecycle policy if your app creates them.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server, not a Flutter video-frame extractor. Use it when your task is to capture a web page, not to generate a thumbnail from a video file. Its API returns a screenshot or PDF, and a single request can capture a page such as Stripe:
Quick Recap
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for setup. ScreenshotNeo removes cookie banners, popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed; and its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots per month with no card, and paid plans start at $5 for 3,000. Learn about ScreenshotNeo or sign up free.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




