forked from eugeneware/ffmpeg-static
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathindex.js
More file actions
29 lines (23 loc) · 686 Bytes
/
index.js
File metadata and controls
29 lines (23 loc) · 686 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
'use strict'
if (process.env.FFMPEG_BIN) {
module.exports = process.env.FFMPEG_BIN
} else {
var os = require('os')
var path = require('path')
var binaries = Object.assign(Object.create(null), {
darwin: ['x64', 'arm64'],
freebsd: ['x64'],
linux: ['x64', 'ia32', 'arm64', 'arm'],
win32: ['x64', 'ia32']
})
var platform = process.env.npm_config_platform || os.platform()
var arch = process.env.npm_config_arch || os.arch()
var ffmpegPath = path.join(
__dirname,
platform === 'win32' ? 'ffmpeg.exe' : 'ffmpeg'
)
if (!binaries[platform] || binaries[platform].indexOf(arch) === -1) {
ffmpegPath = null
}
module.exports = ffmpegPath
}