arut / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
13.22k stars 3.49k forks source link

Support for flv.js #1289

Open colmaengus opened 6 years ago

colmaengus commented 6 years ago

Hi,

I'm looking at replacing flash based players given flash is going to be removed from browsers very soon.

I came across fls.js (https://github.com/Bilibili/flv.js/) which supports flv playback over http (chunked) or websocket. It works well in conjunction with https://github.com/illuspas/Node-Media-Server. You publish RTMP and can playback in the browser with low latency.

However the server seems to be a little hungry for cpu.

Is there any interest/plans to add support for flv.js to nginx ?

Regards

Colm A

winshining commented 6 years ago

My project based on nginx-rtmp-module: https://github.com/winshining/nginx-http-flv-module has already supported it.

colmaengus commented 6 years ago

Wow. That's amazing. I didn't see that fork before. Just what I'm looking for.

I've switched to your module in but I'm seeing the following errors in flv.js flv.js:11447 [AMF] > Unsupported AMF value type 5 flv.js:11403 [AMF] > IllegalStateException: Data not enough when parse Value

The video starts, stops for a while and then plays again. Also the latency is larger than with RTMP using flowplayer.

Using node-rtmp and websocket playback this error isn't seen and latency is much closer to RTMP.

Our application is interactive video so I need to reduce the latency that we are getting with RTMP. Have you any experience to share in how to achieve low latency using flv over http ? I'm including in this avoiding issues where the latency increases due to combination of network and player buffer.

We managed to fix this in flowplayer but now have to fix it whatever no-flash solution we move to,

winshining commented 6 years ago

You can see here: https://github.com/Bilibili/flv.js/issues/263, it may be a bug. However, I have never met this error. You can specify the directive meta off; in rtmp block to avoid this error. Large latency may happen when gop_cache is on, it is used to reduce the wait time for the first picture of the video, but it increases the latency.