[FFmpeg-devel] dshow: pts relative to zero or stream time preferred?

Roger Pack rogerdpack2 at gmail.com
Wed Mar 26 17:24:10 CET 2014


On 3/25/14, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Tue, Mar 25, 2014 at 04:58:42PM -0600, Roger Pack wrote:
>> Hello.
>>
>> I noticed that with today's dshow, it passes through pts timestamps
>> "relative to the directshow filtergraph" like:
>>
>> 889246977000
>> which could mean "first packet" (pts 0) for instance (packets after
>> that would be relative to that value).
>>
>> I could modify it so that the first packet (that represents pts 0) has
>> a pts of 0 (i.e. it's zero based).
>> However, then, sometimes, it might pass through negative pts values,
>> which might not be good.
>>
>> Does anybody have a feel for which type/style of timestamps are preferable
>> here?
>> Just wondering.
>> Thank you.
>> -roger-
>
> timestamps from capture devices must all be relative to the same
> point otherwise they could not be synchronized
> if they all return the time since year 19XY that works
> if they all start from pts=0 but that corresponds to different points
> in time it does not work
>
> of course one could change every capture device to start from pts=0
> and export the actual time that corresponds to, and then add that back
> somewhere before synchrinization but that would be more complex

OK it sounds like time since 19XY will work better here (the current
behavior) since sometimes we have 2 separate filtergraphs:

-f dshow -i video=X -f dshow -i video=Y

(this creates two graphs, with two separate clocks, but I believe the
clock/stream times are both relative to 19XY so having it the way it
is might keep those 2 graphs more closely in sync.)
Thanks!
-roger-


More information about the ffmpeg-devel mailing list