ionorg / ion-avp

Audio/Video Processing Service
MIT License
61 stars 18 forks source link

WebmSaver produces files with gaps. #221

Open aromancev opened 3 years ago

aromancev commented 3 years ago

Your environment.

Everything is running on a local machine, so network issues are unlikely to be the reason.

Config:

AudioMaxLate: 100
VideoMaxLate: 200
MaxLateTimeMs: 1000
PLICycle: 1000

What did you do?

  1. Record a file with WebmSaver.
  2. Covert the file and create a dash manifest.
  3. Play the resulting file using dashjs or shaka player.

What did you expect?

Video is playing without gaps.

What happened?

Video has significant gaps (~5s) for a test 1-minute video. This drives dashjs crazy and it tries to fetch the same segment in an infinite loop. Shaka player doesn't even try to play the video after the first gap.

However, if loaded as a plain video file in chrome or VLC, the video looks completely fine.

I know it's a complicated issue, but I have no clue about encoding algorithms and what could go wrong here. Since sometimes I am able to produce a perfectly fine streamable dash compatible file, my guess would be that the conversion is fine. The problem must be in the original writer, which produces gaps in files. Maybe race conditions or network out-of-order delivery.

I wonder if you have any ideas on what could be wrong or at least where to start. I can provide a docker file to reproduce the issue on any generated file with one command.

Thanks!