Android-RTMP-Muxer icon indicating copy to clipboard operation
Android-RTMP-Muxer copied to clipboard

Is this still working for facebook live streams? I'm suddenly getting header: -1.

Open MarsVard opened this issue 7 years ago • 10 comments

Is there anybody currently using this in any facebook live streaming apps?

MarsVard avatar Jan 29 '18 11:01 MarsVard

Hey @MarsVard !

Don't know about your issue (never used it with Facebook live servers) but I'm curious if you have more details and what's your use case around it.

Cheers

benoitletondor avatar Jan 29 '18 13:01 benoitletondor

@benoitletondor all I know is that the API url changed from rtmp.facebook to live-api.facebook.

I'm still unable to debug the rtmp connect call with Android studio. Looking for the correct tools to do so.

But I can't find any info in the documentation about any other changes they made.

I'll update this ticket as soon as I have more info.

MarsVard avatar Jan 29 '18 13:01 MarsVard

@benoitletondor I was trying some settings to figure this out, when I set the serverUrl to rtmp://live-api.facebook.com/rtmp/ I get this exception: Error reading length of object param: found 14336 out of a 239 bytes long buffer, aborting

Not sure what to make of it, am I not allowed to set the serverUrl in the start call?

MarsVard avatar Feb 02 '18 08:02 MarsVard

@benoitletondor the stream throws errors, like I mentioned yesterday, but it actually works if I do the following:

mRtmpMuxer.start(StreamService.this, DEFAULT_APP_NAME, "rtmp://" + DEFAULT_RMTP_HOST + "/rtmp", null);
mRtmpMuxer.createStream(STREAM_PATH);

Still throws the Amf0Functions exception saying "Error reading length of object param: found xxxxxxx out of a xxx bytes long buffer, aborting" though...

MarsVard avatar Feb 03 '18 13:02 MarsVard

Hey @MarsVard,

I think there's probably a bug with that parameter, serverUrl, but here's what the doc says about it:

URL of the target stream. Defaults to rtmp[e]://host[:port]/app/playpath.

So my guess is that maybe you don't need it. Let's say you have an URL that is something like: rtmp://server.com:9999/myapp/mychannel

It means that we have 4 parameters:

  • host: server.com
  • port: 9999
  • app: myapp
  • playpath: mychannel

To use them you need to use the Muxer like this:

RtmpMuxer muxer = RtmpMuxer(host, port, ...);
muxer.start(this, app, null, null);
muxer.createStream(playpath);

Does that make any sense to you?

Best

benoitletondor avatar Feb 05 '18 13:02 benoitletondor

Sure, but I think with new changes on facebook's side, you need to provide the serverURL too to make it work. because the way you suggest was what I had implemented and it was not connecting (throwing a header = -1 exception).

Now it's not throwing that exception so I can just start the stream and push frames to it.

MarsVard avatar Feb 05 '18 13:02 MarsVard

Ok so is it working or not? I'm not sure

benoitletondor avatar Feb 05 '18 14:02 benoitletondor

Sorry about the confusion. The status now is this: When I add the serverUrl, it throws a non fatal exception allowing me to "muxer.createStream(playpath);" and start pushing frames.

So I think there is a bug in the serverUrl part like you mentioned.

MarsVard avatar Feb 05 '18 14:02 MarsVard

help me please, I can not broadcast on youtube. I think the RtmpReader class is not suitable for youtube's rtmp server response.

de-gall avatar Aug 05 '19 18:08 de-gall

need help, please

de-gall avatar Aug 05 '19 18:08 de-gall