Skip to content

Commit d999adb

Browse files
authored
Merge pull request #1 from Lumen5/fix-mac-install-beamcoder
Merge custom branch into master
2 parents 2bd1fe2 + e65b320 commit d999adb

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

binding.gyp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"targets": [{
33
"target_name" : "beamcoder",
4-
"sources" : [ "src/beamcoder.cc", "src/beamcoder_util.cc",
4+
"sources" : [ "src/beamcoder.cc", "src/beamcoder_util.cc",
55
"src/log.cc" ,
66
"src/governor.cc", "src/demux.cc",
77
"src/decode.cc", "src/filter.cc",
@@ -90,10 +90,12 @@
9090
}],
9191
['OS=="mac"', {
9292
"include_dirs" : [
93-
"/opt/homebrew/Cellar/ffmpeg/5.0/include"
93+
"/usr/local/Cellar/ffmpeg@5/5.1.3/include/",
94+
"/opt/homebrew/Cellar/ffmpeg@5/5.1.3/include/",
9495
],
9596
"library_dirs": [
96-
"/opt/homebrew/Cellar/ffmpeg/5.0/lib",
97+
"/usr/local/Cellar/ffmpeg@5/5.1.3/lib/",
98+
"/opt/homebrew/Cellar/ffmpeg@5/5.1.3/lib/",
9799
]
98100
}],
99101
]

install_ffmpeg.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ async function win32() {
9999
if (e.code === 'EEXIST') return;
100100
else throw e;
101101
});
102-
102+
103103
const ffmpegFilename = 'ffmpeg-5.x-win64-shared';
104104
await access(`ffmpeg/${ffmpegFilename}`, fs.constants.R_OK).catch(async () => {
105105
const html = await getHTML('https://github.com/BtbN/FFmpeg-Builds/wiki/Latest', 'latest autobuilds');
@@ -180,20 +180,21 @@ async function darwin() {
180180
console.log('Checking for FFmpeg dependencies via HomeBrew.');
181181
let output;
182182
let returnMessage;
183-
183+
184184
try {
185-
output = await exec('brew list ffmpeg');
185+
output = await exec('brew list ffmpeg@5');
186186
returnMessage = 'FFmpeg already present via Homebrew.';
187187
} catch (err) {
188-
if (err.stderr !== 'Error: No such keg: /usr/local/Cellar/ffmpeg\n') {
188+
if (err.stderr.indexOf('Error: No such keg') === -1 &&
189+
err.stderr.indexOf('ffmpeg@5') === -1) {
189190
console.error(err);
190191
console.log('Either Homebrew is not installed or something else is wrong.\nExiting');
191192
process.exit(1);
192193
}
193194

194195
console.log('FFmpeg not installed. Attempting to install via Homebrew.');
195196
try {
196-
output = await exec('brew install nasm pkg-config texi2html ffmpeg');
197+
output = await exec('brew install nasm pkg-config texi2html ffmpeg@5');
197198
returnMessage = 'FFmpeg installed via Homebrew.';
198199
} catch (err) {
199200
console.log('Failed to install ffmpeg:\n');

types/Filter.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ export interface VideoInputParam extends InputParam {
265265
height: number
266266
pixelFormat: string
267267
pixelAspect: Array<number>
268-
hw_device_ctx: HWDeviceContext // Optional
269-
swPixelFormat: string // Optional
268+
hw_device_ctx?: HWDeviceContext // Optional
269+
swPixelFormat?: string // Optional
270270
}
271271
/** The required parameters for setting up audio filter inputs */
272272
export interface AudioInputParam extends InputParam {

0 commit comments

Comments
 (0)