forked from Storyboard-fm/little-media-box
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set ffmpeg and ffprobe paths via environment variables
- Loading branch information
agrathwohl
committed
Nov 3, 2021
1 parent
833e589
commit 2ebd1b3
Showing
1 changed file
with
10 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
const ffmpeg = require('fluent-ffmpeg') | ||
|
||
/** | ||
* Static `ffmpeg(1)` binary path. | ||
* @public | ||
*/ | ||
//const { FFPROBE_BIN_PATH = require('ffmpeg-ffprobe-static').ffprobePath } = process.env | ||
const { FFMPEG_BIN_PATH, FFPROBE_BIN_PATH } = process.env | ||
|
||
/** | ||
* Static `ffprobe(1)` binary path. | ||
* @public | ||
*/ | ||
//const { FFMPEG_BIN_PATH = require('ffmpeg-static') } = process.env | ||
if (FFMPEG_BIN_PATH) { | ||
ffmpeg.setFfmpegPath(FFMPEG_BIN_PATH) | ||
} | ||
|
||
if (FFPROBE_BIN_PATH) { | ||
ffmpeg.setFfprobePath(FFPROBE_BIN_PATH) | ||
} | ||
|
||
// initial configuration for `ffmpeg` and `ffprobe` binary paths | ||
// consumers of `fluent-ffmpeg` can overload the path on their own | ||
// ffmpeg.setFfmpegPath('/usr/bin/ffmpeg') | ||
// ffmpeg.setFfprobePath('/usr/bin/ffprobe') | ||
|
||
/** | ||
* Module exports. | ||
*/ | ||
module.exports = { | ||
// FFPROBE_BIN_PATH, | ||
// FFMPEG_BIN_PATH, | ||
FFPROBE_BIN_PATH, | ||
FFMPEG_BIN_PATH, | ||
ffmpeg | ||
} |