Search packages, repositories and app categories

Package detailsv4.0.0

fc_native_video_thumbnail

A Flutter plugin to create video thumbnails via native APIs.

AndroidiOSmacOSWindows
30-day downloads
38.2K
Likes
48
Pub points
160

Install package

flutter pub add fc_native_video_thumbnail

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter plugin that generates video thumbnails using native platform APIs on Android, iOS, macOS, and Windows. It leverages system-level functionality to efficiently extract frames from videos, ensuring high performance and compatibility across platforms. The plugin is designed for developers needing reliable thumbnail creation without relying on cross-platform image processing libraries. It integrates seamlessly into Flutter apps requiring video previews or media browsing features.

Use cases

  • Generating video previews in media galleries
  • Creating thumbnails for video playback UIs
  • Building video upload or editing interfaces
  • Enabling fast video metadata extraction
  • Supporting offline video content indexing

Key features

  • Uses native APIs for optimal performance
  • Cross-platform support (Android, iOS, macOS, Windows)
  • Simple API for frame extraction
  • High-quality thumbnail generation
  • Minimal dependency overhead

Suitable for

  • Media app developers
  • Video streaming applications
  • Content management systems
  • Educational or creative tools
  • Apps with video library features

Considerations

  • Requires platform-specific permissions on Android and iOS
  • May have varying results based on video codec or format
  • Limited customization of thumbnail output
  • Depends on native SDK availability
  • Not suitable for real-time thumbnail generation

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

fc_native_video_thumbnail

pub package

A Flutter plugin to create video thumbnails via native APIs.

iOS Android macOS Windows Linux
Source (Path) ✅ ✅ ✅ ✅ ✅
Source (Uri) ✅ ✅ ✅ - -
Seeking ✅ ⚠️ ✅ - ✅

⚠️ Android seeking is only supported when the source file is a Uri.

Linux requires libavformat, libavcodec, libavutil, libswscale (FFmpeg) and libjpeg installed on the system.

Usage

  • saveThumbnailToFile saves the thumbnail to a file path.
    • Returns true if thumbnail was successfully created. Or false if thumbnail is not available.
    • Throws if error happens during thumbnail generation.
  • saveThumbnailToBytes returns the thumbnail as a byte array.
    • Returns the thumbnail as bytes if successfully created. Or null if thumbnail is not available.
    • Throws if error happens during thumbnail generation.

Example:

final plugin = FcNativeVideoThumbnail();

try {
  /// Extracts a thumbnail from [srcFile] with the given options and saves it to [destFile].
  ///
  /// [srcFile] source video path or Uri (See [srcFileUri]).
  /// [srcFileUri] If true, [srcFile] is a Uri (Android/iOS/macOS only).
  /// [destFile] thumbnail save path.
  /// [width] / [height] max dimensions of the thumbnail image.
  ///   Windows doesn't support non-square thumbnail images, only [width] is used in Windows, resulting in a [width]x[width] max thumbnail.
  /// [format] only "jpeg" is supported. Defaults to "jpeg".
  /// [quality] a fallback value for the quality of the thumbnail image (0-100). May be ignored by the platform.
  /// [at] the time position of the thumbnail.
  ///   Not supported on Windows, or Android if source file is a path.
  final generated = await plugin.saveThumbnailToFile(
            srcFile: srcFile,
            destFile: destFile,
            width: 300,
            height: 300,
            quality: 90);

  // `saveThumbnailToBytes` has the same options as `saveThumbnailToFile` except `destFile`.
  final thumbnailBytes = await plugin.saveThumbnailToBytes(
            srcFile: srcFile,
            width: 300,
            height: 300,
            quality: 90);
} catch (err) {
  // Handle platform errors.
}
Seeking to a specific time position
await plugin.saveThumbnailToFile(
            srcFile: srcFile,
            destFile: destFile,
            width: 300,
            height: 300,
            quality: 90,
            // Seek to 13 seconds to create the thumbnail.
            at: FcVideoThumbnailTime(13, .seconds),
// Supported units:
// .seconds
// .milliseconds
// .microseconds
);

Categories

Dependencies

Dependency list 1 items

  • plugin_platform_interface^2.0.2

Source repository

Projects using this package