From d87ea22c21c617188946679ec075e4a4cd4e7776 Mon Sep 17 00:00:00 2001 From: Andrew DeVries Date: Fri, 7 Oct 2022 16:27:16 -0400 Subject: [PATCH 1/4] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) From ae00420447b9fae5bd0b1a0e74e89e42d27d02d3 Mon Sep 17 00:00:00 2001 From: Andrew DeVries Date: Fri, 7 Oct 2022 16:30:31 -0400 Subject: [PATCH 2/4] add readMetaData option --- lib/fluent-ffmpeg.js | 1 + 1 file changed, 1 insertion(+) 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) { From 06b650b833173c2d3055d1a51f95fe2121e03273 Mon Sep 17 00:00:00 2001 From: Andrew DeVries Date: Fri, 7 Oct 2022 16:36:14 -0400 Subject: [PATCH 3/4] add readMetaData option default to true --- lib/processor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/processor.js b/lib/processor.js index 36d980ad..e31381b0 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 @@ -588,7 +589,7 @@ module.exports = function(proto) { } } ); - }); + }, self.options.readMetadata || true); return this; }; From ef8ba0215d943efe0a05d4e8785717eb894af180 Mon Sep 17 00:00:00 2001 From: Andrew DeVries Date: Fri, 7 Oct 2022 17:51:52 -0400 Subject: [PATCH 4/4] Update processor.js --- lib/processor.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/processor.js b/lib/processor.js index e31381b0..99668954 100644 --- a/lib/processor.js +++ b/lib/processor.js @@ -285,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) { @@ -299,7 +299,7 @@ module.exports = function(proto) { // Read metadata if required function(cb) { - if (!readMetadata) { + if (readMetadata === false) { return cb(); } @@ -364,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) { @@ -589,7 +589,7 @@ module.exports = function(proto) { } } ); - }, self.options.readMetadata || true); + }, self.options.readMetadata); return this; };