Skip to content

Commit 5aae567

Browse files
authored
rust-ffmpeg-splitter: Fix AV1 encoder flag (#14)
1 parent a7ef15f commit 5aae567

2 files changed

Lines changed: 31 additions & 2 deletions

File tree

compile-ffmpeg.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ if (!existsSync(PREFIX)) {
119119
fs.mkdirSync(PREFIX);
120120
}
121121

122-
execSync("git config --global advice.detachedHead false");
123122
const isWindows = process.argv.includes("windows");
124123
const isMusl = process.argv.includes("musl");
125124
const isOldCmake = process.argv.includes("old-cmake");
@@ -268,7 +267,7 @@ execSync(
268267
"--enable-encoder=pcm_s24le",
269268
"--enable-encoder=libx264",
270269
"--enable-encoder=libx265",
271-
"--enable-encoder=libaom-av1",
270+
"--enable-encoder=libaom_av1",
272271
"--enable-libvpx",
273272
"--enable-encoder=libvpx_vp8",
274273
"--enable-encoder=libvpx_vp9",

test-ffmpeg.mjs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ if (exit1.status !== 0) {
3131
}
3232
assert(exit1.status === 0);
3333

34+
const encoders = spawnSync(ffmpegBinary, ["-hide_banner", "-encoders"], {
35+
env,
36+
});
37+
if (encoders.status !== 0) {
38+
console.log(encoders.stderr.toString("utf8"));
39+
console.log(encoders.stdout.toString("utf8"));
40+
}
41+
assert(encoders.status === 0);
42+
assert(encoders.stdout.toString("utf8").includes("libaom-av1"));
43+
3444
const exit2 = spawnSync(
3545
ffmpegBinary,
3646
["-i", "sample-5s.webm", "-t", "1", "out-test.mp4", "-y"],
@@ -143,4 +153,24 @@ const exit6 = spawnSync(
143153
}
144154
);
145155
assert(exit6.status === 0);
156+
157+
const exit7 = spawnSync(
158+
ffmpegBinary,
159+
[
160+
"-i",
161+
"sample.mp4",
162+
"-frames:v",
163+
"1",
164+
"-an",
165+
"-c:v",
166+
"libaom-av1",
167+
"out-test-libaom-av1.mkv",
168+
"-y",
169+
],
170+
{
171+
env,
172+
stdio: "inherit",
173+
}
174+
);
175+
assert(exit7.status === 0);
146176
console.log("Hooray!");

0 commit comments

Comments
 (0)