Issue of EMS on Facebook Live
We are trying to push our input streams to facebook live and have a few questions on how to do it correctly.
What we do now is, as soon as we have a new input stream in EMS, we push it to Facebook live like this:
pushStream uri=rtmp://rtmp-api.facebook.com:80/rtmp
localStreamName= targetStreamName=
It works fine, we have the Facebook live video.
But when we stop the stream (the stream that we forward to EMS via RTSP) and relaunch it, Facebook live stops working. Even if I remove the facebook live config in EMS and re-do a pushstream.
Same problem if I recreate a Facebook RTMP url and do a a new pushstream command with this new url.
EMS doesn’t complain and report any errors, status of the facebook live config is “Streaming” with a correct farIp, A/V packets are clearly sent to Facebook.
What is the proper way of publishing a new facebook live stream? and do have any clue why we are facing these problems when we stop and relaunch a stream ?
4 Answers
Hi,
Can you explain more what you did and the error that you encountered?
You mentioned:
when we stop the stream (the stream that we forward to EMS via RTSP) and relaunch it, Facebook live stops working
Please explain more how you STOP THE STREAM AND RELAUNCH IT.
Did you remove the Source Stream and the Pushstream config? If so the FB RTMP URL and Facebook Live that was posted would no longer work.
When you “relaunch it”, you have to use a new pushstream and new fb rtmp url. Does this not work on your side?
Here is our architecture:
WebRTC Gateway (source stream) EMS Server
Facebook live
So as I explained: stopping the input stream is from our side, so it means that we stop to forward our source stream to EMS through the RTSP connection (i.e. we close the RTSP connection). Is it more clear like this?
No, we didn’t remove the source stream. As we close the input stream RTSP connection, it is removed automatically by EMS.
At this point yes it is clear that Facebook live stops working, as expected…
But the Facebook pushstream config stays alive, so I would expect that when I relaunch my source stream (so I reinit the RTSP connection with EMS from my webrtc gateway), of course with the same name, it is automatically forwarded through RTMP to facebook live. From EMS side it seems to be the case (my Facebook live stream appears automatically and the video and audio bytecounts increase regularly), but it doesn’t work in Facebook live: the video doesn’t show, when I try to play it I get an infinite spinner (to be completely exhaustive, I notive also that when I reload the page, from time to time I see a different key picture). So the video seems to be sent but not quite the same as the first time. I have no errors in EMS, and the only thing I can do is to describe Facebook behavior when it doesn’t work.
Yes we also tried to generate a new rtmp url and do a new pushstream, but with the same result as described above.
EMS has the capability to try to reconnect to the stream that was pushed (meaning pushstream configuration was saved by ems). I don’t think Facebook Live has that capability yet that’s why it does not work.
Please try this. Before you generate a new fb rtmp url, delete first the corrupted post with the fb rtmp. Then, generate a new fb rtmp url. Do a new pushtream to this new fb rtmp url.
Hope that helps.