Skip to content

Synchronize multiple track egresses #1139

@HubertChen

Description

@HubertChen

I'm hoping to receive guidance on how to composite and synchronize multiple TrackEgress instances.

Background

My application starts a conversation between an AI agent and a human. For maximum flexibility, I export multiple individual TrackEgress instances:

  • Agent audio
  • Microphone audio
  • Screenshare audio
  • Screenshare video
  • Webcam video

After a conversation has concluded, I'll create various composite files to meet business requirements. I believe I need to do this as certain combinations aren't supported by other egress types (e.g., agent audio, microphone audio, and webcam video).

Timestamps

There seems to be multiple timestamps we can use when trying to anchor and synchronize each track. The two that I've tried are:

  • EngressInfo.started_at - when the egress started
  • FileInfo.started_at - when the file recording started

EgressInfo isn't correct as an egress may have started, but a noticeable delay can happen until file writes. This is especially apparent when writing videos.

FileInfo.started_at is passable under good network conditions -- there are small synchronization deviations (100s of milliseconds or lower) but generally hard to detect. However, under bad network conditions, the composite file becomes out of sync.

Closing
I would love some help here as I've been struggling for the past few days.

  • Is it possible to synchronize TrackEgress instances?
  • If so, how would I do so?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions