Open iwanglian opened 2 years ago
You can still use this library on linux by cloning the repo + ffmpeg and build the module using node-gyp
#!/bin/bash
# remove previous builds
rm -rf beamcoder
rm -rf ffmpeg
rm beamcoder.node
# get repos
git clone https://github.com/Streampunk/beamcoder.git beamcoder
git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg
# build ffmpeg
cd ffmpeg
git checkout release/5.0
./configure
make -j4
# change binding.gyp to point include_dirs for os!=win to local ../ffmpeg repo
cd ..
node ./patch-beamcoder-gyp.js
# build the module
cd beamcoder
node-gyp rebuild
# copy the module
cd ..
cp beamcoder/build/Release/beamcoder.node beamcoder.node
and then use it
const beamcoder = require('./beamcoder.node')
async function test () {
beamcoder.logging('fatal')
console.log('Creating demuxer for test.mp4')
let demuxer = await beamcoder.demuxer('file:./test.mp4')
}
test()
patching binding.gyp can be done manually
"include_dirs": ["../ffmpeg"]
I have run in Mac and Ubuntu, but failed in CentOS.
I have installed ffmpeg from source, but when npm install beamcoder, it failed.