Installations
npm install ffmpeg-progress-wrapper
Developer Guide
Typescript
Yes
Module System
CommonJS
Min. Node Version
>=8.9.0
Node Version
12.9.0
NPM Version
6.14.8
Score
72.6
Supply Chain
99.4
Quality
76.2
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
legraphista
Download Statistics
Total Downloads
49,454
Last Day
13
Last Week
95
Last Month
566
Last Year
9,608
GitHub Statistics
16 Stars
64 Commits
7 Forks
5 Watching
4 Branches
3 Contributors
Bundle Size
14.52 kB
Minified
5.49 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.0.1
Package Id
ffmpeg-progress-wrapper@2.0.1
Unpacked Size
44.25 kB
Size
12.72 kB
File Count
16
NPM Version
6.14.8
Node Version
12.9.0
Total Downloads
Cumulative downloads
Total Downloads
49,454
Last day
-75.9%
13
Compared to previous day
Last week
-37.9%
95
Compared to previous week
Last month
0.4%
566
Compared to previous month
Last year
6.4%
9,608
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
3
Dev Dependencies
3
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
1import {FFMpegProgress} from 'ffmpeg-progress-wrapper'; 2new FFMpegProgress(args, 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
1const {FFMpegProgress} = require('ffmpeg-progress-wrapper'); 2// or 3import {FFMpegProgress} from 'ffmpeg-progress-wrapper'; 4 5(async () => { 6 7 const process = new FFMpegProgress(['-i', 'test.mov' ,'test output.mp4']); 8 9 process.on('raw', console.log); 10 11 process.once('details', (details) => console.log(JSON.stringify(details)); 12 13 process.on('progress', (progress) => console.log(JSON.stringify(progress)); 14 15 process.once('end', console.log.bind(console, 'Conversion finished and exited with code')); 16 17 process.done(console.log); 18 19 await process.onDone(); 20 21})(); 22/** 23{ 24 duration: 216, 25 bitrate: 36864, 26 start: 0, 27 resolution: { width: 320, height: 240 }, 28 fps: 25 29} 30{ 31 drop: 0, 32 dup: 0, 33 frame: 1366, 34 time: 52.480078, 35 speed: 105, 36 fps: 0, 37 eta: 1.5573325904761905, 38 progress: 0.24296332407407406, 39 quality: [ [ 28 ] ], 40 psnr: [ [ { y: NaN, u: NaN, v: NaN, all: NaN } ] ], 41 size: 36, 42 bitrate: 0 43} 44{ 45 drop: 0, 46 dup: 0, 47 frame: 2700, 48 time: 105.840078, 49 speed: 106, 50 fps: 2696.44, 51 eta: 1.0392445471698113, 52 progress: 0.4900003611111111, 53 quality: [ [ 28 ] ], 54 psnr: [ [ { y: NaN, u: NaN, v: NaN, all: NaN } ] ], 55 size: 262180, 56 bitrate: 20275.2 57} 58{ 59 drop: 0, 60 dup: 0, 61 frame: 4138, 62 time: 163.360078, 63 speed: 109, 64 fps: 2756.01, 65 eta: 0.4829350642201836, 66 progress: 0.7562966574074074, 67 quality: [ [ 28 ] ], 68 psnr: [ [ { y: NaN, u: NaN, v: NaN, all: NaN } ] ], 69 size: 524324, 70 bitrate: 26316.8 71} 72{ 73 drop: 0, 74 dup: 0, 75 frame: 5423, 76 time: 216.800078, 77 speed: 110, 78 fps: 2747.61, 79 eta: 0, 80 progress: 1.0037040648148148, 81 quality: [ [ -1 ] ], 82 psnr: [ [ { y: Infinity, u: Infinity, v: Infinity, all: Infinity } ] ], 83 size: 977469, 84 bitrate: 36966.4 85} 86Conversion finished and exited with code 0 null 87*/
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
2 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx
- Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 1/29 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 2 are checked with a SAST tool
Score
2.8
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More