ltebean / Live

Demonstrates how to build a live broadcast app(Swift 3)
2.41k stars 419 forks source link

Delay #5

Open demylia opened 8 years ago

demylia commented 8 years ago

Hi, guys. It's really cool theme. I've created something like this using a little other stack devices and technologies. And I have a couple questions to you, which is a delay in your app? And what appear when the speed of connection becomes low - losing frames or video is frozen? Thank you in advance

San-Jeevan commented 8 years ago

the delay on RTMP should be minimal. I am hosting on my own RTMP server in the same country and I get like 500ms delay from showing my hand in front of iPhone camera to I can see it on a flash player on the PC.

HLS delay depends on how big the segment time is and also how fast your server can encode RTMP to HLS. Facebook live ditched HLS because of the delay making a near "real-time" stream impossible. As far as I know they use RTMP on nginx.

I am curious about the last question too. I see there is a useAdaptiveBitrate property but I have heard that is pretty damn hard to make this functionality work. Periscope guys used months to get it running. Edit:From the code it seems its adjusting its bitrate instead of dropping frames.

dourgulf commented 7 years ago

this is only demo, a really product will have far more than these.

wazowski78 commented 7 years ago

Hi, I am having more than 500ms, I am testing with a VPS so I know that is not the best way, but it works. I would like to know the config you have set in the rtmp server, and your server Memory and CPU speeds, in order to compare with mine.

I have spent some days setting up the server, installing nginx and ramp modules, the socket server as well, and now that I can run the project on my own server, I have a lot of delay and the results are far away from a real streaming experience :(

I am going to check what I can find, but if you can share this information I can start from somewhere else.

Thanks a lot.

papay0 commented 7 years ago

I installed everything, it's working, I use OVH. But the delay... When I use hlsplayer, it's like 10s, and with the app player it's way more. Any advice on the config?

San-Jeevan commented 7 years ago

hlsplayer has client side buffering. open it in vlc with 0 cache parameter