Red5Pro and HLS

322 views
Skip to first unread message

Ricardo Kleemann

unread,
Jan 5, 2016, 10:48:48 AM1/5/16
to red5in...@googlegroups.com
Hi,

I understand Red5Pro now has HLS support. I haven't upgraded my version yet, but I'm curious whether the HLS support is "standard" for the players that are out there (for example, Flowplayer).

Would I simply point to a m3u8 playlist file? If I'm feeding Red5 using the "live" app, would the url to access be something like

http://<red5>/live/playlist.m3u8 ?

Also is there a way for Red5 to auto-record a stream that is being fed to the live app?

thanks
Ricardo

Mondain

unread,
Jan 5, 2016, 11:01:46 AM1/5/16
to red5in...@googlegroups.com
I'll let Chris or Andy answer the HLS uri part of your question, but for the auto-record part, red5 itself allows that on flash based sources by turning on the broadcaststream.auto.record flag in red5.properties.


--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Allen

unread,
Jan 5, 2016, 11:31:57 AM1/5/16
to Ricardo Kleemann, Red5 Mailing List
Hi Ricardo, see my response below. 

On Jan 5, 2016, at 11:01 AM, Mondain <mon...@gmail.com> wrote:

I'll let Chris or Andy answer the HLS uri part of your question, but for the auto-record part, red5 itself allows that on flash based sources by turning on the broadcaststream.auto.record flag in red5.properties.

Yup, and this should work just fine in Red5 Pro as well.


On Tue, Jan 5, 2016 at 10:48 AM Ricardo Kleemann <ric...@americasnet.com> wrote:
Hi,

I understand Red5Pro now has HLS support. I haven't upgraded my version yet, but I'm curious whether the HLS support is "standard" for the players that are out there (for example, Flowplayer).

Yes, any valid HLS player should be able to consume the stream. That said, we do some custom rotation stuff with mobile publishers that you would need to implement yourself if you want the orientation of the video to work correctly.

We created an example using video.js here: https://github.com/red5pro/red5pro-html5-hls


Would I simply point to a m3u8 playlist file? If I'm feeding Red5 using the "live" app, would the url to access be something like

http://<red5>/live/playlist.m3u8 ?

The url to access would be something like http://yourserver:5080/live/streamName.m3u8 

live is the context (default live)
“streamName" is whatever the published stream's name is.


Also is there a way for Red5 to auto-record a stream that is being fed to the live app?

Paul already answered this one. :)

Ricardo Kleemann

unread,
Jan 5, 2016, 11:54:56 AM1/5/16
to red5in...@googlegroups.com
Awesome, thanks for the replies... I'll upgrade and run some tests.

Ricardo

Ricardo Kleemann

unread,
Jan 5, 2016, 1:26:16 PM1/5/16
to red5in...@googlegroups.com
Hello Mondain,

Please see below

On Tue, Jan 5, 2016 at 8:01 AM, Mondain <mon...@gmail.com> wrote:
I'll let Chris or Andy answer the HLS uri part of your question, but for the auto-record part, red5 itself allows that on flash based sources by turning on the broadcaststream.auto.record flag in red5.properties.

If I set the flag to true, does that mean a stream being fed via rtmp to Red5 "live" app will be recorded? Where would that be stored?
 
Thanks
Ricardo

Chris Allen

unread,
Jan 5, 2016, 1:34:23 PM1/5/16
to red5in...@googlegroups.com
Chiming in for Paul here. All recordings get saved in the "streams" folder of the app you are connected to. In this case it will be live/streams.

Sent from my iPhone

Ricardo Kleemann

unread,
Jan 5, 2016, 11:25:17 PM1/5/16
to red5in...@googlegroups.com
Hi guys,

I've just upgraded to the latest red5pro but it is crashing with an exception

2016-01-05 20:14:17,019 [Launcher:/live] ERROR org.red5.server.scope.Scope - Could not start scope Scope [name=live, path=/default, type=APPLICATION, autoStart=true, creationTime=1452053656911, depth=1, enabled=true, running=false]

java.lang.IllegalStateException: Can't overwrite cause with java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [org.red5.server.api.scope.IScope]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.


