All Projects → justsoft → video_thumbnail

justsoft / video_thumbnail

Licence: MIT license
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.

Programming Languages

dart
5743 projects
java
68154 projects - #9 most used programming language
objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to video thumbnail

Lilliput
Resize images and animated GIFs in Go
Stars: ✭ 1,690 (+962.89%)
Mutual labels:  png, jpeg, webp, thumbnail
Metadata Extractor Dotnet
Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Stars: ✭ 518 (+225.79%)
Mutual labels:  png, jpeg, webp
Next Img
A Next.js plugin for embedding optimized images.
Stars: ✭ 149 (-6.29%)
Mutual labels:  png, jpeg, webp
Libvips
A fast image processing library with low memory needs.
Stars: ✭ 6,094 (+3732.7%)
Mutual labels:  png, jpeg, webp
Automator Workflows
A collection of Automator workflows (services) that speed up your design / development process. Compatible with LaunchBar 6 and 7 Actions
Stars: ✭ 439 (+176.1%)
Mutual labels:  png, jpeg, webp
Govips
A lightning fast image processing and resizing library for Go
Stars: ✭ 442 (+177.99%)
Mutual labels:  png, jpeg, webp
Optimizt
CLI image optimization tool
Stars: ✭ 594 (+273.58%)
Mutual labels:  png, jpeg, webp
yoga-image-optimizer
A graphical tool to convert and optimize JPEG, PNG and WebP images (based on YOGA)
Stars: ✭ 85 (-46.54%)
Mutual labels:  png, jpeg, webp
Pixterm
Draw images in your ANSI terminal with true color
Stars: ✭ 782 (+391.82%)
Mutual labels:  png, jpeg, webp
Tiny Site
图片优化
Stars: ✭ 65 (-59.12%)
Mutual labels:  png, jpeg, webp
Imageprocessor
📷 A fluent wrapper around System.Drawing for the processing of image files.
Stars: ✭ 2,452 (+1442.14%)
Mutual labels:  png, jpeg, webp
Mort
Storage and image processing server written in Go
Stars: ✭ 420 (+164.15%)
Mutual labels:  png, jpeg, webp
Sharp
High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.
Stars: ✭ 21,131 (+13189.94%)
Mutual labels:  png, jpeg, webp
Metadata Extractor
Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Stars: ✭ 1,972 (+1140.25%)
Mutual labels:  png, jpeg, webp
Imaginary
Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing
Stars: ✭ 4,107 (+2483.02%)
Mutual labels:  png, jpeg, webp
Sdwebimage
Asynchronous image downloader with cache support as a UIImageView category
Stars: ✭ 23,928 (+14949.06%)
Mutual labels:  png, jpeg, webp
create-optimize-images
♻️ Reusable, scalable, bash scripts to create and optimize images.
Stars: ✭ 39 (-75.47%)
Mutual labels:  png, jpeg, webp
imagor
Fast, Docker-ready image processing server in Go and libvips
Stars: ✭ 2,276 (+1331.45%)
Mutual labels:  png, jpeg, webp
Flyimg
Dockerized PHP7 application runs as a Microservice to resize and crop images on the fly. Get optimised images with MozJPEG, WebP or PNG using ImageMagick. Includes face detection, cropping, face blurring, image rotation and many other options. Abstract storage based on FlySystem in order to store images on any provider (local, AWS S3...).
Stars: ✭ 762 (+379.25%)
Mutual labels:  png, jpeg, webp
Optimise Images
Batch image resizer, optimiser and profiler using ImageMagick convert, OptiPNG, JpegOptim and optional ZopfliPNG, Guetzli and MozJPEG.
Stars: ✭ 64 (-59.75%)
Mutual labels:  png, jpeg, webp

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

function parameter description return
thumbnailData String [video], optional Map<String, dynamic> [headers], ImageFormat [imageFormat](JPEG/PNG/WEBP), int [maxHeight](0: for the original resolution of the video, or scaled by the source aspect ratio), [maxWidth](0: for the original resolution of the video, or scaled by the source aspect ratio), int [timeMs]generates the thumbnail from the frame around the specified millisecond, int[quality]`(0-100) generates thumbnail from [video] [Future<Uint8List>]
thumbnailFile String [video], optional Map<String, dynamic> [headers], 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 [maxHeight](0: for the original resolution of the video, or scaled by the source aspect ratio), int [maxWidth](0: for the original resolution of the video, or scaled by the source aspect ratio), int [timeMs] generates the thumbnail from the frame around the specified millisecond, int [quality](0-100) creates a file of the thumbnail from the [video] [Future<String>]

Warning:

Giving both the maxHeight and maxWidth has different result on Android platform, it actually scales the thumbnail to the specified maxHeight and maxWidth. To generate the thumbnail from a network resource, the video must be properly URL encoded.

Usage

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

dependencies:
  video_thumbnail: ^0.5.3

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,
  maxWidth: 128, // specify the width of the thumbnail, let the height auto-scaled to keep the source aspect ratio
  quality: 25,
);

Generate a thumbnail file from video URL

final fileName = await VideoThumbnail.thumbnailFile(
  video: "https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4",
  thumbnailPath: (await getTemporaryDirectory()).path,
  imageFormat: ImageFormat.WEBP,
  maxHeight: 64, // specify the height of the thumbnail, let the width auto-scaled to keep the source aspect ratio
  quality: 75,
);

Generate a thumbnail file from video Assets declared in pubspec.yaml

final byteData = await rootBundle.load("assets/my_video.mp4");
Directory tempDir = await getTemporaryDirectory();

File tempVideo = File("${tempDir.path}/assets/my_video.mp4")
  ..createSync(recursive: true)
  ..writeAsBytesSync(byteData.buffer.asUint8List(byteData.offsetInBytes, byteData.lengthInBytes));

final fileName = await VideoThumbnail.thumbnailFile(
  video: tempVideo.path,
  thumbnailPath: (await getTemporaryDirectory()).path,
  imageFormat: ImageFormat.PNG,  
  quality: 100,
);

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].