Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RtmpIOException with OPEN_CONNECT error #59

Closed
gevariya-ajit opened this issue Mar 5, 2018 · 7 comments
Closed

RtmpIOException with OPEN_CONNECT error #59

gevariya-ajit opened this issue Mar 5, 2018 · 7 comments

Comments

@gevariya-ajit
Copy link

gevariya-ajit commented Mar 5, 2018

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:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)

I have seen this error in many issues and some of them are already close but still i am not getting through.
Error is in my own app(not in demo), we are moving ffmpeg(IjkMediaPlayer) to ExoPlayer connection to stream our own camera, works fine IjkMediaPlayer but somehow not working with ExoPlayer.

ExoPlayer Setup

Running latest ExoPlayer 2.7.0
Tested with diff params in URL
rtmp://192.168.42.5:1936/live/myStream live=1 timeout=-1 buffer=32000 playpath=/myStream

Code

            player.setVideoSurface(surfaceHolder.surface)
            val factory = ExtractorMediaSource.Factory(RtmpDataSourceFactory())
            val extractorMediaSource =
                factory.createMediaSource(
                    Uri.parse("rtmp://192.168.42.5:1936/live/myStream live=1 timeout=-1 buffer=32000 playpath=/myStream"))
            player.playWhenReady = true
            player.addListener(object : Player.EventListener { ... })
            player.prepare(extractorMediaSource)

Positive IjkMediaPlayer setup.

            player.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "rtmp_listen", 1)
            player.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "timeout", -1)
            player.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "rtmp_live", "live")
            player.setOption(IjkMediaPlayer.OPT_CATEGORY_FORMAT, "probesize", 32)
            player.dataSource = streamUrl
            player.setDisplay(surfaceHolder)
            player.prepareAsync()
@gevariya-ajit
Copy link
Author

#44

@gevariya-ajit
Copy link
Author

gevariya-ajit commented Mar 7, 2018

Update

After cloning this project and debugging native c files, I found that the problem is with socket connection and giving Connection refused error with 111 code.
https://gist.github.com/gabrielfalcao/4216897

Still figuring how to fix though...

@mekya
Copy link
Contributor

mekya commented Mar 23, 2018

Are you stilll having the same issue?

May I try your stream url?

@gevariya-ajit
Copy link
Author

gevariya-ajit commented Mar 23, 2018

Yeah, I am connecting with my camera so URL is not helpful. FFMPEG able to connect though.

I think my camera work as a client and i need to work as server. since i am using RTMP client connection and handshake is not going through.

@mekya Do you have any suggestion where can i find RTMP server?

@mekya
Copy link
Contributor

mekya commented Mar 23, 2018

I think you may want to use Ant Media Server which our team develops :)

https://antmedia.io

@gevariya-ajit
Copy link
Author

Ah cool thanks 👍

@aktjkt
Copy link

aktjkt commented May 30, 2018

Still getting the same Issue Unable to resolve please help

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants