From 07d276fb32fd93413200af6576e35a6a2154c0ce Mon Sep 17 00:00:00 2001 From: srikanth-descript Date: Wed, 24 Jul 2024 01:10:02 +0530 Subject: [PATCH] Fixing capability parsing for ffmpeg 6+ --- doc/capabilities.js.html | 2 +- lib/capabilities.js | 2 +- package.json | 2 +- test/capabilities.test.js | 8 ++++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/capabilities.js.html b/doc/capabilities.js.html index f6fc484c..ecd86712 100644 --- a/doc/capabilities.js.html +++ b/doc/capabilities.js.html @@ -42,7 +42,7 @@

Source: capabilities.js

var ffEncodersRegexp = /\(encoders:([^\)]+)\)/; var ffDecodersRegexp = /\(decoders:([^\)]+)\)/; var encodersRegexp = /^\s*([VAS\.])([F\.])([S\.])([X\.])([B\.])([D\.]) ([^ ]+) +(.*)$/; -var formatRegexp = /^\s*([D ])([E ]) ([^ ]+) +(.*)$/; +var formatRegexp = /^\s*([D ])([E ])[d ]?\s+([^ ]+) +(.*)$/; var lineBreakRegexp = /\r\n|\r|\n/; var filterRegexp = /^(?: [T\.][S\.][C\.] )?([^ ]+) +(AA?|VV?|\|)->(AA?|VV?|\|) +(.*)$/; diff --git a/lib/capabilities.js b/lib/capabilities.js index fa24dcc6..f58c6666 100644 --- a/lib/capabilities.js +++ b/lib/capabilities.js @@ -15,7 +15,7 @@ var ffCodecRegexp = /^\s*([D\.])([E\.])([VAS])([I\.])([L\.])([S\.]) ([^ ]+) +(.* var ffEncodersRegexp = /\(encoders:([^\)]+)\)/; var ffDecodersRegexp = /\(decoders:([^\)]+)\)/; var encodersRegexp = /^\s*([VAS\.])([F\.])([S\.])([X\.])([B\.])([D\.]) ([^ ]+) +(.*)$/; -var formatRegexp = /^\s*([D ])([E ]) ([^ ]+) +(.*)$/; +var formatRegexp = /^\s*([D ])([E ])[d ]?\s+([^ ]+) +(.*)$/; var lineBreakRegexp = /\r\n|\r|\n/; var filterRegexp = /^(?: [T\.][S\.][C\.] )?([^ ]+) +(AA?|VV?|\|)->(AA?|VV?|\|) +(.*)$/; diff --git a/package.json b/package.json index a7336569..d66adb68 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@descript/fluent-ffmpeg", - "version": "2.1.2-descript.5", + "version": "2.1.3-descript.1", "description": "A fluent API to FFMPEG (http://www.ffmpeg.org)", "keywords": [ "ffmpeg" diff --git a/test/capabilities.test.js b/test/capabilities.test.js index aabd1524..a23b8b9f 100644 --- a/test/capabilities.test.js +++ b/test/capabilities.test.js @@ -72,6 +72,14 @@ describe('Capabilities', function() { ('canDemux' in formats.wav).should.equal(true); (typeof formats.wav.canDemux).should.equal('boolean'); + ('lavfi' in formats).should.equal(true); + ('description' in formats.lavfi).should.equal(true); + (typeof formats.lavfi.description).should.equal('string'); + ('canMux' in formats.lavfi).should.equal(true); + (typeof formats.lavfi.canMux).should.equal('boolean'); + ('canDemux' in formats.lavfi).should.equal(true); + (typeof formats.lavfi.canDemux).should.equal('boolean'); + done(); }); });