FFMPEG Progress Wrapper
Wraps your ffmpeg raw command line with a nice progress interface
Installation
$ npm install ffmpeg-progress-wrapper
$ yarn ffmpeg-progress-wrapper
Use cases
- Provides a progress status for your video without you having to guess the frame count
- Provides duration and bitrate of the file
Usage
Constructor
;new FFMpegProgressargs, options;
- args:
string[]
- List of string arguments - options?:
object
- optional- cmd?:
string
- path to ffmpeg (defaults to ffmpeg from PATH) - cwd?:
string
- working dir (defaults to current working dir) - env?:
ProcessEnv
- environment vars (defaults to process.env) - duration?:
number
- output duration in seconds (default is determined from file)
useful when using complex filters and the input time differs from output - hideFFConfig?:
boolean
- hide ffmpeg config from stderr (default false) - maxMemory?:
number
- max amount of bytes allowed by the process to use before killing for OOM (default unset)
- cmd?:
FFMpegProgress.on('progress')
- progressData:
object
- eta:
number | null
- time left to process in seconds - speed:
number | null
- processed output time / real time (2x - twice realtime, 0.5x - half realtime) - fps:
number | null
- time:
number | null
- current output time in seconds - frame:
number | null
- current output frame - progress:
number | null
- progress percentage (from 0 to 1) - drop:
number
- dropped frames - dup:
number
- duplicated frames - quality:
number[][]
- stream quality per frame, per stream - psnr:
{ y: number | null, u: number | null, v: number | null, all: number | null }[][]
- stream psnr per file, per stream, per channel (enabled via-psnr
ffmpeg arg) - size:
number | null
- output file size - bitrate:
number | null
- output file bitrate in bytes
- eta:
FFMpegProgress.on('raw')
- Fires whenever ffmpeg outputs text - very volatile
- raw:
string
FFMpegProgress.on('details')
- Fires once per command, at the beginning
- details:
object
- duration:
number
- video duration in seconds - bitrate:
number
- video bitrate in bytes - start:
number
- video's first frame time in seconds
- duration:
Example
const FFMpegProgress = ;// or; async { const process = '-i' 'test.mov' 'test output.mp4'; process; process