Skip to content

Commit

Permalink
set ffmpeg and ffprobe paths via environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
agrathwohl committed Nov 3, 2021
1 parent 833e589 commit 2ebd1b3
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions ffmpeg.js
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
}

0 comments on commit 2ebd1b3

Please sign in to comment.