gwuhaolin / livego

live video streaming server in golang
MIT License
9.57k stars 1.99k forks source link

Forward RTMP Stream to external RTMP Server #156

Open bgntv opened 3 years ago

bgntv commented 3 years ago

Great job with your development. I have been able to set it up and it is working. I'm stuck in one specific area. How can I forward the RTMP stream to another external RTMP Server? For example

The video source is rtmp://jfk.contribute.live-video.net/app/{stream_key} and the External / Forward is rtmp://publish.dailymotion.com/publish-dm/XXXX?auth=XXXXXXXX

I don't want to encode or make any changes. The goal is to forward the stream.

thank you, Santo

onthegit commented 3 years ago

Hello, I am also interested in this. Do we need to pipe the stream via ffmpeg to other rtmp servers or livego has this capability (without ffmpeg)

OBS -> livegoserver -> google rtmp, twitch rtmp ?

Thank you.

gabek commented 3 years ago

Take a look at Prism, that might be a good answer for you. https://github.com/muesli/prism

chornenky commented 3 years ago

Hi! I had the same issue, so I've solved it in this way: https://github.com/chornenky/livego/blob/relay-with-auth/protocol/rtmp/relay.go You need to implement interface Authorizer. Method Authorize must return an endpoint. The method is called on new incoming connection and relay server will establish a new connection to that endpoint to forward incoming data.