Ant-Media-Server
Ant-Media-Server copied to clipboard
WebRTC playback freezes when HLS streaming is enabled
Short description
WebRTC playback freezes when HLS streaming is enabled . When I disable HLS streaming, WebRTC plays smoothly. I've mounted Azure blob storage to record to HLS streams
Steps to reproduce
- Install Ant Media Server on a local instance at home
- Connect Azure Blob storage to streams folder
- Enable HLS
- Publish video to the server
- Play stream with WebRTC
Expected behavior
There should not be any freeze in WebRTC playback.
Actual behavior
Time to time it freezes. If I disable HLS streaming, it plays smoothly
Hi @mekya
There is a problem I ran into and I have an assumption.
Problem:
If we add Azure Blob storage without the -o allow_other
parameter while mounting, files cannot be written under the streams directory because of permissions. And this rarely spikes the CPU and creates a frame drop.
The command to be used while mounting is as follows.
blobfuse /usr/local/antmedia/webapps/WebRTCAppEE/streams/ --tmp-path=/tmp/blobfusetmp --config-file=/root/fuse_connection.cfg -o attr_timeout=240 -o entry_timeout=240 -o allow_other -o negative_timeout=120 --file-cache-timeout-in-seconds=240
Hypothesis: A 720p video transfers average 3Mbps/upload (asynchronous) data to transfer HLS chunks to blob storage. It may even be a bandwidth related issue. After all, a structure is used in NFS logic and there is a possibility of bottleneck.
Suggestion If blob storage is mounted to the stream directory for MP4 recording, files can be transferred by using user-defined script instead.
Hi @muratugureminoglu , @yashtandon113 ,@mekya,
We have actually reproduced this issue with a local hard drive. We were experiencing the same issue with a hosted VM - where our streams became very unstable - and after investigation we noticed that the issue was caused by drive speed - as soon as we swapped over to a SSD the issue was resolved.
I had a conversation with @mekya when we initially had issues and he said that the recording process needs to run in an asynchronous way so that it does not interfere with the quality of the live stream....
@mekya - do you think this might be implemented in a future release?
Thanks!
Hi @francoisdutoit ,
It's great to hear from you:) Thank you for letting us know. Yes, exactly it may be something in a future release. But I cannot give an ETA for now.
Thank you
Regards, A. Oguz
Thanks @mekya
Maybe you can update the Server requirements documentation for now to mention that a high speed drive / SSD is required?
Yes, definitely. Thank you @francoisdutoit
Added here as information: https://resources.antmedia.io/docs/installation
Thanks.