ant-media / Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
https://antmedia.io
Other
4.23k stars 619 forks source link

Corrupted video frames during the conference streaming. #3093

Open kapulkin opened 3 years ago

kapulkin commented 3 years ago

Short description

Some frames during the videostreaming come broken. That happens periodically with frequency from 1 time in 10 minutes to several times in a minute. There is a screenshot with a broken frame.

2021-03-08_16-46-13 (2)

Environment

Steps to reproduce

  1. Install Ant-Media Enterprise on remote server, for example in Google Cloud. Server should be powerfull enough to process conference with 3 participants. In my case server is run on Google cloud Virtual machine with 8-Core CPU.
  2. Enter license key to activate Ant-Media
  3. Open LiveApp settings and enable Adaptive Bitrate with two bitrates - high 3000kbps and low 1500kbps for resolution 720p. Set frame rate to 30 fps. Save settings.

2021-03-08_16-52-21

  1. Setup live conference from your computer with three participants. To emulate three participants I opened first tab in Chrome browser, second in incognito mode in Chrome browser, third in Firefox browser.
  2. Wait for 10 minutes and look with attention to notice, when corrupted frames appear

Expected behavior

I have a conference with three participants without corrupted frames, freezes are acceptable.

Actual behavior

Some times frames in one or two streams become corrupted on period 1-2 seconds. The moment the corrupted frame starts matches the moment in log /usr/local/antmedia/log/ant-media-server.log, when the next message occurs

2021-03-08_16-59-04

Logs

2021-03-08_16-59-04

I suppose that there is a moment occurs, when the internet speed becomes lower suddenly. Ant-media server switches from one bitrate to another and loses a keyframe or several frames, that precedes the broken frame. In terms of h264 protocol may be you should force to send IDR frame or SI frame as a first frame with a new bitrate.

kapulkin commented 3 years ago

The error also occurs on v2.3, installation file: ant-media-server-enterprise-2.3.0-20210302_1432.zip

mekya commented 3 years ago

Hi @kapulkin ,

It's likely a packet lost issue in the network. I think we can enable some SVC parameters in VP8 transcoding if applicable.

kapulkin commented 3 years ago

@mekya Yes, it looks like a packet loss. I read, that WebRTC could request server to send lost packets again.

I think we can enable some SVC parameters in VP8 transcoding if applicable.

You better understand, which parameters do you mean. Describe them please, and we can discuss.

The same issue has place for h264. If it is more comfortable for you to work with h264, you could do that.

mekya commented 3 years ago

@kapulkin ,

Thank you for your comments. Yes you are right about WebRTC could request server to send lost packets again. I can debug that part.

You better understand, which parameters do you mean. Describe them please, and we can discuss.

VP8 SVC options are better than H264. SVC makes the video playing more robust against the packet loss.

I'm moving it to the backlog to schedule for next release(hopefully next sprint)