ffmpeg.js icon indicating copy to clipboard operation
ffmpeg.js copied to clipboard

FIX: build for emcc 2.0.9

Open erisco opened this issue 5 years ago • 12 comments
trafficstars

FIX: build for emcc 2.0.9, -r linking flag is required and a non-executable file extension to produce object files instead of javascript files

erisco avatar Nov 22 '20 20:11 erisco

I use erisco:master branch , but still get error

nm: /tmp/ffconf.bMB3JO1u/test.o: file format not recognized
ERROR: libx264 not found

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
make: *** [Makefile:203: build/ffmpeg-mp4/ffmpeg.bc] Error 1

fujinxiang avatar Nov 27 '20 11:11 fujinxiang

Do you know who is running nm there? If normal GNU nm tool doesn't works with emscripten since we use wasm object files which GNU tools can't parse.. You would need to use llvm-nm.

sbc100 avatar Nov 28 '20 18:11 sbc100

I don't konw, I just run make mp4 command in WSL (Ubuntu), this is error info image. error

fujinxiang avatar Nov 30 '20 02:11 fujinxiang

it seems that the error nm: /tmp/ffconf.bMB3JO1u/test.o: file format not recognized didn't affect the final output since I've successfully built while with the error shown.

It should be the error ERROR: libx264 not found that caused the build failure. however x264 should be built by this target: https://github.com/Kagami/ffmpeg.js/blob/d908a4ea3e690fcdc475ed368d42e33a98962206/Makefile#L113

perhaps you didn't fetch the submodules or there's something wrong with that part of Makefile?

zbryikt avatar Aug 23 '21 09:08 zbryikt

I don't konw, I just run make mp4 command in WSL (Ubuntu), this is error info image. error

install pkgconf apt install pkgconf

1inus avatar Oct 04 '21 22:10 1inus

Somewhere in your build system nm is being run directly. emcmake is setting $NM to point to llvm-nm, but if your build system doesn't honor this environment variable and just runs nm directly you will need to fix it.

sbc100 avatar Oct 04 '21 22:10 sbc100

I have new problem with em3(latest), could you help me to check it? @sbc100


wasm-ld: error: duplicate symbol: cos
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __cos
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __rem_pio2
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __rem_pio2_large
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __sin
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: floor
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

Aloento avatar Dec 21 '21 19:12 Aloento

Can share the full command line used to build both build/opus/dist/lib/libopus.so and build/lame/dist/lib/libmp3lame.so? Those math symbols should not end in these "shared libraries" (they are really just combined object files I this case I assume since are you most like building them with -shared and not with -sSIDE_MODULE, right?)

sbc100 avatar Dec 21 '21 19:12 sbc100

Can share the full command line used to build both build/opus/dist/lib/libopus.so and build/lame/dist/lib/libmp3lame.so? Those math symbols should not end in these "shared libraries" (they are really just combined object files I this case I assume since are you most like building them with -shared and not with -sSIDE_MODULE, right?)

Thanks for your reply! Please see here https://github.com/Aloento/ffmpeg.js

The build command for libopus and libmp3lame are same as the Kagami's version and works fine in very old em. The diff is that I added libwebp and removed h264. Now I'm trying to use em2.0.11 to build...

Aloento avatar Dec 21 '21 19:12 Aloento

After trying 2.0.11, I got:

wasm-ld: error: duplicate symbol: cos
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: log
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: exp
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __rem_pio2
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __rem_pio2_large
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __sin
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: __cos
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

wasm-ld: error: duplicate symbol: floor
>>> defined in build/opus/dist/lib/libopus.so
>>> defined in build/lame/dist/lib/libmp3lame.so

Then I tried em2.0.1 and I got ERROR: libwebp >= 0.2.0 not found using pkg-config

Now I'm so confused...

Aloento avatar Dec 21 '21 19:12 Aloento

Emscripten is in 3.0.1 these days. Can you try with this latest version?

sbc100 avatar Dec 21 '21 20:12 sbc100

@sbc100 this is from latest version

When I use the Kagami's em version then I got wasm-ld: error: unknown argument: -rpath

After removed libwebp, still get same errors. And I tried with SIDE_MODULE=1 emcc: error: WASM2JS is not compatible with relocatable output

Aloento avatar Dec 21 '21 20:12 Aloento