Skip to content

使用脚本build_ffmpeg-emcc.sh编译后生成的a文件和你的github库里的a文件不一样 #9

@zouzg7829

Description

@zouzg7829

我用build_ffmpeg-emcc.sh脚本编译ffmpeg-3.4.8源代码,然后使用生成的a文件编译capture.c,发现报以下错误:
···
wasm-ld: error: ./lib/ffmpeg-emcc/lib/libavcodec.a(opusdec.o): undefined symbol: swr_alloc
wasm-ld: error: ./lib/ffmpeg-emcc/lib/libavcodec.a(opusdec.o): undefined symbol: swr_free
wasm-ld: error: ./lib/ffmpeg-emcc/lib/libavcodec.a(opusdec.o): undefined symbol: swr_is_initialized
wasm-ld: error: ./lib/ffmpeg-emcc/lib/libavcodec.a(opusdec.o): undefined symbol: swr_convert
wasm-ld: error: ./lib/ffmpeg-emcc/lib/libavcodec.a(opusdec.o): undefined symbol: swr_close
wasm-ld: error: ./lib/ffmpeg-emcc/lib/libavcodec.a(opusdec.o): undefined symbol: swr_is_initialized
wasm-ld: error: ./lib/ffmpeg-emcc/lib/libavcodec.a(opusdec.o): undefined symbol: swr_init
wasm-ld: error: ./lib/ffmpeg-emcc/lib/libavcodec.a(opusdec.o): undefined symbol: swr_convert
wasm-ld: error: ./lib/ffmpeg-emcc/lib/libavcodec.a(opusdec.o): undefined symbol: swr_convert
wasm-ld: error: ./lib/ffmpeg-emcc/lib/libavcodec.a(opusdec.o): undefined symbol: swr_close
···
如果在emcc命令加上参数./lib/ffmpeg-emcc/lib/libswresample.a,则可以编译成功,但是生成后的wasm文件有13M,而不是4M,而且,为什么你的github代码库中没有libswresample.a这个文件?

BTW,的确,使用你的github代码库中a文件编译capture.c,生成的wasm文件是4M。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions