I have been troubled with compiling ffmpeg with emcc for almost a week.
shaw@ubuntu:~/share/ffmpeg$ emconfigure ./configure --prefix=../dist --cc="emcc" --disable-ffplay --disable-ffprobe --disable-ffserver --disable-asm --enable-pic
nm: /tmp/ffconf.5IUJHfaJ.o: File format not recognized
emscripten sdl2-config called with /home/shaw/tmp/myfastcomp/emscripten/emscripten/system/bin/sdl2-config --cflags
emscripten sdl2-config called with /home/shaw/tmp/myfastcomp/emscripten/emscripten/system/bin/sdl2-config --libs
install prefix ../dist
source path .
C compiler emcc
C library
ARCH c (generic)
big-endian no
runtime cpu detection yes
debug symbols yes
strip symbols yes
optimize for size no
optimizations yes
static yes
shared no
postprocessing support no
new filter support yes
network support yes
threading support pthreads
safe bitstream reader yes
SDL2 support no
opencl enabled no
JNI support no
texi2html enabled no
perl enabled yes
pod2man enabled yes
makeinfo enabled no
makeinfo supports HTML no
Enabled programs:
ffmpeg
External libraries:
iconv xlib
External libraries providing hardware acceleration:
Libraries:
avcodec avfilter avutil swscale
avdevice avformat swresample
shaw@ubuntu:~/share/ffmpeg$ emmake make
CC ffmpeg_filter.o
LD ffmpeg_g
WARNING:root:cmdutils.o is not valid LLVM bitcode
WARNING:root:ffmpeg.o is not valid LLVM bitcode
WARNING:root:emcc: cannot find library "X11"
CP ffmpeg
STRIP ffmpeg
strip:ffmpeg: File format not recognized
make: * [ffmpeg] Error 1
ERROR:root:Configure step failed with non-zero return code 2! Command line: ['make'] at /home/shaw/share/ffmpeg
I don't konw where is wrong. Is there someone met the problem and fixed it? Thanks a lot.
PS: There is no error when I compile ffmpeg with gcc.
My emcc version:
shaw@ubuntu:~/share/ffmpeg$ emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.36.0
clang version 3.9.0 (https://github.com/kripken/emscripten-fastcomp-clang 271ce598c3d1fe74efadc254f5be1b57edea9f41) (https://github.com/kripken/emscripten-fastcomp 61acfb230665464544f2e8db292f8999fc3c628c) (emscripten 1.36.0 : 1.36.0)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/shaw/tmp/myfastcomp/emscripten-fastcomp/build/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Selected multilib: .;@m64
INFO:root:(Emscripten: Running sanity checks)
It seems to be running the native tools strip and nm, both which are native tools. For Emscripten, you want to run Emscripten's llvm-nm and avoid running strip altogether.
@juj Thanks for your prompt reply. How should I do to avoid running the native tools and only run Emscripten's tools . I follow the web guide to compile it.
I think you'll need to edit the configure script of that project to do that. There is no one universal way but it is project specific to ffmpeg's project build system in question.
This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.
Most helpful comment
It seems to be running the native tools
stripandnm, both which are native tools. For Emscripten, you want to run Emscripten'sllvm-nmand avoid runningstripaltogether.