video_thumbnail 0.1.5+1

video_thumbnail #

This plugin generates thumbnail from video file or URL. It returns image in memory or writes into a file. It offers rich options to control the image format, resolution and quality. Supports iOS and Android.

pub ver license

video-file video-url

Methods #

functionparameterdescriptionreturn
thumbnailDataString [video], ImageFormat [imageFormat](JPEG/PNG/WEBP), int [maxHeightOrWidth](0: for the original resolution of the video), int [quality](0-100)generates thumbnail from [video][Future<Uint8List>]
thumbnailFileString [video], String [thumbnailPath](folder or full path where to store the thumbnail file, null to save to same folder as the video file), ImageFormat [imageFormat](JPEG/PNG/WEBP), int [maxHeightOrWidth](0: for the original resolution of the video), int [quality](0-100)creates a file of the thumbnail from the [video][Future<String>]

Usage #

Installing add video_thumbnail as a dependency in your pubspec.yaml file.

dependencies:
  video_thumbnail: ^0.1.5+1

import

import 'package:video_thumbnail/video_thumbnail.dart';

Generate a thumbnail in memory from video file

final uint8list = await VideoThumbnail.thumbnailData(
  video: videofile.path,
  imageFormat: ImageFormat.JPEG,
  maxHeightOrWidth: 128,
  quality: 25,
);

Generate a thumbnail file from video URL

final uint8list = await VideoThumbnail.thumbnailFile(
  video: "https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4",
  thumbnailPath: (await getTemporaryDirectory()).path,
  imageFormat: ImageFormat.WEBP,
  maxHeightOrWidth: 0, // the original resolution of the video
  quality: 75,
);

Notes #

Fork or pull requests are always welcome. Currently it seems have a little performance issue while generating WebP thumbnail by using libwebp under iOS.

0.1.5+1 #

  • Minor updates

0.1.5 #

  • Add repository and issue tracker link and bump version to 0.1.5

0.1.3+5 #

  • Fix compiler warning

0.1.3+4 #

  • Fix "src/dsp/dsp.h" couldn't find issue due to Podfile has "use_frameworks!"

0.1.3+3 #

  • Fix the screen shots url issue

0.1.3+2 #

  • Add some screen shots

0.1.3 #

  • Bump the version

0.0.3 #

  • Add test case

0.0.2 #

  • Add webp support for iOS

0.0.1 #

  • initial release for this flutter plugin.

example/README.md

video_thumbnail_example #

Demonstrates how to use the video_thumbnail plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  video_thumbnail: ^0.1.5+1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:video_thumbnail/video_thumbnail.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
86
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
93
Learn more about scoring.

We analyzed this package on Sep 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test