How to redirect a RTMP stream to clients
Asked Answered
D

1

9

I have a RTMP stream being broadcasted in the same server as my Spring Boot application.

For instance, it can be accessed using

rtmp://localhost/livestream

And it's a video livestream, broadcasted from a RED5 server. I want to redirect this livestream to any amount of clients that try to request it.

For example:

@Service
public class RTMPStreamHandler {

@RequestMapping("/stream") {
public /*Stream Object?*/ getStream() {
   //What should be returned?
   }
}

This kind of behaviour is necessary so that I can control when that RTMP stream can be accessed, as it will be live 24hrs, but only accessible in some of them. I'll put that logic on my Controller.

How can I setup SpringFramework to read from that RTMP stream and broadcast it to users that try to access that endpoint? Is that a possibility in Spring?

Diocese answered 3/11, 2017 at 3:50 Comment(4)
github.com/Red5/red5-examples/tree/master/springmvc have tried this? or are your trying to keep RED5 and spring app running separately and find a much more simple integration method?Doubly
The latter. I want a simple way to multistream a video in rtmp format. Can also be rtsp. I'll be streaming from an Ip Camera, and I'm attempting to re-stream it with red5+spring in rtmp format. I don't want to pass red5 server directly because I might have to block the access based on some rulesDiocese
Do you need Java at all for blocking access? It might be easier to just setup a reverse proxy and configure access there with basic auth or ip ranges.Erysipelas
I need java, because I'll control access to the Stream using Spring. It may be a proxy, can even be HTTPDiocese
T
-1

Try the Red5 Media Server (red5.org), it works with Spring, it may fit your purposes

Thimble answered 10/11, 2017 at 16:23 Comment(1)
I did try, and it doesn't work well with Spring(at least with what I tried to do). Care to ellaborate?Diocese

© 2022 - 2024 — McMap. All rights reserved.