forked from bngayaban/ffprobe-static
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.js
More file actions
37 lines (30 loc) · 739 Bytes
/
index.js
File metadata and controls
37 lines (30 loc) · 739 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
30
31
32
33
34
35
36
37
//
// With credits to https://github.com/eugeneware/ffmpeg-static
//
var os = require('os');
var path = require('path');
// Key - supported OS platforms
// Object - array of supported architectures
const supported = {
darwin: ['x64'],
linux: ['arm', 'arm64', 'ia32', 'x64'],
win32: ['ia32', 'x64']
}
var platform = os.platform();
if(!(platform in supported)) {
console.error('Unsupported platform:', platform);
process.exit(1);
}
var arch = os.arch();
if(supported[platform].indexOf(arch) < 0) {
console.error('Unsupported architecture:', arch);
process.exit(1);
}
var ffprobePath = path.join(
__dirname,
'bin',
platform,
arch,
platform === 'win32' ? 'ffprobe.exe' : 'ffprobe'
);
exports.path = ffprobePath;