@bgoodman/video-preview
TypeScript icon, indicating that this package has built-in type declarations

1.1.9-beta • Public • Published

@bgoodman/video-preview

Installation

Requires ffmpeg.

You may already have it; check via ffmpeg -version

npm install @bgoodman/video-preview

yarn add @bgoodman/video-preview

Usage

import videoPreview from "@bgoodman/video-preview"

API

videoPreview

videoPreview(input: string, output: string, opts?: VideoPreviewOptions): Promise<{output: string, stdout: string, stderr: string}>

Saves a slice of video to file.

Parameters:

Name Type Description
input string filepath of input video.
output string filepath of preview.

Options:

Name Default Description
overwrite true overwrite output file if exists.
duration 5 specify length of preview (seconds)
scale.width -1 set x-axis scale (px). Default leaves output unchanged.
scale.height -2 set y-axis scale (px). Default preserves aspect ratio, rounding to a factor of 2.

Package Sidebar

Install

npm i @bgoodman/video-preview

Weekly Downloads

13

Version

1.1.9-beta

License

MIT

Unpacked Size

46.3 kB

Total Files

58

Last publish

Collaborators

  • bgoodman