Re: Obtaining timestamp on video capture
- From: Geraint Davies <geraintd@xxxxxxxxxx>
- Date: Fri, 27 Mar 2009 10:43:00 +0000
On Thu, 26 Mar 2009 07:26:02 -0700, Alex
<Alex@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Greetings,
I have preview/capture graphs linked up using GMFBridge.
The preview graph have source connected to smart tee; the capture pin goes
to bridge sink and the preview pin goes to the sample grabber.
The capture graph have bridge source connected to a muxer then file writer.
A typical setup for continuous preview and separate capture using GMFBridge.
The application uses sample grabber to grab sample and display it back to
the user.
The problem I'm facing is that once the capture graph is running, I'd like
to know the time on the samples relative to the start of the capturing
process. But the samples are coming from sample grabber off the preview pin
hence they are not timestamped (even if they are, the timestamp are
meaningless since it's relative to the start of the preview graph, not
capture).
How do I sync up samples from one graph with timestamps from another?
Clearly there's not much you can do if there are no timestamps on the
samples (although the smart tee only strips the GetTime() timestamps,
and you might possibly be able to use the GetMediaTime() frame
numbers).
So first thing is to use the inftee instead of the smart tee, so that
you retain the timestamps. If you are feeding these to the video
renderer, this will result in all the samples being late, but
fortunately you are not: in your case, it doesn't matter that the
timestamps are late, because you are processing them in your app
independent of the dshow clock.
Then you need to know the timestamp at which you started capture. This
is recorded in the bridge sink as m_tFirst (see
BridgeSink::AdjustTime). This is used to ensure that the first sample
delivered to the capture graph is timestamped as zero. You will need
to extend the bridge slightly to allow the app to get access to this
value.
G
.
- Follow-Ups:
- Re: Obtaining timestamp on video capture
- From: mtsay
- Re: Obtaining timestamp on video capture
- References:
- Obtaining timestamp on video capture
- From: Alex
- Obtaining timestamp on video capture
- Prev by Date: Rentrancy in dotnet application calling DirectShow
- Next by Date: Re: Multiple monitor geometry
- Previous by thread: Obtaining timestamp on video capture
- Next by thread: Re: Obtaining timestamp on video capture
- Index(es):
Relevant Pages
|