Pakete, Repositories und App-Kategorien suchen

Paketdetailsv4.0.0

fc_native_video_thumbnail

Ein Flutter-Plugin zum Erstellen von Videobildern über native APIs.

AndroidiOSmacOSWindows
30-Tage-Downloads
38.200
Likes
48
Pub-Punkte
160

Paket installieren

flutter pub add fc_native_video_thumbnail

Paketübersicht

Aus öffentlichen Paketdaten erstellte Orientierung.

Ein Flutter-Plugin, das Videobilder mithilfe nativer Plattform-APIs auf Android, iOS, macOS und Windows erstellt. Es nutzt systemnahe Funktionen, um Frames aus Videos effizient zu extrahieren und so hohe Leistung und Kompatibilität über alle Plattformen hinweg sicherzustellen. Das Plugin ist für Entwickler konzipiert, die eine zuverlässige Erstellung von Miniaturbildern benötigen, ohne sich auf plattformübergreifende Bildverarbeitungsbibliotheken verlassen zu müssen. Es lässt sich nahtlos in Flutter-Anwendungen integrieren, die Video-Vorschau- oder Medien-Browsing-Funktionen erfordern.

Anwendungsfälle

  • Videovorschauen in Medien-Galerien generieren
  • Erstellen von Miniaturansichten für Video-Wiedergabe-UIs
  • Video-Upload- oder -Bearbeitungsschnittstellen erstellen
  • Schnelle Video-Metadatenextraktion aktivieren
  • Unterstützung der Offline-Videoinhaltsindizierung

Hauptmerkmale

  • Verwendet native APIs für optimale Leistung
  • Plattformübergreifende Unterstützung (Android, iOS, macOS, Windows)
  • Einfache API für Frame-Auszug
  • Hochwertige Thumbnail-Erstellung
  • Minimale Abhängigkeitsüberhead

Geeignet für

  • Medien-App-Entwickler
  • Video-Streaming-Anwendungen
  • Content-Management-Systeme
  • Bildung oder kreative Werkzeuge
  • Apps mit Videobibliotheks-Funktionen

Hinweise

  • Erfordert plattformspezifische Berechtigungen unter Android und iOS
  • Ergebnisse können je nach Video-Codec oder Format variieren
  • Begrenzte Anpassung der Miniaturausgabe
  • Abhängig von der Verfügbarkeit des nativen SDKs
  • Nicht geeignet für die Echtzeit-Thumbnail-Erzeugung

Original-README

Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.

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

Kategorien

Abhängigkeiten

Abhängigkeiten 1 Einträge

  • plugin_platform_interface^2.0.2

Quell-Repository

Projekte, die dieses Paket verwenden