diff --git a/binding.gyp b/binding.gyp index b5aaf6d..2d8af4b 100644 --- a/binding.gyp +++ b/binding.gyp @@ -1,7 +1,7 @@ { "targets": [{ "target_name" : "beamcoder", - "sources" : [ "src/beamcoder.cc", "src/beamcoder_util.cc", + "sources" : [ "src/beamcoder.cc", "src/beamcoder_util.cc", "src/log.cc" , "src/governor.cc", "src/demux.cc", "src/decode.cc", "src/filter.cc", @@ -90,10 +90,12 @@ }], ['OS=="mac"', { "include_dirs" : [ - "/opt/homebrew/Cellar/ffmpeg/5.0/include" + "/usr/local/Cellar/ffmpeg@5/5.1.3/include/", + "/opt/homebrew/Cellar/ffmpeg@5/5.1.3/include/", ], "library_dirs": [ - "/opt/homebrew/Cellar/ffmpeg/5.0/lib", + "/usr/local/Cellar/ffmpeg@5/5.1.3/lib/", + "/opt/homebrew/Cellar/ffmpeg@5/5.1.3/lib/", ] }], ] diff --git a/install_ffmpeg.js b/install_ffmpeg.js index 6e375c9..be18bfa 100644 --- a/install_ffmpeg.js +++ b/install_ffmpeg.js @@ -99,7 +99,7 @@ async function win32() { if (e.code === 'EEXIST') return; else throw e; }); - + const ffmpegFilename = 'ffmpeg-5.x-win64-shared'; await access(`ffmpeg/${ffmpegFilename}`, fs.constants.R_OK).catch(async () => { const html = await getHTML('https://github.com/BtbN/FFmpeg-Builds/wiki/Latest', 'latest autobuilds'); @@ -180,12 +180,13 @@ async function darwin() { console.log('Checking for FFmpeg dependencies via HomeBrew.'); let output; let returnMessage; - + try { - output = await exec('brew list ffmpeg'); + output = await exec('brew list ffmpeg@5'); returnMessage = 'FFmpeg already present via Homebrew.'; } catch (err) { - if (err.stderr !== 'Error: No such keg: /usr/local/Cellar/ffmpeg\n') { + if (err.stderr.indexOf('Error: No such keg') === -1 && + err.stderr.indexOf('ffmpeg@5') === -1) { console.error(err); console.log('Either Homebrew is not installed or something else is wrong.\nExiting'); process.exit(1); @@ -193,7 +194,7 @@ async function darwin() { console.log('FFmpeg not installed. Attempting to install via Homebrew.'); try { - output = await exec('brew install nasm pkg-config texi2html ffmpeg'); + output = await exec('brew install nasm pkg-config texi2html ffmpeg@5'); returnMessage = 'FFmpeg installed via Homebrew.'; } catch (err) { console.log('Failed to install ffmpeg:\n'); diff --git a/types/Filter.d.ts b/types/Filter.d.ts index 61ade20..c41d2e3 100644 --- a/types/Filter.d.ts +++ b/types/Filter.d.ts @@ -265,8 +265,8 @@ export interface VideoInputParam extends InputParam { height: number pixelFormat: string pixelAspect: Array - hw_device_ctx: HWDeviceContext // Optional - swPixelFormat: string // Optional + hw_device_ctx?: HWDeviceContext // Optional + swPixelFormat?: string // Optional } /** The required parameters for setting up audio filter inputs */ export interface AudioInputParam extends InputParam {