forked from balins/rust-ffmpeg-splitter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile-fdkaac.mjs
More file actions
57 lines (51 loc) · 1.56 KB
/
compile-fdkaac.mjs
File metadata and controls
57 lines (51 loc) · 1.56 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import fs from "fs";
import { execSync } from "child_process";
import { PREFIX } from "./const.mjs";
import path from "path";
export const enableFdkAac = async (isWindows) => {
if (!fs.existsSync("fdk-aac-free-2.0.0")) {
const response = execSync(
// Free version of fdk-aac, without any license issues
// https://src.fedoraproject.org/rpms/fdk-aac-free/tree/rawhide
// https://en.wikipedia.org/wiki/Fraunhofer_FDK_AAC
// > However, Fedora states that this will not affect the fdk-aac-free package, which enables only the commonly used "Low Complexity AAC" profile, which is what most people use.
"curl -L https://people.freedesktop.org/~wtay/fdk-aac-free-2.0.0.tar.gz > fdkaac.tar.gz"
);
execSync("tar -xzf fdkaac.tar.gz", {
stdio: "inherit",
});
}
execSync("autoreconf -vif", { cwd: "fdk-aac-free-2.0.0" });
execSync(
[
path.posix.join(
process.cwd().replace(/\\/g, "/"),
"fdk-aac-free-2.0.0",
"configure"
),
`--prefix=${path.resolve("fdk-aac-free-2.0.0", PREFIX)}`,
"--enable-static",
"--disable-shared",
"--with-pic",
isWindows ? "--host=x86_64-w64-mingw32" : null,
]
.filter(Boolean)
.join(" "),
{
cwd: "fdk-aac-free-2.0.0",
stdio: "inherit",
}
);
execSync("make", {
cwd: "fdk-aac-free-2.0.0",
stdio: "inherit",
});
execSync("make install", {
cwd: "fdk-aac-free-2.0.0",
stdio: "inherit",
});
execSync(`cp -r ${PREFIX} ../`, {
cwd: "fdk-aac-free-2.0.0",
stdio: "inherit",
});
};