Skip to content

Commit

Permalink
Merge pull request #2 from noblesamurai/ffprobe
Browse files Browse the repository at this point in the history
ffmpeg-static as optional dep.
  • Loading branch information
Tim Allen authored Oct 14, 2020
2 parents fe648e0 + e5eadfc commit e407e13
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "get-media-dimensions",
"version": "1.0.0",
"version": "2.0.0-ffprobe.1",
"description": "get video, image or audio dimensions",
"main": "src/index.js",
"files": [
Expand All @@ -20,14 +20,14 @@
"license": "BSD-3-Clause",
"dependencies": {
"ffprobe-client": "^1.1.6",
"ffprobe-static": "^3.0.0",
"got": "^11.1.4",
"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",
Expand All @@ -50,5 +50,8 @@
"env": [
"mocha"
]
},
"optionalDependencies": {
"ffprobe-static": "^3.0.0"
}
}
2 changes: 1 addition & 1 deletion src/audio.js
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
6 changes: 6 additions & 0 deletions src/ffprobe-path.js
Original file line number Diff line number Diff line change
@@ -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.
}
2 changes: 1 addition & 1 deletion src/video.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit e407e13

Please sign in to comment.