From f92066c0580c07382b2aa9b67b4d8c75f51381cb Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Wed, 7 Oct 2020 13:15:26 +1100 Subject: [PATCH 1/5] Pass in ffprobe path for audio/video. --- README.md | 19 +++++++++++-------- package.json | 3 ++- src/audio.js | 5 ++--- src/index.js | 12 ++++++++++-- src/video.js | 5 ++--- test/audio.js | 11 ++++++----- test/index.js | 7 ++++--- test/video.js | 9 +++++---- 8 files changed, 42 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index e835311..87657ea 100644 --- a/README.md +++ b/README.md @@ -16,21 +16,24 @@ $ npm install get-media-dimensions Get the dimensional info for a given filename and file type. -| Parameter | Type | Description | -| :-------------- | :----- | :------------------------------------------------ | -| `urlOrFilename` | string | either a remote url or a local filename. | -| `type` | string | the type of media (`audio`, `image`, or `video`). | +| Parameter | Type | Description | +| :-------------------- | :----- | :------------------------------------------------ | +| `urlOrFilename` | string | either a remote url or a local filename. | +| `type` | string | the type of media (`audio`, `image`, or `video`). | +| `options` | object | options | +| `options.ffprobePath` | string | location of ffprobe binary (for audio and video) | #### Examples _Get video dimensions._ > ```js +> ffprobePath = '/path/to/ffprobe'; > const getMediaDimensions = require('get-media-dimensions'); > > // get video dimensions = { width, height, duration } -> const dimensions = await getMediaDimensions('./video.mp4'); -> const dimensions = await getMediaDimensions('https://somewhere.com/video.mp4'); +> const dimensions = await getMediaDimensions('./video.mp4', { ffprobePath }); +> const dimensions = await getMediaDimensions('https://somewhere.com/video.mp4', { ffprobePath }); > ``` _Get image dimensions._ @@ -45,8 +48,8 @@ _Get audio dimensions._ > ```js > // get audio dimensions = { duration } -> const dimensions = await getMediaDimensions('./audio.mp3', 'audio'); -> const dimensions = await getMediaDimensions('https://somewhere.com/audio.mp3', 'audio'); +> const dimensions = await getMediaDimensions('./audio.mp3', 'audio', { ffprobePath }); +> const dimensions = await getMediaDimensions('https://somewhere.com/audio.mp3', 'audio', { ffprobePath }); > ``` ## License diff --git a/package.json b/package.json index f8ee287..51741f3 100644 --- a/package.json +++ b/package.json @@ -20,14 +20,15 @@ "license": "BSD-3-Clause", "dependencies": { "ffprobe-client": "^1.1.6", - "ffprobe-static": "^3.0.0", "got": "^11.1.4", + "ow": "^0.18.0", "sharp": "^0.25.3" }, "devDependencies": { "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "dirty-chai": "^2.0.1", + "ffprobe-static": "^3.0.0", "finalhandler": "^1.1.2", "jsdoc-md": "^6.0.0", "mocha": "^7.0.0", diff --git a/src/audio.js b/src/audio.js index 15789d5..7124013 100644 --- a/src/audio.js +++ b/src/audio.js @@ -1,5 +1,4 @@ const ffprobe = require('ffprobe-client'); -const ffprobePath = require('ffprobe-static').path; /** * Get the dimensional info for an audio file. @@ -7,8 +6,8 @@ const ffprobePath = require('ffprobe-static').path; * @param {string} urlOrFilename * @return {object} { duration } */ -async function getAudioDimensions (urlOrFilename) { - const metadata = await ffprobe(urlOrFilename, { path: ffprobePath }); +async function getAudioDimensions (urlOrFilename, options) { + const metadata = await ffprobe(urlOrFilename, { path: options.ffprobePath }); const stream = metadata.streams.find(s => s.codec_type === 'audio'); if (!stream) throw new Error('audio stream not found'); return { duration: parseFloat(stream.duration) }; diff --git a/src/index.js b/src/index.js index 9b42345..0a2369e 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,7 @@ const getAudioDimensions = require('./audio'); const getImageDimensions = require('./image'); const getVideoDimensions = require('./video'); +const ow = require('ow'); const functions = { audio: getAudioDimensions, @@ -38,11 +39,18 @@ const functions = { * @name getMediaDimensions * @param {string} urlOrFilename either a remote url or a local filename. * @param {string} type the type of media (`audio`, `image`, or `video`). + * @param {object} options + * @param {string} options.ffprobePath Path to ffprobe. * @return {object} */ -async function getMediaDimensions (urlOrFilename, type) { +async function getMediaDimensions (urlOrFilename, type, options = {}) { + if (['audio', 'video'].includes(type)) { + ow(options, ow.object.partialShape({ + ffprobePath: ow.string.nonEmpty + })); + } if (!functions[type]) throw new Error(`unknown type ${type}`); - return functions[type](urlOrFilename); + return functions[type](urlOrFilename, options); } module.exports = getMediaDimensions; diff --git a/src/video.js b/src/video.js index e2cf1b8..16fa1eb 100644 --- a/src/video.js +++ b/src/video.js @@ -1,5 +1,4 @@ const ffprobe = require('ffprobe-client'); -const ffprobePath = require('ffprobe-static').path; /** * Get rotation info from a video streams metadata @@ -19,8 +18,8 @@ function getVideoRotation (streamMetadata) { * @param {string} urlOrFilename * @return {object} { width, height, duration } */ -async function getVideoDimensions (urlOrFilename) { - const metadata = await ffprobe(urlOrFilename, { path: ffprobePath }); +async function getVideoDimensions (urlOrFilename, options) { + const metadata = await ffprobe(urlOrFilename, { path: options.ffprobePath }); const stream = metadata.streams.find(s => s.codec_type === 'video'); if (!stream) throw new Error('video stream not found'); const rotation = getVideoRotation(stream); diff --git a/test/audio.js b/test/audio.js index 3a6b204..9ef8bc6 100644 --- a/test/audio.js +++ b/test/audio.js @@ -1,6 +1,7 @@ const expect = require('chai').expect; -const path = require('path'); const getAudioDimensions = require('../src/audio'); +const path = require('path'); +const { path: ffprobePath } = require('ffprobe-static'); const AUDIO_FILES = ['audio.opus', 'audio.mp3']; @@ -8,7 +9,7 @@ describe('get audio dimensions', function () { it('should return dimensions for local files', async function () { for (const file of AUDIO_FILES) { const filename = path.resolve(__dirname, 'fixtures', file); - const dimensions = await getAudioDimensions(filename); + const dimensions = await getAudioDimensions(filename, { ffprobePath }); expect(dimensions.duration).to.be.closeTo(46, 0.2); } }); @@ -16,18 +17,18 @@ describe('get audio dimensions', function () { it('should return dimensions for remote urls', async function () { for (const file of AUDIO_FILES) { const url = `${this.host}/${file}`; - const dimensions = await getAudioDimensions(url); + const dimensions = await getAudioDimensions(url, { ffprobePath }); expect(dimensions.duration).to.be.closeTo(46, 0.2); } }); it('should reject with an error for a bad local file', async function () { const filename = path.resolve(__dirname, 'fixtures/does_not_exist.mp3'); - await expect(getAudioDimensions(filename)).to.be.rejected(); + await expect(getAudioDimensions(filename), { ffprobePath }).to.be.rejected(); }); it('should reject with an error for a bad remote url', async function () { const url = `${this.host}/does_not_exists.mp3`; - await expect(getAudioDimensions(url)).to.be.rejected(); + await expect(getAudioDimensions(url, { ffprobePath })).to.be.rejected(); }); }); diff --git a/test/index.js b/test/index.js index d39d494..d537130 100644 --- a/test/index.js +++ b/test/index.js @@ -1,6 +1,7 @@ const expect = require('chai').expect; const path = require('path'); const getMediaDimensions = require('..'); +const { path: ffprobePath } = require('ffprobe-static'); describe('get media dimensions (index)', function () { it('should return image dimensions', async function () { @@ -11,18 +12,18 @@ describe('get media dimensions (index)', function () { it('should return video dimensions', async function () { const filename = path.resolve(__dirname, 'fixtures/video.mp4'); - const dimensions = await getMediaDimensions(filename, 'video'); + const dimensions = await getMediaDimensions(filename, 'video', { ffprobePath }); expect(dimensions).to.deep.equal({ width: 50, height: 28, duration: 30 }); }); it('should return audio dimensions', async function () { const filename = path.resolve(__dirname, 'fixtures/audio.mp3'); - const dimensions = await getMediaDimensions(filename, 'audio'); + const dimensions = await getMediaDimensions(filename, 'audio', { ffprobePath }); expect(dimensions.duration).to.be.closeTo(46, 0.2); }); it('should throw an error if type is unknown', async function () { const filename = path.resolve(__dirname, 'fixtures/video.mp4'); - await expect(getMediaDimensions(filename, 'fish')).to.be.rejectedWith('unknown type'); + await expect(getMediaDimensions(filename, 'fish'), { ffprobePath }).to.be.rejectedWith('unknown type'); }); }); diff --git a/test/video.js b/test/video.js index 6c5c207..95b630a 100644 --- a/test/video.js +++ b/test/video.js @@ -1,6 +1,7 @@ const expect = require('chai').expect; const path = require('path'); const getVideoDimensions = require('../src/video'); +const { path: ffprobePath } = require('ffprobe-static'); const VIDEO_FILES = ['video.mp4', 'video_cw.mp4', 'video_ccw.mp4']; const DIMENSIONS = { width: 50, height: 28, duration: 30 }; @@ -9,7 +10,7 @@ describe('get video dimensions', function () { it('should return dimensions for local files', async function () { for (const file of VIDEO_FILES) { const filename = path.resolve(__dirname, 'fixtures', file); - const dimensions = await getVideoDimensions(filename); + const dimensions = await getVideoDimensions(filename, { ffprobePath }); expect(dimensions).to.deep.equal(DIMENSIONS); } }); @@ -17,18 +18,18 @@ describe('get video dimensions', function () { it('should return dimensions for remote urls', async function () { for (const file of VIDEO_FILES) { const url = `${this.host}/${file}`; - const dimensions = await getVideoDimensions(url); + const dimensions = await getVideoDimensions(url, { ffprobePath }); expect(dimensions).to.deep.equal(DIMENSIONS); } }); it('should reject with an error for a bad local file', async function () { const filename = path.resolve(__dirname, 'fixtures/does_not_exist.mp4'); - await expect(getVideoDimensions(filename)).to.be.rejected(); + await expect(getVideoDimensions(filename, { ffprobePath })).to.be.rejected(); }); it('should reject with an error for a bad remote url', async function () { const url = `${this.host}/does_not_exists.mp4`; - await expect(getVideoDimensions(url)).to.be.rejected(); + await expect(getVideoDimensions(url, { ffprobePath })).to.be.rejected(); }); }); From df96836211262e897785450034d9c1a6c63df6a9 Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Wed, 7 Oct 2020 13:24:58 +1100 Subject: [PATCH 2/5] 2.0.0-ffprobe.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 51741f3..cadb791 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "get-media-dimensions", - "version": "1.0.0", + "version": "2.0.0-ffprobe.0", "description": "get video, image or audio dimensions", "main": "src/index.js", "files": [ From dd9ce6d71198082d079ca4d75c6b2dabff2a0d96 Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Mon, 12 Oct 2020 12:56:56 +1100 Subject: [PATCH 3/5] Revert "Pass in ffprobe path for audio/video." This reverts commit f92066c0580c07382b2aa9b67b4d8c75f51381cb. --- README.md | 19 ++++++++----------- package.json | 3 +-- src/audio.js | 5 +++-- src/index.js | 12 ++---------- src/video.js | 5 +++-- test/audio.js | 11 +++++------ test/index.js | 7 +++---- test/video.js | 9 ++++----- 8 files changed, 29 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 87657ea..e835311 100644 --- a/README.md +++ b/README.md @@ -16,24 +16,21 @@ $ npm install get-media-dimensions Get the dimensional info for a given filename and file type. -| Parameter | Type | Description | -| :-------------------- | :----- | :------------------------------------------------ | -| `urlOrFilename` | string | either a remote url or a local filename. | -| `type` | string | the type of media (`audio`, `image`, or `video`). | -| `options` | object | options | -| `options.ffprobePath` | string | location of ffprobe binary (for audio and video) | +| Parameter | Type | Description | +| :-------------- | :----- | :------------------------------------------------ | +| `urlOrFilename` | string | either a remote url or a local filename. | +| `type` | string | the type of media (`audio`, `image`, or `video`). | #### Examples _Get video dimensions._ > ```js -> ffprobePath = '/path/to/ffprobe'; > const getMediaDimensions = require('get-media-dimensions'); > > // get video dimensions = { width, height, duration } -> const dimensions = await getMediaDimensions('./video.mp4', { ffprobePath }); -> const dimensions = await getMediaDimensions('https://somewhere.com/video.mp4', { ffprobePath }); +> const dimensions = await getMediaDimensions('./video.mp4'); +> const dimensions = await getMediaDimensions('https://somewhere.com/video.mp4'); > ``` _Get image dimensions._ @@ -48,8 +45,8 @@ _Get audio dimensions._ > ```js > // get audio dimensions = { duration } -> const dimensions = await getMediaDimensions('./audio.mp3', 'audio', { ffprobePath }); -> const dimensions = await getMediaDimensions('https://somewhere.com/audio.mp3', 'audio', { ffprobePath }); +> const dimensions = await getMediaDimensions('./audio.mp3', 'audio'); +> const dimensions = await getMediaDimensions('https://somewhere.com/audio.mp3', 'audio'); > ``` ## License diff --git a/package.json b/package.json index cadb791..0ff61fc 100644 --- a/package.json +++ b/package.json @@ -20,15 +20,14 @@ "license": "BSD-3-Clause", "dependencies": { "ffprobe-client": "^1.1.6", + "ffprobe-static": "^3.0.0", "got": "^11.1.4", - "ow": "^0.18.0", "sharp": "^0.25.3" }, "devDependencies": { "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "dirty-chai": "^2.0.1", - "ffprobe-static": "^3.0.0", "finalhandler": "^1.1.2", "jsdoc-md": "^6.0.0", "mocha": "^7.0.0", diff --git a/src/audio.js b/src/audio.js index 7124013..15789d5 100644 --- a/src/audio.js +++ b/src/audio.js @@ -1,4 +1,5 @@ const ffprobe = require('ffprobe-client'); +const ffprobePath = require('ffprobe-static').path; /** * Get the dimensional info for an audio file. @@ -6,8 +7,8 @@ const ffprobe = require('ffprobe-client'); * @param {string} urlOrFilename * @return {object} { duration } */ -async function getAudioDimensions (urlOrFilename, options) { - const metadata = await ffprobe(urlOrFilename, { path: options.ffprobePath }); +async function getAudioDimensions (urlOrFilename) { + const metadata = await ffprobe(urlOrFilename, { path: ffprobePath }); const stream = metadata.streams.find(s => s.codec_type === 'audio'); if (!stream) throw new Error('audio stream not found'); return { duration: parseFloat(stream.duration) }; diff --git a/src/index.js b/src/index.js index 0a2369e..9b42345 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,6 @@ const getAudioDimensions = require('./audio'); const getImageDimensions = require('./image'); const getVideoDimensions = require('./video'); -const ow = require('ow'); const functions = { audio: getAudioDimensions, @@ -39,18 +38,11 @@ const functions = { * @name getMediaDimensions * @param {string} urlOrFilename either a remote url or a local filename. * @param {string} type the type of media (`audio`, `image`, or `video`). - * @param {object} options - * @param {string} options.ffprobePath Path to ffprobe. * @return {object} */ -async function getMediaDimensions (urlOrFilename, type, options = {}) { - if (['audio', 'video'].includes(type)) { - ow(options, ow.object.partialShape({ - ffprobePath: ow.string.nonEmpty - })); - } +async function getMediaDimensions (urlOrFilename, type) { if (!functions[type]) throw new Error(`unknown type ${type}`); - return functions[type](urlOrFilename, options); + return functions[type](urlOrFilename); } module.exports = getMediaDimensions; diff --git a/src/video.js b/src/video.js index 16fa1eb..e2cf1b8 100644 --- a/src/video.js +++ b/src/video.js @@ -1,4 +1,5 @@ const ffprobe = require('ffprobe-client'); +const ffprobePath = require('ffprobe-static').path; /** * Get rotation info from a video streams metadata @@ -18,8 +19,8 @@ function getVideoRotation (streamMetadata) { * @param {string} urlOrFilename * @return {object} { width, height, duration } */ -async function getVideoDimensions (urlOrFilename, options) { - const metadata = await ffprobe(urlOrFilename, { path: options.ffprobePath }); +async function getVideoDimensions (urlOrFilename) { + const metadata = await ffprobe(urlOrFilename, { path: ffprobePath }); const stream = metadata.streams.find(s => s.codec_type === 'video'); if (!stream) throw new Error('video stream not found'); const rotation = getVideoRotation(stream); diff --git a/test/audio.js b/test/audio.js index 9ef8bc6..3a6b204 100644 --- a/test/audio.js +++ b/test/audio.js @@ -1,7 +1,6 @@ const expect = require('chai').expect; -const getAudioDimensions = require('../src/audio'); const path = require('path'); -const { path: ffprobePath } = require('ffprobe-static'); +const getAudioDimensions = require('../src/audio'); const AUDIO_FILES = ['audio.opus', 'audio.mp3']; @@ -9,7 +8,7 @@ describe('get audio dimensions', function () { it('should return dimensions for local files', async function () { for (const file of AUDIO_FILES) { const filename = path.resolve(__dirname, 'fixtures', file); - const dimensions = await getAudioDimensions(filename, { ffprobePath }); + const dimensions = await getAudioDimensions(filename); expect(dimensions.duration).to.be.closeTo(46, 0.2); } }); @@ -17,18 +16,18 @@ describe('get audio dimensions', function () { it('should return dimensions for remote urls', async function () { for (const file of AUDIO_FILES) { const url = `${this.host}/${file}`; - const dimensions = await getAudioDimensions(url, { ffprobePath }); + const dimensions = await getAudioDimensions(url); expect(dimensions.duration).to.be.closeTo(46, 0.2); } }); it('should reject with an error for a bad local file', async function () { const filename = path.resolve(__dirname, 'fixtures/does_not_exist.mp3'); - await expect(getAudioDimensions(filename), { ffprobePath }).to.be.rejected(); + await expect(getAudioDimensions(filename)).to.be.rejected(); }); it('should reject with an error for a bad remote url', async function () { const url = `${this.host}/does_not_exists.mp3`; - await expect(getAudioDimensions(url, { ffprobePath })).to.be.rejected(); + await expect(getAudioDimensions(url)).to.be.rejected(); }); }); diff --git a/test/index.js b/test/index.js index d537130..d39d494 100644 --- a/test/index.js +++ b/test/index.js @@ -1,7 +1,6 @@ const expect = require('chai').expect; const path = require('path'); const getMediaDimensions = require('..'); -const { path: ffprobePath } = require('ffprobe-static'); describe('get media dimensions (index)', function () { it('should return image dimensions', async function () { @@ -12,18 +11,18 @@ describe('get media dimensions (index)', function () { it('should return video dimensions', async function () { const filename = path.resolve(__dirname, 'fixtures/video.mp4'); - const dimensions = await getMediaDimensions(filename, 'video', { ffprobePath }); + const dimensions = await getMediaDimensions(filename, 'video'); expect(dimensions).to.deep.equal({ width: 50, height: 28, duration: 30 }); }); it('should return audio dimensions', async function () { const filename = path.resolve(__dirname, 'fixtures/audio.mp3'); - const dimensions = await getMediaDimensions(filename, 'audio', { ffprobePath }); + const dimensions = await getMediaDimensions(filename, 'audio'); expect(dimensions.duration).to.be.closeTo(46, 0.2); }); it('should throw an error if type is unknown', async function () { const filename = path.resolve(__dirname, 'fixtures/video.mp4'); - await expect(getMediaDimensions(filename, 'fish'), { ffprobePath }).to.be.rejectedWith('unknown type'); + await expect(getMediaDimensions(filename, 'fish')).to.be.rejectedWith('unknown type'); }); }); diff --git a/test/video.js b/test/video.js index 95b630a..6c5c207 100644 --- a/test/video.js +++ b/test/video.js @@ -1,7 +1,6 @@ const expect = require('chai').expect; const path = require('path'); const getVideoDimensions = require('../src/video'); -const { path: ffprobePath } = require('ffprobe-static'); const VIDEO_FILES = ['video.mp4', 'video_cw.mp4', 'video_ccw.mp4']; const DIMENSIONS = { width: 50, height: 28, duration: 30 }; @@ -10,7 +9,7 @@ describe('get video dimensions', function () { it('should return dimensions for local files', async function () { for (const file of VIDEO_FILES) { const filename = path.resolve(__dirname, 'fixtures', file); - const dimensions = await getVideoDimensions(filename, { ffprobePath }); + const dimensions = await getVideoDimensions(filename); expect(dimensions).to.deep.equal(DIMENSIONS); } }); @@ -18,18 +17,18 @@ describe('get video dimensions', function () { it('should return dimensions for remote urls', async function () { for (const file of VIDEO_FILES) { const url = `${this.host}/${file}`; - const dimensions = await getVideoDimensions(url, { ffprobePath }); + const dimensions = await getVideoDimensions(url); expect(dimensions).to.deep.equal(DIMENSIONS); } }); it('should reject with an error for a bad local file', async function () { const filename = path.resolve(__dirname, 'fixtures/does_not_exist.mp4'); - await expect(getVideoDimensions(filename, { ffprobePath })).to.be.rejected(); + await expect(getVideoDimensions(filename)).to.be.rejected(); }); it('should reject with an error for a bad remote url', async function () { const url = `${this.host}/does_not_exists.mp4`; - await expect(getVideoDimensions(url, { ffprobePath })).to.be.rejected(); + await expect(getVideoDimensions(url)).to.be.rejected(); }); }); From d90f2274ebca525768baa54c155526848bc9c2fa Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Mon, 12 Oct 2020 13:01:46 +1100 Subject: [PATCH 4/5] ffprobe-static as optional dep --- package.json | 5 ++++- src/audio.js | 2 +- src/ffprobe-path.js | 6 ++++++ src/video.js | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 src/ffprobe-path.js diff --git a/package.json b/package.json index 0ff61fc..be9d234 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "license": "BSD-3-Clause", "dependencies": { "ffprobe-client": "^1.1.6", - "ffprobe-static": "^3.0.0", "got": "^11.1.4", "sharp": "^0.25.3" }, @@ -28,6 +27,7 @@ "chai": "^4.2.0", "chai-as-promised": "^7.1.1", "dirty-chai": "^2.0.1", + "ffprobe-static": "^3.0.0", "finalhandler": "^1.1.2", "jsdoc-md": "^6.0.0", "mocha": "^7.0.0", @@ -50,5 +50,8 @@ "env": [ "mocha" ] + }, + "optionalDependencies": { + "ffprobe-static": "^3.0.0" } } diff --git a/src/audio.js b/src/audio.js index 15789d5..5219084 100644 --- a/src/audio.js +++ b/src/audio.js @@ -1,5 +1,5 @@ const ffprobe = require('ffprobe-client'); -const ffprobePath = require('ffprobe-static').path; +const ffprobePath = require('./ffprobe-path'); /** * Get the dimensional info for an audio file. diff --git a/src/ffprobe-path.js b/src/ffprobe-path.js new file mode 100644 index 0000000..4431514 --- /dev/null +++ b/src/ffprobe-path.js @@ -0,0 +1,6 @@ +try { + // `ffprobe-static` is optional dep. + module.exports = require('ffprobe-static').path; +} catch { + module.exports = 'ffprobe'; // Otherwise just use version in path. +} diff --git a/src/video.js b/src/video.js index e2cf1b8..b4fa109 100644 --- a/src/video.js +++ b/src/video.js @@ -1,5 +1,5 @@ const ffprobe = require('ffprobe-client'); -const ffprobePath = require('ffprobe-static').path; +const ffprobePath = require('./ffprobe-path'); /** * Get rotation info from a video streams metadata From e5eadfcbeaac8e90a930350480879754a4c50642 Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Mon, 12 Oct 2020 13:03:47 +1100 Subject: [PATCH 5/5] 2.0.0-ffprobe.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index be9d234..b2382a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "get-media-dimensions", - "version": "2.0.0-ffprobe.0", + "version": "2.0.0-ffprobe.1", "description": "get video, image or audio dimensions", "main": "src/index.js", "files": [