Coder Social home page Coder Social logo

Comments (7)

ThibaultBee avatar ThibaultBee commented on June 11, 2024 1

Ok, I will add this is in native dependencies (srtdroid and rtmpdroid):

    System.loadLibrary("crypto")
    System.loadLibrary("ssl")

Already in rtmpdroid: apivideo/api.video-rtmpdroid@d7eb771

But it will take a while.

from streampack.

ThibaultBee avatar ThibaultBee commented on June 11, 2024

hmm. That's going to be tricky.
Could you remove RTMP protocol dependency there:

implementation project(':extension-rtmp')
? You will have to remove RTMP classes as well.
It is just for a test.
Do you need both RTMP and SRT?
RTMP and SRT are both shipped with a version of libssl/libcrypto and I suspect that gradle picked one that is missing API.

from streampack.

benunderwood avatar benunderwood commented on June 11, 2024

Thanks for the reply.

I'm just doing some exploration at the moment so I'm not sure if I'll be using RTMP or SRT, I think either is suitable.

I've tried removing the RTMP dependency, and I find it still has the same error.

If I put back the RTMP dependency and remove the SRT dependency I get another error, which looks similar, but is from librtmp this time:

16:14:12.787 E createStreamer failed
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "DH_get0_pub_key" referenced by "/data/app/io.github.thibaultbee.streampack.sample-qXWgmifSgqUjLEmSW0FTSQ==/base.apk!/lib/armeabi-v7a/librtmp.so"...
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1669)
at video.api.rtmpdroid.RtmpNativeLoader.(RtmpNativeLoader.kt:9)
at video.api.rtmpdroid.Rtmp.(Rtmp.kt:19)
at io.github.thibaultbee.streampack.ext.rtmp.internal.endpoints.RtmpProducer.(RtmpProducer.kt:33)
at io.github.thibaultbee.streampack.ext.rtmp.internal.endpoints.RtmpProducer.(RtmpProducer.kt:28)
at io.github.thibaultbee.streampack.ext.rtmp.streamers.CameraRtmpLiveStreamer.(CameraRtmpLiveStreamer.kt:43)
at io.github.thibaultbee.streampack.ext.rtmp.streamers.CameraRtmpLiveStreamer.(CameraRtmpLiveStreamer.kt:34)
at io.github.thibaultbee.streampack.app.utils.StreamerFactory.createStreamer(StreamerFactory.kt:99)
at io.github.thibaultbee.streampack.app.utils.StreamerFactory.build(StreamerFactory.kt:132)
at io.github.thibaultbee.streampack.app.utils.StreamerManager.rebuildStreamer(StreamerManager.kt:89)
at io.github.thibaultbee.streampack.app.ui.main.PreviewViewModel$createStreamer$1.invokeSuspend(PreviewViewModel.kt:86)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:367)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:30)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:25)
at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:110)
at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:126)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
at kotlinx.coroutines.BuildersKt.launch(Unknown Source:1)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:47)
at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source:1)
at io.github.thibaultbee.streampack.app.ui.main.PreviewViewModel.createStreamer(PreviewViewModel.kt:84)
at io.github.thibaultbee.streampack.app.ui.main.PreviewFragment.createStreamer(PreviewFragment.kt:178)
at io.github.thibaultbee.streampack.app.ui.main.PreviewFragment.requestCameraAndMicrophonePermissions(PreviewFragment.kt:147)
at io.github.thibaultbee.streampack.app.ui.main.PreviewFragment.onStart(PreviewFragment.kt:137)
at androidx.fragment.app.Fragment.performStart(Fragment.java:3021)
at androidx.fragment.app.FragmentStateManager.start(FragmentStateManager.java:589)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:300)
at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:112)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1647)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3128)
at androidx.fragment.app.FragmentManager.dispatchStart(FragmentManager.java:3079)
at androidx.fragment.app.FragmentController.dispatchStart(FragmentController.java:262)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:510)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:251)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1391)
at android.app.Activity.performStart(Activity.java:7195)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2968)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
16:14:12.787 E at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1836)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6702)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:931)

from streampack.

ThibaultBee avatar ThibaultBee commented on June 11, 2024

I don't have a clue why this is happening 🤔
Might be because you are using a custom phone and something is missing in the implementation.

I made a test where I enforce loadLibrary of ssl and crypto: https://github.com/ThibaultBee/StreamPack/tree/test/openssl
Could you test it?
Hopefully it will be called before loading rtmpdroid and srtdroid.

from streampack.

ThibaultBee avatar ThibaultBee commented on June 11, 2024

For RTMP, you could try something like that the dependencies:

  implementation("video.api:rtmpdroid:1.2.1-packed")
  implementation project(':extension-rtmp') {
    exclude group: 'video.api', module: 'rtmpdroid'
    // exclude the transitive dependency to use packed version to avoid conflict with libssl.so and libcrypto.so
  }

from streampack.

ThibaultBee avatar ThibaultBee commented on June 11, 2024

Also found this relevant info: https://developer.android.com/training/articles/perf-jni.html#native-libraries

from streampack.

benunderwood avatar benunderwood commented on June 11, 2024

I've tried the test/openssl branch you created, and that fixes the problem for me, thank you!

I suspect you are correct that it is something missing on the device, and it's not a general issue. It's currently beyond my understanding, but if I work out what is happening I'll let you know.

from streampack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.