Javernaut / ffmpeg-android-maker

Contains a script that assembles FFmpeg library for Android
MIT License
586 stars 173 forks source link

'/mnt/ffmpeg-android-maker/build/ffmpeg/arm64-v8a/lib/*.so': No such file or directory #95

Closed Artim96 closed 3 weeks ago

Artim96 commented 3 weeks ago

I'm currently trying to compile a static ffmpeg binary that can also do hardware encoding. So I edited the ffmpeg build.sh to change --enable-shared and --disable-static to be --disable-shared and --enable-static. And also I added --enable-mediacodec and --enable-jni. But compilation always finishes with

/root/android-sdk/ndk/26.2.11394342/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-readelf: error: '/mnt/ffmpeg-android-maker/build/ffmpeg/arm64-v8a/lib/*.so': No such file or directory
cp: cannot stat '/mnt/ffmpeg-android-maker/build/ffmpeg/arm64-v8a/lib/*.so': No such file or directory

It does create a ffmpeg binary, though the hardware codecs don't seem to be functional.

This is the command I used to compile ffmpeg: docker run --rm -v /opt/ffmpeg-android-maker/:/mnt/ffmpeg-android-maker -e FAM_ARGS="--target-abis=arm64 -android=34 --enable-libdav1d --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopus --enable-libspeex --enable-libvpx --enable-libwebp --enable-libx264" javernaut/ffmpeg-android-maker

This is the log of the compilation: build_log.txt This is the resulting binary: ffmpeg.zip And when trying to transcode one of the big buck bunny videos with vp9_mediacodec (on a Pixel 9, so it's definitely supported), this is the resulting logs of ffmpeg (loglevel debug): ffmpeg_error.log though I don't see anything in ffmpeg's logs that would suggest any issues.

Javernaut commented 3 weeks ago

Hello @Artim96,

As for the first error you have:

I made a simple check for text relocations in the result shared libraries by executing llvm-readelf on all *.so files. I didn't test it with static libraries. Seems like you have to adjust it on your end. And actually reaching the point where this check is done is a good sign of the compilation being done successfully.

As for the hardware encoding, I'm afraid I'm out of capacity to dive deeper into the question. My efforts are in a bit different places at the moment.

Artim96 commented 3 weeks ago

It seems to be an error message that can be ignored. I built the same thing just with shared libraries which didn't throw these errors, with the same results. So for whatever reason the compiler doesn't find the shared libraries it tries to find, they don't seem to be needed.