There is no "/default" under webapps, I'm not quite sure what's wrong.

I'm running on Ubuntu Linux, I upgraded by simply pointing to the new directory red5pro-server-0.2.3.b84-release

I'm attaching the log file for reference.

thanks
Ricardo

red5.log

Ricardo Kleemann

unread,
Jan 6, 2016, 6:53:06 PM1/6/16
to red5in...@googlegroups.com
Hi guys,

Any help on this?

thanks
Ricardo

Chris Allen

unread,
Jan 6, 2016, 7:14:12 PM1/6/16
to red5in...@googlegroups.com
Hey sorry. I passed to the team, and we are looking into it. I forgot to get back to you.

But to help clarify, what do you mean by this exactly:

 upgraded by simply pointing to the new directory 

Are you running a new webapp that you created, or just connecting to the "live" webapp?

Sent from my iPhone

Ricardo Kleemann

unread,
Jan 7, 2016, 11:47:42 AM1/7/16
to red5in...@googlegroups.com
Hi Chris,

Please see below.

On Wed, Jan 6, 2016 at 4:14 PM, Chris Allen <mrchri...@gmail.com> wrote:
Hey sorry. I passed to the team, and we are looking into it. I forgot to get back to you.

But to help clarify, what do you mean by this exactly:

 upgraded by simply pointing to the new directory 

Are you running a new webapp that you created, or just connecting to the "live" webapp?

The problem is on server startup, even before any webapp is connected to.
The server does start up, but in a few seconds dies out with the exception. It is not directly related to any webapp

What I mean about "pointing to the new directory" is the red5pro root directory. I unzipped the new red5pro package onto the a new directory an the filesystem and point to that in order to start up the new version of the server.


 

Ricardo Kleemann

unread,
Jan 7, 2016, 5:13:59 PM1/7/16
to Cameron Turchetti, red5in...@googlegroups.com
Thanks Cameron.

Do you have a direct link so that I can download straight from my linux server? What I did was first download to my laptop and then transferred to the linux server... it would be best for me to do a straight wget or similar.


On Thu, Jan 7, 2016 at 1:22 PM, Cameron Turchetti <cam...@infrared5.com> wrote:
Hi Ricardo,

I had my team look at this and something looks like it got corrupted here - they suggested to download everything fresh, and expand it to a new location. Or to possibly use a different computer altogether. There seems to be some corruption or permission issues in play here.

But here it is broken down piece by piece:


The next error in the log is probably caused as a result of the first exception
2016-01-05 20:14:17,029 Launcher:/live ERROR org.red5.server.scope.Scope - Could not set persistence class java.lang.reflect.InvocationTargetException: null


The other part of the posted stacktrace eludes to the problem:

Caused by: java.lang.ClassNotFoundException: null at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1343)


The class is not identified, but it is trying to be instanced at appStart (from stacktrace).
com.infrared5.red5pro.live.Red5ProLive.appStart(Unknown Source)



The term or path of "default" is matches up with this line in the log:
2016-01-05 20:13:59,666 main INFO org.red5.server.ContextLoader - Loading: default.context = red5.root/webapps/red5-default.xml => /usr/share/red5pro/webapps/red5-default.xml

It means the default red5 context, it is not an app.

Please let us know if the fresh install doesn't work for you.

Best,
-Cameron

On Thu, Jan 7, 2016 at 12:53 PM, Chris Allen <mrchri...@gmail.com> wrote:


Begin forwarded message:




--
Cameron Turchetti
Project Manager


Ricardo Kleemann

unread,
Jan 7, 2016, 5:43:13 PM1/7/16
to red5in...@googlegroups.com
Thanks Chris and Cameron.

It seems that at least in terms of startup, things should be fixed now. I've started up the server and no exceptions...

I will test accessing the live app later.

Ricardo

On Thu, Jan 7, 2016 at 2:25 PM, Chris Allen <mrchri...@gmail.com> wrote:
Hey Ricardo,

The problem with that is that you have to authenticate with the server first before downloading. We looked into how to do it with the command line but ran into trouble doing that. So for now you have to use a browser to download it first. 

-Chris

Ricardo Kleemann

