ant-media / LibRtmp-Client-for-Android

It is probably the smallest(~60KB, fat version ~300KB) rtmp client for android. It calls librtmp functions over JNI interface
http://antmedia.io
Apache License 2.0
674 stars 232 forks source link

RTMP throws fatal exception #44

Open LloydBlv opened 7 years ago

LloydBlv commented 7 years ago

While playing RTMP stream this weird exception happens, And gives no clue about why its happening:

E/ExoPlayerImplInternal: Source error. net.butterflytv.rtmp_client.RtmpClient$RtmpIOException at net.butterflytv.rtmp_client.RtmpClient.open(RtmpClient.java:53) at com.google.android.exoplayer2.ext.rtmp.RtmpDataSource.open(RtmpDataSource.java:57) at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:137) at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:692) at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:315) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) 08-26 22:40:08.186 7769-9587/com.myapp A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xf88e3c8c in tid 9587 (Loader:Extracto)

Please help!

mekya commented 7 years ago

Please check out the RTMPIOException errorcode

Can I test the rtmp url?

LloydBlv commented 7 years ago

@mekya Thanks for your response, the url is generated dynamically, so I cant share, I looked at the url you mentioned, Is there anyway to prevent the app from crash and show a proper error message?

mekya commented 7 years ago

Yeah sure, have you tried to catch the RTMPIOException with try-catch block and show an appropriate message?

ojw28 commented 7 years ago

The app doesn't crash when this error occurs. It's already caught by ExoPlayer internally, and propagated to the player's event listener (which gives you a handy point where you can show an appropriate error message).

If your app is crashing, it's not directly related to the logging at the top of this thread. You'd need to provide a more complete log or bug report.

keremkusmezer commented 6 years ago

I have also a similar issue you can find the bug detail in https://github.com/google/ExoPlayer/issues/3156

Rtmp Client also dies

mekya commented 6 years ago

It is interesting. The thread you mentioned(https://github.com/google/ExoPlayer/issues/3156) has been resolved. You are still having the sampe problem?

nagendraK6 commented 6 years ago

I am testing antmedia server and getting similar exception. The rtmp url works fine if I run from VLC player or ffplay on mac

I am putting rtmp url like this

rtmp://34.213.233.241:1935/LiveApp/228154535248454858718201

Error code i am receiving -4

nagendraK6 commented 6 years ago

/ExoPlayerImplInternal: Source error. net.butterflytv.rtmp_client.RtmpClient$RtmpIOException at net.butterflytv.rtmp_client.RtmpClient.open(RtmpClient.java:53) at com.google.android.exoplayer2.ext.rtmp.RtmpDataSource.open(RtmpDataSource.java:57) at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:692) at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:315) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)

aktjkt commented 6 years ago

Still Getting the same issue E/ExoPlayerImplInternal: Source error. net.butterflytv.rtmp_client.RtmpClient$RtmpIOException at net.butterflytv.rtmp_client.RtmpClient.open(RtmpClient.java:56) at com.google.android.exoplayer2.ext.rtmp.RtmpDataSource.open(RtmpDataSource.java:57) at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:841) at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:308) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764) Please Help

MarkDylan100 commented 6 years ago

@mekya how cant I catch the error?

`private fun play(rtmpUri: String) {
    try {
        player = ExoPlayerFactory.newSimpleInstance(
                DefaultRenderersFactory(this), DefaultTrackSelector(), DefaultLoadControl())
        val playerView = findViewById<SimpleExoPlayerView>(R.id.player_view)
        //val uri = Uri.parse(BuildConfig.STREAMING_URL)
        val uri = Uri.parse(rtmpUri)

        playerView.player = player

        val mediaSource = ExtractorMediaSource(uri, RtmpDataSourceFactory(), DefaultExtractorsFactory(), null, null)

        player?.prepare(mediaSource)
        player?.playWhenReady = true
    } catch (e: Exception) {
        println("invalid uri")
    }
}`

this try catch doesn't do anything