Convenience method to get metadata and thumbnails of HTML5 video or audio(only metadata) Blob.
npm install video-metadata-thumbnailsConvenience method(or Video object) to get metadata and thumbnails of HTML5 video Blob.
English | 简体中文
- Microsoft Edge
- Google Chrome
- Safari(Not perfect)
- need to wait for the video to finish playing
- can't use all parameters
- Firfox(Not perfect)
- need to wait for the video to finish playing
- can't use all parameters
| 
Edge | 
Chrome | 
Safari | 
Firefox |
| --- | --- | --- | --- |
| last 2 versions | last 2 versions | last 2 versions | last 2 versions |
``shell`
npm install --save video-metadata-thumbnails
or
``
yarn add video-metadata-thumbnails
Add video-metadata-thumbnails.iife.js to your document and get the metadata or thumbnails value of the promise returned by then:
`html`
Alternatively, you can import(or require) video-metadata-thumbnails by getting it from npm :
`javascript`
import { getMetadata, getThumbnails } from 'video-metadata-thumbnails';
const metadata = await getMetadata(blob);
const thumbnails = await getThumbnails(blob, {
quality: 0.6
});
console.log('Metadata: ', metadata);
console.log('Thumbnails: ', thumbnails);$3
Import(or require) video-metadata-thumbnails by getting it from npm
` javascript
import { Video } from 'video-metadata-thumbnails';
const video = new Video(blob);
console.log('Metadata:', await video.getMetadata());
console.log('Thumbnails:', await video.getThumbnails({
quality: 0.6
}))
`
* quality
* type: number
* default: 0.7
* description: video thumbnails' quality
* interval
* type: number
* default: 1
* description: time interval
* scale
* type: number
* default: 0.7
* description: video thumbnails' scale
* start
* type: number
* default: 0
* description: start frame
* end
* type: number
* default: 0
* description: the end of frame

Blob` object is required in browser.
Copyright (c) 2020-present, Weiwei Wang