unread,
Jan 7, 2016, 11:29:07 PM1/7/16
to red5in...@googlegroups.com
Hi guys,

Here's the latest I have.

  • The auto record is working fine. Although the file created under streams is named "test.flv", I would have expected it to be named "<StreamName>.flv". If I have 2 streams coming in then I'm sure there will be a problem. Is there a way to configure this? It would be nice to have a file with the streamName and a timestamp
  • I am not having success accessing the m3u8 file. I'm using the suggested uri, http://yourserver:5080/live/streamName.m3u8 . In my example, the stream name is "live", so I attempted to access live.m3u8. I know the request is processed by the server. However on the client side, nothing happens. I tried accessing the m3u8 stream with 3 clients: Flowplayer, VLC and ffplay. 
    • Flowplayer sits there endlessly looping and never displaying anything
    • VLC doesn't show any specific error, but nothing happens
    • ffplay at least does provide some status, it says "invalid data found when processing input"
    • The Red5 log shows this (but nothing else):

2016-01-07 20:16:56,747 [http-nio-0.0.0.0-5080-exec-9] DEBUG c.r.s.t.mpegts.server.TSServlet - A8D040B04EEECB0B39526CBB44490C19

2016-01-07 20:16:56,747 [http-nio-0.0.0.0-5080-exec-9] DEBUG c.r.s.t.mpegts.server.TSServlet - /live/live.m3u8

2016-01-07 20:16:56,747 [http-nio-0.0.0.0-5080-exec-9] DEBUG c.r.s.t.mpegts.server.TSServlet - playlist name live



Rajdeep Rath

unread,
Jan 8, 2016, 7:39:18 AM1/8/16
to red5in...@googlegroups.com

Hi

Just a question :

What encoder are you using and with what codecs ?

Regards
Rajdeep Rath

Ricardo Kleemann

unread,
Jan 8, 2016, 10:01:33 AM1/8/16
to red5in...@googlegroups.com
Hi,

On Fri, Jan 8, 2016 at 4:39 AM, Rajdeep Rath <rajde...@gmail.com> wrote:

Hi

Just a question :

What encoder are you using and with what codecs ?


OBS (Open Broadcaster Software) with h264 and AAC

Those are the same codecs that are stored on the auto recorded flv file.

Ricardo Kleemann

unread,
Jan 8, 2016, 12:19:07 PM1/8/16
to red5in...@googlegroups.com
Guys, an update...

Regarding my comment on the streams file, I apologize, I was incorrect. It stores the name of the streamname correctly. It would be nice to have a timestamp associated, however. :-)

In terms of the Red5 output, if I try to access the stream via rtmp, it works fine (using uri rtmp://<server>/live/streamname). It's only if I try to access via HLS, using the uri http://<server>:5080/live/streamname.m3u8 which I get the error

Mondain

unread,
Jan 8, 2016, 1:16:07 PM1/8/16
to red5in...@googlegroups.com
For the timestamp thing, that's not how red5 records by default; if you want a custom modification of a recordings file name, you have to implement your own file handler.

Chris Allen

unread,
Jan 8, 2016, 2:11:26 PM1/8/16
to Red5 Mailing List
Yeah, you could look at my blog post on converting files to MP4. You can use that as a start. Just rename the file after it is recorded with the appended timestamp. 


-Chris

Ricardo Kleemann

unread,
Jan 8, 2016, 2:54:50 PM1/8/16
to red5in...@googlegroups.com
For the HLS problem, if it's any help here are fresh logs from restarting Red5, feeding a stream to it (stream name = test), and then attempting to access the test.m3u8 stream file
red5.zip

Ricardo Kleemann

unread,
Jan 8, 2016, 3:00:35 PM1/8/16
to red5in...@googlegroups.com
On Fri, Jan 8, 2016 at 4:39 AM, Rajdeep Rath <rajde...@gmail.com> wrote:

Hi

Just a question :

What encoder are you using and with what codecs ?


BTW, I'm getting the same error whether I feed Red5 via the OBS streamer or ffmpeg. Both using h264 and AAC with flv format. Red5 accepts the stream, it's only when attempting to output HLS m3u8 stream from Red5 that the error is seen
 
Reply all
Reply to author
Forward
0 new messages