FLUTTER ECOSYSTEM

flutter-cavalry/fc_native_video_thumbnail

네이티브 API를 통해 비디오 썸네일을 생성하는 플러터 플러그인

fc_native_video_thumbnail 프로젝트 이미지
Stars
22
Forks
11
최근 푸시(UTC)
2026. 9. 12.
프로젝트 상태
활성
Flutter Cavalry GitHub avatar
GITHUB Organization

Flutter Cavalry ↗

We are commited to port high-quality packages to Dart / Flutter community

언어C++CMakeDartSwiftKotlinCRubyObjective-C

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 4 개
  • flutter{"sdk":"flutter"}
  • plugin_platform_interface^2.0.2
  • flutter_test개발 의존성{"sdk":"flutter"}
  • flutter_lints개발 의존성^6.0.0

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

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
);