ffmpeg-android-maker icon indicating copy to clipboard operation
ffmpeg-android-maker copied to clipboard

vp8/vp9 encode neon_dotprod related crash fixed by --enable-runtime-cpu-detect

Open juha-h opened this issue 1 year ago • 3 comments

First I would like to thank you for this project. I found it as good replacement to ffmpeg-kit which is not maintained anymore.

When I built the libs for my Android project, I noticed that when I used vp8 or vp9 codec, there was encode/neon_dotprod related crash. I got it fixed by this patch:

diff --git a/scripts/libvpx/build.sh b/scripts/libvpx/build.sh
index 4a39815..61c5eeb 100755
--- a/scripts/libvpx/build.sh
+++ b/scripts/libvpx/build.sh
@@ -56,7 +56,7 @@ NM=${FAM_NM} \
     --disable-unit-tests \
     --disable-decode-perf-tests \
     --disable-encode-perf-tests \
-    --disable-runtime-cpu-detect  || exit 1
+    --enable-runtime-cpu-detect  || exit 1

In the build I had --target-abis=arm64-v8a. I don't have any device with other target-abi.

So would it be possible by default enable runtime-cpu-detect when $ANDROID_ABI is arm64-v8a?

juha-h avatar May 02 '25 16:05 juha-h

Enabline the cpu feature detection for all the integrated external libraries is still on my todo list to implement. I don't remember the exact reason why I sticked to disabling it, yet IIRC 'enabling' is a bit more complex than just setting a build flag to 'true'.

Javernaut avatar May 05 '25 19:05 Javernaut

@juha-h Can you provide me some minimal project or code samples that would reproduce your issue with --disable-runtime-cpu-detect?

Javernaut avatar May 10 '25 15:05 Javernaut

@Javernaut Unfortunately my project is huge. First the libraries are produced this project:

https://github.com/juha-h/libbaresip-android/tree/video

end then used by the app of this project:

https://github.com/juha-h/baresip-studio/tree/video

juha-h avatar May 10 '25 16:05 juha-h