[FFmpeg-devel] How to synchronize device sources

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


Noah Bergbauer (12020-01-26):
> Capturing with DXGI essentially *must* be done on a separate thread, as it is
> extremely time sensitive and starts dropping frames at the slightest delays.
> Dropping and duplicating frames also happens on that thread. This is why
> my DXGI device implements pts as a simple frame counter - I want ffmpeg
> to reproduce exactly the frames I return without ever duplicating or dropping
> anything by itself.

It seems like a strange design. A PTS that is only a frame counter does
not bring any information. I strongly suggest you use something more
relevant. If the device does not offer anything, use the wall clock.

> The goal it to use all of this directly from ffmpeg.exe, not only as a library.
> And from what I can see ffmpeg always calculates pts relative to the first
> value it sees, which would nullify the effect of using wallclock timestamps,
> even if I were to switch both devices to those.
> 
> Or is there a way explain to ffmpeg that yes, I actually want you to correlate
> the pts of these two devices with each other?

The ffmpeg commant-line tool by default will normalize the start time of
the input files, but there are options to keep work with the unaltered
input timestamps. The -copyts option is the first one that comes to
mind.

I do not know the current state with regard to handling live timestamps,
but these are things that can be enhanced.

But nothing can be done unless all the streams have proper and
comparable timestamps.

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/abe30396/attachment.sig>


More information about the ffmpeg-devel mailing list