Re: Obtaining timestamp on video capture

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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
.



Relevant Pages

  • Obtaining timestamp on video capture
    ... 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. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Obtaining timestamp on video capture
    ... graph, so that doesn't tell you anthing. ... So first you need the change I mentioned to get the first capture ... That then leaves you with the question of how long ago this buffer was ... One thing you could do is tweak the bridge sink to give you the ...
    (microsoft.public.win32.programmer.directx.video)
  • CLSID still image PIN_CATEGORY
    ... I figured out that I will be able capture an image into JPEG by using the ... //restart the graph - take 2 seconds ... I got a pointer to a frame buffer containing YV12 data. ... third-party filter, DMO or VCM codec (and some MPEG-4 ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: "TUNER NOT FOUND" in MCE?
    ... I am porting a AVStream driver to an video capture box ... I can use GraphEdit to setup filter graph (analog tuner, ... Do you have the magic white paper from Microsoft on "Developing Video ...
    (microsoft.public.development.device.drivers)
  • Re: pMedialControl->Stop() hangs indefinitely (sometimes)
    ... I could take a look at it here in the debugger ... >>> capture hardware. ... graph and rebuilding it will work fine. ...
    (microsoft.public.win32.programmer.directx.video)