livekit / egress

Export and record WebRTC sessions and tracks
https://blog.livekit.io/livekit-universal-egress-launch/
Apache License 2.0
184 stars 74 forks source link

Avoid recording room composite before video is decoded #806

Closed davidzhao closed 2 days ago

davidzhao commented 5 days ago

It's likely to receive delta frames that are not decodable in the start. This would produce an undesirable black screen in the beginning of the recording.

biglittlebigben commented 5 days ago

This means we'll potentially cut some audio from the start of the recording, until a video becomes decodable. Is this always desirable?

I can also see how a few customers may have a broken setup where they publish a video track but never send any video so we'd want to advertise this change pretty explicitly in the changelog.

davidzhao commented 4 days ago

It's a tricky one for sure. these are the use cases:

  1. video users do not want to record a black screen as the initial thumbnail
  2. audio-only users should work immediately
  3. edge cases like having a video published, but no frames coming through

before this PR, it doesn't satisfy 1, which is where users have been complaining about.

For 2, we should move this to mixing within the process, instead of using templates for them.

  1. may still be an issue, and I think it's handled by adding a timeout (one could argue 10s is too long, I'd be happy to lower it to 5s). I think if folks have custom use cases, they should host their own template. It feels kind of broken that the primary use case (recording a video) doesn't work correctly.