├── .gitignore ├── .npmignore ├── .travis.yml ├── LICENSE ├── README.md ├── index.js ├── package.json ├── temp └── .gitignore └── test ├── fixtures ├── background-001.jpg ├── background-002.jpg ├── background-003.jpg ├── background-004.jpg ├── background-005.jpg ├── background-006.jpg ├── background-007.jpg ├── background-008.jpg ├── background-009.jpg ├── background-010.jpg ├── background-011.jpg ├── background-012.jpg ├── background-013.jpg ├── background-014.jpg ├── background-015.jpg ├── background-016.jpg ├── background-017.jpg ├── background-018.jpg ├── background-019.jpg ├── background-020.jpg ├── background-021.jpg ├── background-022.jpg ├── background-023.jpg ├── background-024.jpg ├── background-025.jpg ├── background-026.jpg ├── background-027.jpg ├── background-028.jpg ├── background-029.jpg ├── background-030.jpg ├── background-031.jpg ├── background-032.jpg ├── background-033.jpg ├── background-034.jpg ├── background-035.jpg ├── background-036.jpg ├── background-037.jpg ├── background-038.jpg ├── background-039.jpg ├── background-040.jpg ├── background-041.jpg ├── background-042.jpg ├── background-043.jpg ├── background-044.jpg ├── background-045.jpg ├── background-046.jpg ├── background-047.jpg ├── background-048.jpg ├── background-049.jpg ├── background-050.jpg ├── background-051.jpg ├── background-052.jpg ├── background-053.jpg ├── background-054.jpg ├── background-055.jpg ├── background-056.jpg ├── background-057.jpg ├── background-058.jpg ├── background-059.jpg ├── background-060.jpg ├── background-061.jpg ├── background-062.jpg ├── background-063.jpg ├── background-064.jpg ├── background-065.jpg ├── background-066.jpg ├── background-067.jpg ├── background-068.jpg ├── background-069.jpg ├── background-070.jpg ├── background-071.jpg ├── background-072.jpg ├── background-073.jpg ├── background-074.jpg ├── background-075.jpg ├── background-076.jpg ├── background-077.jpg ├── background-078.jpg ├── background-079.jpg ├── background-080.jpg ├── background-081.jpg ├── background-082.jpg ├── background-083.jpg ├── background-084.jpg ├── background-085.jpg ├── background-086.jpg ├── background-087.jpg ├── background-088.jpg ├── background-089.jpg ├── background-090.jpg ├── background-091.jpg ├── background-092.jpg ├── background-093.jpg ├── background-094.jpg ├── background-095.jpg ├── background-096.jpg ├── background-097.jpg ├── background-098.jpg ├── background-099.jpg ├── background-100.jpg ├── background-101.jpg ├── background-102.jpg ├── background-103.jpg ├── background-104.jpg ├── background-105.jpg ├── background-106.jpg ├── background-107.jpg ├── background-108.jpg ├── background-109.jpg ├── background-110.jpg ├── background-111.jpg ├── background-112.jpg ├── background-113.jpg ├── background-114.jpg ├── background-115.jpg ├── background-116.jpg ├── background-117.jpg ├── background-118.jpg ├── background-119.jpg ├── background-120.jpg └── frame-count.mp4 └── index.js /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | .DS_Store 3 | node_modules/ 4 | npm-debug.log 5 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | test/fixtures/* 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Eugene Ware 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 3. Neither the name of Eugene Ware nor the names of its contributors 13 | may be used to endorse or promote products derived from this software 14 | without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY EUGENE WARE ''AS IS'' AND ANY 17 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL EUGENE WARE BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ffmpeg-progress-stream 2 | 3 | Generate a stream of progress events from the stderr stream of ffmpeg 4 | 5 | [![build status](https://secure.travis-ci.org/eugeneware/ffmpeg-progress-stream.png)](http://travis-ci.org/eugeneware/ffmpeg-progress-stream) 6 | 7 | ## Installation 8 | 9 | This module is installed via npm: 10 | 11 | ``` bash 12 | $ npm install ffmpeg-progress-stream 13 | ``` 14 | 15 | ## Example Usage 16 | 17 | Render some images into an mp4 file and see the progress stream of the 18 | rendering process: 19 | 20 | ``` js 21 | var ffmpegBin = require('ffmpeg-static'), 22 | progressStream = require('ffmpeg-progress-stream'); 23 | var params = [ 24 | '-y', 25 | '-r', 30, 26 | '-i', './files/frames*.jpg', 27 | '-pix_fmt', 'yuv420p', 28 | '-r', 30, 29 | '/tmp/out.mp4' 30 | ]; 31 | 32 | var ffmpeg = spawn(ffmpegBin.path, params); 33 | ffmpeg.stderr 34 | .pipe(progressStream(120)) 35 | .on('data', console.log); 36 | 37 | /** 38 | { frame: '56', 39 | fps: '0.0', 40 | q: '29.0', 41 | size: '58kB', 42 | time: '00:00:00.13', 43 | bitrate: '3586.4kbits/s', 44 | progress: 46.666666666666664, 45 | remaining: 0.6045714285714285 }, 46 | { frame: '78', 47 | fps: '75', 48 | q: '29.0', 49 | size: '238kB', 50 | time: '00:00:00.86', 51 | bitrate: '2248.1kbits/s', 52 | progress: 65, 53 | remaining: 0.5713076923076923 }, 54 | { frame: '99', 55 | fps: '64', 56 | q: '29.0', 57 | size: '405kB', 58 | time: '00:00:01.56', 59 | bitrate: '2116.6kbits/s', 60 | progress: 82.5, 61 | remaining: 0.33281818181818185 }, 62 | { frame: '120', 63 | fps: '39', 64 | q: '-1.0', 65 | Lsize: '935kB', 66 | time: '00:00:03.93', 67 | bitrate: '1946.7kbits/s', 68 | progress: 100, 69 | remaining: 0 } 70 | { frame: '120', 71 | fps: '39', 72 | q: '-1.0', 73 | Lsize: '935kB', 74 | time: '00:00:03.93', 75 | bitrate: '1946.7kbits/s', 76 | size: '935kB', 77 | progress: 100, 78 | remaining: 0 } 79 | */ 80 | ``` 81 | 82 | ## API 83 | ### progressStream(total) 84 | 85 | * `total` - total number of frames to expect. If this is present then the 86 | `progress` and `remaining` keys will be present on the progress stream. 87 | 88 | The `data` events emitted look like this: 89 | ``` js 90 | { frame: '99', 91 | fps: '64', 92 | q: '29.0', 93 | size: '405kB', 94 | time: '00:00:01.56', 95 | bitrate: '2116.6kbits/s', 96 | progress: 82.5, 97 | remaining: 0.33281818181818185 } 98 | ``` 99 | 100 | The `progress` is a percentage, and `remaining` is an estimate of the 101 | remaining time in seconds. 102 | 103 | NB: The last event has a key called `Lsize` instead of `size`. This is copied 104 | over to the `size` field for convenience. 105 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var stream = require('stream'), 2 | combine = require('stream-combiner2'), 3 | split = require('split2'); 4 | 5 | module.exports = progressStream; 6 | function progressStream(total) { 7 | var ts = stream.Transform({ objectMode: true }); 8 | var startTime = 0; 9 | ts._transform = function (chunk, enc, cb) { 10 | if (!startTime) { 11 | startTime = Date.now(); 12 | } 13 | 14 | var s = chunk.toString(); 15 | if (s.indexOf('frame=') === 0) { 16 | var info = s.split('\n')[0].trim().split(/[\s\=]+/); 17 | var status = {}; 18 | for (var i = 0; i < info.length; i += 2) { 19 | status[info[i]] = info[i+1]; 20 | } 21 | if (typeof status.Lsize !== 'undefined') { 22 | status.size = status.Lsize; 23 | } 24 | if (total > 0) { 25 | status.progress = status.frame / total * 100.00; 26 | var elapsed = Date.now() - startTime; 27 | var fps = status.frame / elapsed; 28 | var remaining = (total - status.frame)/fps; 29 | status.remaining = remaining / 1000; 30 | } 31 | this.push(status); 32 | } 33 | cb(); 34 | }; 35 | ts._flush = function (cb) { 36 | cb(); 37 | }; 38 | 39 | return combine.obj(split(/(\r|\r?\n)/), ts); 40 | } 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ffmpeg-progress-stream", 3 | "version": "1.2.1", 4 | "description": "Generate a stream of progress events from the stderr stream of ffmpeg", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "node_modules/.bin/mocha" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/eugeneware/ffmpeg-progress-stream" 12 | }, 13 | "keywords": [ 14 | "ffmpeg", 15 | "progress", 16 | "status", 17 | "stream", 18 | "streams", 19 | "streaming" 20 | ], 21 | "author": "Eugene Ware ", 22 | "license": "BSD-3-Clause", 23 | "bugs": { 24 | "url": "https://github.com/eugeneware/ffmpeg-progress-stream/issues" 25 | }, 26 | "dependencies": { 27 | "split2": "^2.1.0", 28 | "stream-combiner2": "^1.1.1" 29 | }, 30 | "devDependencies": { 31 | "concat-stream": "^1.4.7", 32 | "expect.js": "~0.3.0", 33 | "ffmpeg-static": "^1.0.0", 34 | "mocha": "~2.1.0" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /temp/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /test/fixtures/background-001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-001.jpg -------------------------------------------------------------------------------- /test/fixtures/background-002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-002.jpg -------------------------------------------------------------------------------- /test/fixtures/background-003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-003.jpg -------------------------------------------------------------------------------- /test/fixtures/background-004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-004.jpg -------------------------------------------------------------------------------- /test/fixtures/background-005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-005.jpg -------------------------------------------------------------------------------- /test/fixtures/background-006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-006.jpg -------------------------------------------------------------------------------- /test/fixtures/background-007.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-007.jpg -------------------------------------------------------------------------------- /test/fixtures/background-008.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-008.jpg -------------------------------------------------------------------------------- /test/fixtures/background-009.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-009.jpg -------------------------------------------------------------------------------- /test/fixtures/background-010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-010.jpg -------------------------------------------------------------------------------- /test/fixtures/background-011.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-011.jpg -------------------------------------------------------------------------------- /test/fixtures/background-012.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-012.jpg -------------------------------------------------------------------------------- /test/fixtures/background-013.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-013.jpg -------------------------------------------------------------------------------- /test/fixtures/background-014.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-014.jpg -------------------------------------------------------------------------------- /test/fixtures/background-015.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-015.jpg -------------------------------------------------------------------------------- /test/fixtures/background-016.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-016.jpg -------------------------------------------------------------------------------- /test/fixtures/background-017.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-017.jpg -------------------------------------------------------------------------------- /test/fixtures/background-018.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-018.jpg -------------------------------------------------------------------------------- /test/fixtures/background-019.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-019.jpg -------------------------------------------------------------------------------- /test/fixtures/background-020.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-020.jpg -------------------------------------------------------------------------------- /test/fixtures/background-021.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-021.jpg -------------------------------------------------------------------------------- /test/fixtures/background-022.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-022.jpg -------------------------------------------------------------------------------- /test/fixtures/background-023.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-023.jpg -------------------------------------------------------------------------------- /test/fixtures/background-024.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-024.jpg -------------------------------------------------------------------------------- /test/fixtures/background-025.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-025.jpg -------------------------------------------------------------------------------- /test/fixtures/background-026.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-026.jpg -------------------------------------------------------------------------------- /test/fixtures/background-027.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-027.jpg -------------------------------------------------------------------------------- /test/fixtures/background-028.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-028.jpg -------------------------------------------------------------------------------- /test/fixtures/background-029.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-029.jpg -------------------------------------------------------------------------------- /test/fixtures/background-030.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-030.jpg -------------------------------------------------------------------------------- /test/fixtures/background-031.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-031.jpg -------------------------------------------------------------------------------- /test/fixtures/background-032.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-032.jpg -------------------------------------------------------------------------------- /test/fixtures/background-033.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-033.jpg -------------------------------------------------------------------------------- /test/fixtures/background-034.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-034.jpg -------------------------------------------------------------------------------- /test/fixtures/background-035.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-035.jpg -------------------------------------------------------------------------------- /test/fixtures/background-036.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-036.jpg -------------------------------------------------------------------------------- /test/fixtures/background-037.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-037.jpg -------------------------------------------------------------------------------- /test/fixtures/background-038.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-038.jpg -------------------------------------------------------------------------------- /test/fixtures/background-039.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-039.jpg -------------------------------------------------------------------------------- /test/fixtures/background-040.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-040.jpg -------------------------------------------------------------------------------- /test/fixtures/background-041.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-041.jpg -------------------------------------------------------------------------------- /test/fixtures/background-042.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-042.jpg -------------------------------------------------------------------------------- /test/fixtures/background-043.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-043.jpg -------------------------------------------------------------------------------- /test/fixtures/background-044.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-044.jpg -------------------------------------------------------------------------------- /test/fixtures/background-045.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-045.jpg -------------------------------------------------------------------------------- /test/fixtures/background-046.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-046.jpg -------------------------------------------------------------------------------- /test/fixtures/background-047.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-047.jpg -------------------------------------------------------------------------------- /test/fixtures/background-048.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-048.jpg -------------------------------------------------------------------------------- /test/fixtures/background-049.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-049.jpg -------------------------------------------------------------------------------- /test/fixtures/background-050.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-050.jpg -------------------------------------------------------------------------------- /test/fixtures/background-051.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-051.jpg -------------------------------------------------------------------------------- /test/fixtures/background-052.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-052.jpg -------------------------------------------------------------------------------- /test/fixtures/background-053.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-053.jpg -------------------------------------------------------------------------------- /test/fixtures/background-054.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-054.jpg -------------------------------------------------------------------------------- /test/fixtures/background-055.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-055.jpg -------------------------------------------------------------------------------- /test/fixtures/background-056.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-056.jpg -------------------------------------------------------------------------------- /test/fixtures/background-057.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-057.jpg -------------------------------------------------------------------------------- /test/fixtures/background-058.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-058.jpg -------------------------------------------------------------------------------- /test/fixtures/background-059.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-059.jpg -------------------------------------------------------------------------------- /test/fixtures/background-060.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-060.jpg -------------------------------------------------------------------------------- /test/fixtures/background-061.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-061.jpg -------------------------------------------------------------------------------- /test/fixtures/background-062.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-062.jpg -------------------------------------------------------------------------------- /test/fixtures/background-063.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-063.jpg -------------------------------------------------------------------------------- /test/fixtures/background-064.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-064.jpg -------------------------------------------------------------------------------- /test/fixtures/background-065.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-065.jpg -------------------------------------------------------------------------------- /test/fixtures/background-066.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-066.jpg -------------------------------------------------------------------------------- /test/fixtures/background-067.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-067.jpg -------------------------------------------------------------------------------- /test/fixtures/background-068.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-068.jpg -------------------------------------------------------------------------------- /test/fixtures/background-069.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-069.jpg -------------------------------------------------------------------------------- /test/fixtures/background-070.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-070.jpg -------------------------------------------------------------------------------- /test/fixtures/background-071.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-071.jpg -------------------------------------------------------------------------------- /test/fixtures/background-072.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-072.jpg -------------------------------------------------------------------------------- /test/fixtures/background-073.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-073.jpg -------------------------------------------------------------------------------- /test/fixtures/background-074.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-074.jpg -------------------------------------------------------------------------------- /test/fixtures/background-075.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-075.jpg -------------------------------------------------------------------------------- /test/fixtures/background-076.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-076.jpg -------------------------------------------------------------------------------- /test/fixtures/background-077.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-077.jpg -------------------------------------------------------------------------------- /test/fixtures/background-078.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-078.jpg -------------------------------------------------------------------------------- /test/fixtures/background-079.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-079.jpg -------------------------------------------------------------------------------- /test/fixtures/background-080.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-080.jpg -------------------------------------------------------------------------------- /test/fixtures/background-081.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-081.jpg -------------------------------------------------------------------------------- /test/fixtures/background-082.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-082.jpg -------------------------------------------------------------------------------- /test/fixtures/background-083.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-083.jpg -------------------------------------------------------------------------------- /test/fixtures/background-084.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-084.jpg -------------------------------------------------------------------------------- /test/fixtures/background-085.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-085.jpg -------------------------------------------------------------------------------- /test/fixtures/background-086.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-086.jpg -------------------------------------------------------------------------------- /test/fixtures/background-087.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-087.jpg -------------------------------------------------------------------------------- /test/fixtures/background-088.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-088.jpg -------------------------------------------------------------------------------- /test/fixtures/background-089.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-089.jpg -------------------------------------------------------------------------------- /test/fixtures/background-090.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-090.jpg -------------------------------------------------------------------------------- /test/fixtures/background-091.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-091.jpg -------------------------------------------------------------------------------- /test/fixtures/background-092.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-092.jpg -------------------------------------------------------------------------------- /test/fixtures/background-093.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-093.jpg -------------------------------------------------------------------------------- /test/fixtures/background-094.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-094.jpg -------------------------------------------------------------------------------- /test/fixtures/background-095.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-095.jpg -------------------------------------------------------------------------------- /test/fixtures/background-096.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-096.jpg -------------------------------------------------------------------------------- /test/fixtures/background-097.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-097.jpg -------------------------------------------------------------------------------- /test/fixtures/background-098.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-098.jpg -------------------------------------------------------------------------------- /test/fixtures/background-099.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-099.jpg -------------------------------------------------------------------------------- /test/fixtures/background-100.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-100.jpg -------------------------------------------------------------------------------- /test/fixtures/background-101.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-101.jpg -------------------------------------------------------------------------------- /test/fixtures/background-102.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-102.jpg -------------------------------------------------------------------------------- /test/fixtures/background-103.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-103.jpg -------------------------------------------------------------------------------- /test/fixtures/background-104.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-104.jpg -------------------------------------------------------------------------------- /test/fixtures/background-105.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-105.jpg -------------------------------------------------------------------------------- /test/fixtures/background-106.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-106.jpg -------------------------------------------------------------------------------- /test/fixtures/background-107.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-107.jpg -------------------------------------------------------------------------------- /test/fixtures/background-108.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-108.jpg -------------------------------------------------------------------------------- /test/fixtures/background-109.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-109.jpg -------------------------------------------------------------------------------- /test/fixtures/background-110.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-110.jpg -------------------------------------------------------------------------------- /test/fixtures/background-111.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-111.jpg -------------------------------------------------------------------------------- /test/fixtures/background-112.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-112.jpg -------------------------------------------------------------------------------- /test/fixtures/background-113.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-113.jpg -------------------------------------------------------------------------------- /test/fixtures/background-114.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-114.jpg -------------------------------------------------------------------------------- /test/fixtures/background-115.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-115.jpg -------------------------------------------------------------------------------- /test/fixtures/background-116.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-116.jpg -------------------------------------------------------------------------------- /test/fixtures/background-117.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-117.jpg -------------------------------------------------------------------------------- /test/fixtures/background-118.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-118.jpg -------------------------------------------------------------------------------- /test/fixtures/background-119.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-119.jpg -------------------------------------------------------------------------------- /test/fixtures/background-120.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/background-120.jpg -------------------------------------------------------------------------------- /test/fixtures/frame-count.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eugeneware/ffmpeg-progress-stream/47400013462895d50ed48a234f105ab4827bfbfe/test/fixtures/frame-count.mp4 -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | var expect = require('expect.js'), 2 | progressStream = require('..'), 3 | ffmpegBin = require('ffmpeg-static'), 4 | path = require('path'), 5 | spawn = require('child_process').spawn, 6 | concat = require('concat-stream'); 7 | 8 | describe('ffmpeg-progress-stream', function() { 9 | var tempVideo = path.join(__dirname, '..', 'temp', 'out.mp4'); 10 | var pngs = path.join(__dirname, 'fixtures', 'background-%03d.jpg'); 11 | 12 | it('should be able to report progress without a total', function(done) { 13 | this.timeout(0); 14 | var params = [ 15 | '-y', 16 | '-r', 30, 17 | '-i', pngs, 18 | '-pix_fmt', 'yuv420p', 19 | '-r', 30, 20 | tempVideo 21 | ]; 22 | 23 | var ffmpeg = spawn(ffmpegBin.path, params); 24 | var results; 25 | ffmpeg.stderr 26 | .pipe(progressStream()) 27 | .pipe(concat(function (data) { 28 | results = data; 29 | })) 30 | ffmpeg.on('close', function (code) { 31 | if (code !== 0) return done(new Error('Non zero exit code: ' + code)); 32 | expect(results.length).to.be.above(1); 33 | for (var i = 0; i < results.length - 1; i++) { 34 | var result = results[i]; 35 | expect(Object.keys(result)).to.eql( 36 | ['frame', 'fps', 'q', 'size', 'time', 'bitrate']); 37 | } 38 | expect(Object.keys(results[results.length - 1])).to.eql( 39 | ['frame', 'fps', 'q', 'Lsize', 'time', 'bitrate', 'size']); 40 | done(); 41 | }); 42 | }); 43 | 44 | it('should be able to report progress with a total', function(done) { 45 | this.timeout(0); 46 | var params = [ 47 | '-y', 48 | '-r', 30, 49 | '-i', pngs, 50 | '-pix_fmt', 'yuv420p', 51 | '-r', 30, 52 | tempVideo 53 | ]; 54 | 55 | var ffmpeg = spawn(ffmpegBin.path, params); 56 | var results; 57 | ffmpeg.stderr 58 | .pipe(progressStream(120)) 59 | .pipe(concat(function (data) { 60 | results = data; 61 | })) 62 | ffmpeg.on('close', function (code) { 63 | if (code !== 0) return done(new Error('Non zero exit code: ' + code)); 64 | expect(results.length).to.be.above(1); 65 | for (var i = 0; i < results.length - 1; i++) { 66 | var result = results[i]; 67 | expect(Object.keys(result)).to.eql( 68 | ['frame', 'fps', 'q', 'size', 'time', 'bitrate', 'progress', 'remaining']); 69 | } 70 | expect(Object.keys(results[results.length - 1])).to.eql( 71 | ['frame', 'fps', 'q', 'Lsize', 'time', 'bitrate', 'size', 'progress', 'remaining']); 72 | done(); 73 | }); 74 | }); 75 | 76 | it('should be able to report a frame count', function(done) { 77 | this.timeout(0); 78 | var frameCountVideo = path.join(__dirname, 'fixtures', 'frame-count.mp4'); 79 | var params = [ 80 | '-i', frameCountVideo, 81 | '-f', 'null', 82 | '-' 83 | ]; 84 | 85 | var ffmpeg = spawn(ffmpegBin.path, params); 86 | var results; 87 | ffmpeg.stderr 88 | .pipe(progressStream()) 89 | .pipe(concat(function (data) { 90 | results = data; 91 | })) 92 | ffmpeg.on('close', function (code) { 93 | if (code !== 0) return done(new Error('Non zero exit code: ' + code)); 94 | expect(results.length).to.equal(1); 95 | expect(results[0]).to.eql({ 96 | frame: '15', 97 | fps: '0.0', 98 | q: '0.0', 99 | Lsize: 'N/A', 100 | time: '00:00:00.50', 101 | bitrate: 'N/A', 102 | size: 'N/A' 103 | }); 104 | done(); 105 | }); 106 | }); 107 | }); 108 | --------------------------------------------------------------------------------