패키지, 저장소 및 앱 카테고리 검색

패키지 상세v4.0.0

fc_native_video_thumbnail

네이티브 API를 통해 비디오 썸네일을 생성하는 Flutter 플러그인입니다.

AndroidiOSmacOSWindows
30일 다운로드
3.8만
좋아요
48
Pub 점수
160

패키지 설치

flutter pub add fc_native_video_thumbnail

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Android, iOS, macOS 및 Windows에서 네이티브 플랫폼 API를 사용하여 비디오 썸네일을 생성하는 플러터 플러그인입니다. 시스템 수준 기능을 활용하여 비디오에서 프레임을 효율적으로 추출하여 다양한 플랫폼 간 높은 성능과 호환성을 보장합니다. 크로스플랫폼 이미지 처리 라이브러리에 의존하지 않고 신뢰할 수 있는 썸네일 생성이 필요한 개발자를 위한 것입니다. 비디오 미리보기 또는 미디어 브라우징 기능을 필요로 하는 플러터 앱에 원활하게 통합될 수 있습니다.

사용 사례

  • 미디어 갤러리에서 비디오 미리보기 생성
  • 비디오 재생 UI용 썸네일 만들기
  • 비디오 업로드 또는 편집 인터페이스 구축
  • 빠른 비디오 메타데이터 추출 활성화
  • 오프라인 비디오 콘텐츠 인덱싱 지원

주요 기능

  • 최적의 성능을 위해 네이티브 API를 사용
  • 크로스 플랫폼 지원 (Android, iOS, macOS, Windows)
  • 프레임 추출을 위한 간단한 API
  • 고품질 썸네일 생성
  • 최소 종속성 오버헤드

적합한 대상

  • 미디어 앱 개발자
  • 비디오 스트리밍 애플리케이션
  • 콘텐츠 관리 시스템
  • 교육적 또는 창의적인 도구
  • 비디오 라이브러리 기능을 갖춘 앱

고려 사항

  • Android 및 iOS에서 플랫폼별 권한이 필요합니다
  • 비디오 코덱 또는 형식에 따라 결과가 달라질 수 있습니다
  • 미리보기 출력에 대한 사용자 정의 제한
  • 네이티브 SDK 사용 가능 여부에 따라 다릅니다
  • 실시간 썸네일 생성에 적합하지 않습니다

원본 README

연결된 소스 저장소의 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
);

카테고리

의존성

의존성 목록 1 개

  • plugin_platform_interface^2.0.2

소스 저장소

이 패키지를 사용하는 프로젝트