libswscale FFMpeg 库如何在 android 23+ 中工作
库:https://github.com/ser-gik/smoothrescale
你好!我有一个关于如何更新这个库并使其在最新的 android sdk 中工作的问题。
我正在使用在几个 android sdk 中运行的这个库,并注意到以下内容:
在 Android 30 中,项目目标为
compileSdkVersion 22 buildTools版本“22.0.1 targetSdkVersion 22
可以正常工作。
在 Android 30 中,项目目标为
compileSdkVersion 23 buildTools版本“23.0.3 targetSdkVersion 23
抛出错误 libswscale.so" 有文本重定位 (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23 )
在 Android 31 中,项目目标为
compileSdkVersion 22 buildTools版本“22.0.1 targetSdkVersion 22
应用程序显示一个对话框“此应用程序是为旧版本构建的”并关闭。
在 Android 31 中,项目目标为
compileSdkVersion 23 buildTools版本“23.0.3 targetSdkVersion 23
dlopen 失败:未找到库“libsmoothrescale.so”。
目标是使该库在 Android 23 到 31 中正常工作,但在几种情况下,我真的不知道应该从哪里开始调查和学习。
我应该了解该库在本机级别如何工作吗?是否可以仅使用 Android Studio 功能来实现此功能?欢迎任何指导或评论。
谢谢
Lib: https://github.com/ser-gik/smoothrescale
Hello! I have a question about how update this lib and make it works in latest android sdk.
I was working with this lib running in several android sdk and noticed the following:
In Android 30 , with proyect targeting
compileSdkVersion 22
buildToolsVersion "22.0.1
targetSdkVersion 22
works without problems.
In Android 30 , with proyect targeting
compileSdkVersion 23
buildToolsVersion "23.0.3
targetSdkVersion 23
Throws the error libswscale.so" has text relocations (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)
In Android 31 , with proyect targeting
compileSdkVersion 22
buildToolsVersion "22.0.1
targetSdkVersion 22
App show a dialog "This app was built for an older version" and close.
In Android 31 , with proyect targeting
compileSdkVersion 23
buildToolsVersion "23.0.3
targetSdkVersion 23
dlopen failed: library "libsmoothrescale.so" not found.
The goal is make this lib works in Android 23 until 31 , but with several scenarios I really don´t know where I should begin my investigation and learning.
Should I learn how the lib works in a native level? Is possible make this work only with Android Studio funtionality? Any guide or comment are welcome.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
上周我用 NDK-r23b 为 Android 12(目标 31)编译了 ffmpeg-4.3.1,并使用 ffmpeg-android-maker 没有问题。输出将为您提供 4 个拱门,包括 armeabi-v7a、arm64-v8a、x86、x86_64,每个拱门都有 *.so,如 libswscale.so
注意 ffmpeg-4.4.1 或 5.0 在我的测试中将输出 vstencxxxx 错误编码帧时(尚未解决),所以暂时不要使用它们。
您还需要来自ffmpeg-android-maker/output/include 替换
因为 *.so 需要使用相应的头文件。
这就是为什么您会收到类似 libswscale.so" has text relocations 的错误
。只需替换 *.so 有时不向后兼容。
Last week i've compiled ffmpeg-4.3.1 with NDK-r23b for Android 12 (target 31) with ffmpeg-android-maker without a problem. The output will give you 4 archs including armeabi-v7a, arm64-v8a, x86, x86_64 each have *.so like libswscale.so
Note ffmpeg-4.4.1 or 5.0 will output vstencxxxx errors in my test when encoding frames (not solved yet) so DON'T use them yet.
You also need headers from ffmpeg-android-maker/output/include replace
Because *.so needs to work with corresonding header files.
This is why you get error like libswscale.so" has text relocations
. Simply replace *.so sometimes not backward compatible.