Kagami / ffmpeg.js

Port of FFmpeg with Emscripten
Other
3.29k stars 335 forks source link

Can't compile with recent emscripten. #85

Closed Narsil closed 4 years ago

Narsil commented 4 years ago

I have a series of error trying to compile with latest emscripten.

Here is my build commands

apt-get update
apt-get -y install wget python git automake libtool build-essential cmake libglib2.0-dev closure-compiler

cd /root # or /home/whatever
# Not available anymore
# wget https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz
# tar xzvf emsdk-portable.tar.gz
# cd emsdk-portable
# ./emsdk update
git clone https://github.com/emscripten-core/emsdk
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh

cd /root # or /home/whatever
git clone https://github.com/Kagami/ffmpeg.js.git
cd ffmpeg.js
git submodule init
git submodule update --recursive

make all

I have a few different errors, and I can't seem to clean the last one.

1. Error compiling fribidi:

I have an error in libtool in build/fribidi. It does not contain global_symbol_pipe. I can fix by seding libtool manually but it seems a bit like a hack (or remove NM=llvm-nm in the ffmpeg.js makefile) (https://stackoverflow.com/questions/23587972/libtool-error-during-linkage)

2. OUTLINING_LIMIT

shared:ERROR: Attempt to set a non-existent setting: 'OUTLINING_LIMIT' Just removed the option in the Makefile

3. Can't find libopus with pkg-config

Seems related to another issue linked here (https://github.com/emscripten-core/emscripten/issues/3280, ) Just removed --enable-libopus in the ffmpeg option for the time being

4. Ranlib error

Error is wasm-ld: error: libavfilter/libavfilter.a: archive has no index; run ranlib to add one

Just added --ranlib=emranlib to Makefile FFMPEG_COMMON_OPTIONS.

5. Duplicate symbols

The build now says that some symbols are duplicated

wasm-ld: error: duplicate symbol: __small_vsprintf
>>> defined in /home/nicolas/src/ffmpeg.js/build/fribidi/dist/lib/libfribidi.so.0.3.6
>>> defined in /home/nicolas/src/ffmpeg.js/build/freetype/dist/lib/libfreetype.so.6.12.0

I can't seem to fix this. Tried to add --ar=emar as suggested some places but it does not seem to be enough.

Any ideas on the last error ? Did any of the previous fix could have damaged the build ?

sunylyons commented 4 years ago

Did you ever sort this out? Seems to still be an issue

Kagami commented 4 years ago

Hi, I've fixed all build errors. Please try now.