diff --git a/README.md b/README.md index b63448bf..f90d844b 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ The following options are available: * `niceness` or `priority`: ffmpeg niceness value, between -20 and 20; ignored on Windows platforms (defaults to 0) * `logger`: logger object with `debug()`, `info()`, `warn()` and `error()` methods (defaults to no logging) * `stdoutLines`: maximum number of lines from ffmpeg stdout/stderr to keep in memory (defaults to 100, use 0 for unlimited storage) +* `readMetadata`: used to disable ffprobe (defaults to true, use false to disable ffprobe) ### Specifying inputs @@ -1490,4 +1491,4 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Ffluent-ffmpeg%2Fnode-fluent-ffmpeg.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Ffluent-ffmpeg%2Fnode-fluent-ffmpeg?ref=badge_large) \ No newline at end of file +[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Ffluent-ffmpeg%2Fnode-fluent-ffmpeg.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Ffluent-ffmpeg%2Fnode-fluent-ffmpeg?ref=badge_large) diff --git a/lib/fluent-ffmpeg.js b/lib/fluent-ffmpeg.js index 7e648560..59fed85d 100644 --- a/lib/fluent-ffmpeg.js +++ b/lib/fluent-ffmpeg.js @@ -26,6 +26,7 @@ var ARGLISTS = ['_global', '_audio', '_audioFilters', '_video', '_videoFilters', * @param {String} [options.preset="fluent-ffmpeg/lib/presets"] alias for `presets` * @param {String} [options.stdoutLines=100] maximum lines of ffmpeg output to keep in memory, use 0 for unlimited * @param {Number} [options.timeout=] ffmpeg processing timeout in seconds + * @param {Boolean} [options.readMetadata=true] disable ffprob on prepare * @param {String|ReadableStream} [options.source=] alias for the `input` parameter */ function FfmpegCommand(input, options) { diff --git a/lib/processor.js b/lib/processor.js index 36d980ad..99668954 100644 --- a/lib/processor.js +++ b/lib/processor.js @@ -96,6 +96,7 @@ module.exports = function(proto) { * - `cwd`: change working directory * - 'captureStdout': capture stdout and pass it to 'endCB' as its 2nd argument (default: false) * - 'stdoutLines': override command limit (default: use command limit) + * - 'readMetadata': disable ffProbe * * The 'processCB' callback, if present, is called as soon as the process is created and * receives a nodejs ChildProcess object. It may not be called at all if an error happens @@ -284,7 +285,7 @@ module.exports = function(proto) { * * @method FfmpegCommand#_prepare * @param {Function} callback callback with signature (err, args) - * @param {Boolean} [readMetadata=false] read metadata before processing + * @param {Boolean} [readMetadata=true] read metadata before processing * @private */ proto._prepare = function(callback, readMetadata) { @@ -298,7 +299,7 @@ module.exports = function(proto) { // Read metadata if required function(cb) { - if (!readMetadata) { + if (readMetadata === false) { return cb(); } @@ -363,7 +364,7 @@ module.exports = function(proto) { } ], callback); - if (!readMetadata) { + if (readMetadata !== false) { // Read metadata as soon as 'progress' listeners are added if (this.listeners('progress').length > 0) { @@ -588,7 +589,7 @@ module.exports = function(proto) { } } ); - }); + }, self.options.readMetadata); return this; };