[FFmpeg-devel] How to synchronize device sources

Nicolas George george at nsup.org
Sun Jan 26 22:36:57 EET 2020


Noah Bergbauer (12020-01-26):
> I am currently working on a patch that implements DXGI desktop
> capturing and WASAPI audio capturing for Windows.
> 
> For this, I implemented two new devices in libavdevice.
> 
> The basics work, but now I'm not sure how to synchronize the audio
> stream with the video stream. Specifically, the two devices
> obviously maintain independent pts, starting from the point in time
> when they were first read from. So while in most cases there
> is no human-noticeable offset, this does occasionally - with some bad
> luck - produce a rather large error.
> 
> So is there anything I'm missing here? How can I make sure the two
> streams sync up (other than hardcoding some kind of communication
> between them)?

Devices that do live capture should, at least as an option, use the
absolute clock as pts. With that information, syncing becomes easy.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200126/7f682265/attachment.sig>


More information about the ffmpeg-devel mailing list