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?

LeoColman
  • 6,950
  • 7
  • 34
  • 63
  • https://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? – Harsha Jayamanna Nov 05 '17 at 16:54
  • 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 rules – LeoColman Nov 05 '17 at 17:47
  • 1
    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. – beat Nov 09 '17 at 11:08
  • I need java, because I'll control access to the Stream using Spring. It may be a proxy, can even be HTTP – LeoColman Nov 10 '17 at 03:56

1 Answers1

-1

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

DeadSpock
  • 478
  • 3
  • 13
  • 1
    I did try, and it doesn't work well with Spring(at least with what I tried to do). Care to ellaborate? – LeoColman Nov 10 '17 at 16:23