Kagami / ffmpeg.js

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

Build failed #62

Closed devalexqt closed 4 years ago

devalexqt commented 6 years ago

Buld failed, after: make all

` define attribute_deprecated attribute((deprecated)) ^ AR libswresample/libswresample.a 13 warnings generated. AR libswscale/libswscale.a AR libavutil/libavutil.a AR libavcodec/libavcodec.a LD ffmpeg_g WARNING:root:ignoring dynamic library libvpx.so because not compiling to JS or HTML, remember to link it when compiling to JS or HTML at the end WARNING:root:ignoring dynamic library libopus.so because not compiling to JS or HTML, remember to link it when compiling to JS or HTML at the end WARNING:root:ignoring dynamic library libass.so because not compiling to JS or HTML, remember to link it when compiling to JS or HTML at the end CP ffmpeg STRIP ffmpeg skipping strip ffmpeg make[1]: Leaving directory '/root/ffmpegjs/ffmpeg.js/build/ffmpeg-webm' emcc build/ffmpeg-webm/ffmpeg.bc build/fribidi/dist/lib/libfribidi.so build/freetype/dist/lib/libfreetype.so build/libass/dist/lib/libass.so build/opus/dist/lib/libopus.so build/libvpx/dist/lib/libvpx.so \ --post-js build/post-sync.js \ --closure 1 -s TOTAL_MEMORY=67108864 -s OUTLINING_LIMIT=20000 -O3 --memory-init-file 0 --pre-js build/pre.js -o ffmpeg-webm.js WARNING:root:for wasm there is usually no need to set OUTLINING_LIMIT, as VMs can handle large functions well anyhow INFO:root:generating system library: wasm-libc.bc... (this will be cached in "/root/.emscripten_cache/asmjs/wasm-libc.bc" for subsequent builds) INFO:root: - ok Stack: Error at assertTrue (eval at globalEval (/root/ffmpegjs/emsdk-portable/emscripten/1.38.8/tools/js-optimizer.js:114:8), :59:26) at Object.emitDCEGraph (/root/ffmpegjs/emsdk-portable/emscripten/1.38.8/tools/js-optimizer.js:8165:3) at /root/ffmpegjs/emsdk-portable/emscripten/1.38.8/tools/js-optimizer.js:8389:14 at Array.forEach () at Object. (/root/ffmpegjs/emsdk-portable/emscripten/1.38.8/tools/js-optimizer.js:8388:21) at Module._compile (module.js:635:30) at Object.Module._extensions..js (module.js:646:10) at Module.load (module.js:554:32) at tryModuleLoad (module.js:497:12) at Function.Module._load (module.js:489:3)

undefined:60 throw msg; ^ Assertion failed: could not find the assigment to "asmLibraryArg". perhaps --pre-js or --post-js code moved it out of the global scope? (things like that should be done after emcc runs, as they do not need to be run through the optimizer which is the special thing about --pre-js/--post-js code) Traceback (most recent call last): File "/root/ffmpegjs/emsdk-portable/emscripten/1.38.8/emcc", line 11, in python_selector.run(file) File "/root/ffmpegjs/emsdk-portable/emscripten/1.38.8/tools/python_selector.py", line 38, in run sys.exit(run_by_import(filename, main) if on_allowed_version() else run_by_subprocess(filename)) File "/root/ffmpegjs/emsdk-portable/emscripten/1.38.8/tools/python_selector.py", line 13, in run_by_import return getattr(importlib.import_module(os.path.basename(filename)), main)() File "/root/ffmpegjs/emsdk-portable/emscripten/1.38.8/emcc.py", line 2019, in run wasm_text_target, misc_temp_files, optimizer) File "/root/ffmpegjs/emsdk-portable/emscripten/1.38.8/emcc.py", line 2559, in do_binaryen emit_symbol_map=emit_symbol_map) File "/root/ffmpegjs/emsdk-portable/emscripten/1.38.8/tools/shared.py", line 2481, in minify_wasm_js js_file = Building.metadce(js_file, wasm_file, minify_whitespace=minify_whitespace, debug_info=debug_info) File "/root/ffmpegjs/emsdk-portable/emscripten/1.38.8/tools/shared.py", line 2501, in metadce txt = Building.js_optimizer_no_asmjs(js_file, ['emitDCEGraph', 'noEmitAst'], return_output=True) File "/root/ffmpegjs/emsdk-portable/emscripten/1.38.8/tools/shared.py", line 2344, in js_optimizer_no_asmjs return run_process(NODE_JS + [js_optimizer.JS_OPTIMIZER, filename] + passes, stdout=PIPE).stdout File "/root/ffmpegjs/emsdk-portable/emscripten/1.38.8/tools/shared.py", line 162, in run_process return run_base(cmd, universal_newlines=universal_newlines, check=check, *args, **kw) File "/root/ffmpegjs/emsdk-portable/emscripten/1.38.8/tools/shared.py", line 157, in run_base result.check_returncode() File "/root/ffmpegjs/emsdk-portable/emscripten/1.38.8/tools/shared.py", line 143, in check_returncode raise Py2CalledProcessError(returncode=self.returncode, cmd=self.args, output=self.stdout, stderr=self.stderr) tools.shared.Py2CalledProcessError: Command '['/root/ffmpegjs/emsdk-portable/node/8.9.1_64bit/bin/node', '/root/ffmpegjs/emsdk-portable/emscripten/1.38.8/tools/js-optimizer.js', '/tmp/tmpXBpHXl/ffmpeg-webm.bc.o.js.pp.js.mem.js.jsopted.js.jsopted.js.jsopted.js.jso.js', 'emitDCEGraph', 'noEmitAst']' returned non-zero exit status 1 Makefile:316: recipe for target 'ffmpeg-webm.js' failed`

devalexqt commented 6 years ago

https://www.bountysource.com/issues/52370706-fails-to-compile-dockerfile

CodeFetch commented 5 years ago

pre- and post-js is not intended to be used this way. The Q&D fix is to set -s WASM=0 in EMCC_COMMON_ARGS and remove the --closure 1 line as it is more strict now. The proper way is to MODULARIZE ffmpeg and rewrite the pre- and post-js files accordingly as this should give you a significant performance gain. See pre-js in https://kripken.github.io/emscripten-site/docs/tools_reference/emcc.html. It might also be possible to just append the pre-js code to the beginning and the post-js code to the end of the resulting file, but maybe I'm mistaken. I don't have time to look into it atm.

CodeFetch commented 5 years ago

@devalexqt I've resolved the issue and made it work with WASM. I'll clean it up for 100 bucks and make a pull-request.

devalexqt commented 5 years ago

Any speed compare?

Kagami commented 4 years ago

Should work now.

@CodeFetch as this should give you a significant performance gain

Any source for this?

I've seen MODULARIZE option, but haven't checked it yet, not sure if it's better than the current method. I'll maybe try it later.