パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細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を使用して動画サムネイルを生成するFlutterプラグインです。システムレベルの機能を活用して、動画からフレームを効率的に抽出し、各プラットフォーム間での高パフォーマンスと互換性を確保します。クロスプラットフォームの画像処理ライブラリに頼らず、信頼できるサムネイル作成が必要な開発者向けに設計されています。動画プレビューまたはメディアブラウジング機能を必要とするFlutterアプリへのシームレスな統合が可能です。

用途

  • メディアギャラリーで動画プレビューを生成する
  • 動画再生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

ソースリポジトリ

このパッケージを使用しているプロジェクト