CrazyOrr / FFmpegRecorder

An Android video recorder using JavaCV and FFmpeg.
201 stars 48 forks source link

App is crashing when i open video recording page #48

Closed Vibinreji closed 6 years ago

Vibinreji commented 6 years ago

Hi, My app is crashing when i open video recording page.Demo app is working fine desktop screenshot .Here i attached the logs.

prachi07 commented 6 years ago

Same issue i am facing. issue

Vibinreji commented 6 years ago

@prachi07 if u find any solution just let me know.

CrazyOrr commented 6 years ago

Check the 'lib' folder in your built apk, like this:

screen shot 2018-07-19 at 3 29 08 pm

For example, if your app depends on library A and B, and library A provides native libs for both armeabi-v7a and arm64-v8a, library B provides native lib only for armeabi-v7a, then eventually your app would have 'lib' folder with following structure:

lib/
├── armeabi-v7a/                  
│   ├── liba.so // from library A
│   └── libb.so // from library B
└── arm64-v8a/
    └── liba.so // from library A

When the app runs on devices that only support armeabi-v7a, everthing is OK. But when it runs on devices support arm64-v8a, the system may only look into 'arm64-v8a' folder and unable to find 'libb.so' hence the UnsatisfiedLinkError.

This demo depends on an old version 1.3 of JavaCV, which only provides ffmpeg native libs for 'android-arm'(armeabi-v7a). If you need support for arm64-v8a, you should use version 1.4+, which provides native libs for arm64-v8a. You can configure dependencies as follows:

dependencies {
    ...
    def javacvVersion = '1.4.2'
    def ffmpegVersion = '4.0.1'
    compile(group: 'org.bytedeco', name: 'javacv-platform', version: javacvVersion) {
        exclude group: 'org.bytedeco.javacpp-presets'
    }
    compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: "${ffmpegVersion}-${javacvVersion}"
    compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: "${ffmpegVersion}-${javacvVersion}", classifier: 'android-arm' // for 'armeabi-v7a'
    compile group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: "${ffmpegVersion}-${javacvVersion}", classifier: 'android-arm64' // for 'arm64-v8a'
}

If UnsatisfiedLinkError still occurs after this, try ReLinker.

Vibinreji commented 6 years ago

Thankyou @CrazyOrr

prachi07 commented 6 years ago

Thanks @CrazyOrr.