Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run in CentOS ,failed when run install_ffmpeg.js #83

Open
iwanglian opened this issue Jan 17, 2022 · 1 comment
Open

Cannot run in CentOS ,failed when run install_ffmpeg.js #83

iwanglian opened this issue Jan 17, 2022 · 1 comment

Comments

@iwanglian
Copy link

iwanglian commented Jan 17, 2022

I have run in Mac and Ubuntu, but failed in CentOS.

I have installed ffmpeg from source, but when npm install beamcoder, it failed.

ffmpeg version n4.3.3 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-39)
configuration: 
libavutil      56. 51.100 / 56. 51.100
libavcodec     58. 91.100 / 58. 91.100
libavformat    58. 45.100 / 58. 45.100
libavdevice    58. 10.100 / 58. 10.100
libavfilter     7. 85.100 /  7. 85.100
libswscale      5.  7.100 /  5.  7.100
libswresample   3.  7.100 /  3.  7.100```


@BrainBust
Copy link

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"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants