Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Sun, 22 Jun 2008 15:27:48 -0700 (PDT),    group: microsoft.public.win32.programmer.directx.sdk        back       


Precise control of playback position   
I have a DirectShow application where I maintain a clock externally,
and I need to sync video to this clock. The external clock may not be
wall clock time; it might be going faster, it might be going slower,
all my application knows is that it's being fed timestamps in strictly
increasing order and must sync video playback to that timestamp each
frame.

My graph is currently set up with some input filter eventually leading
to an ISampleGrabber. I've been able to achieve what I want, for the
most part, using IMediaPosition:: put_CurrentPostion before getting
each frame via ISampleGrabber::GetCurrentBuffer -- although it's not
perfect. What is the best way to do this?

There are a couple of reasons why my current method isn't any good:

1) Not all codecs seem to support seeking this way.
2) DirectShow seems to create a background thread that's always
decoding, and everything happens asynchronously, and so it's not
necessarily true that the GetCurrentBuffer() call actually does get me
the frame at the precise timestamp I asked for.
3) DirectShow's background thread is always decoding stuff -- and
usually that means it's working on decoding frames that I don't care
about, since I'm going to use put_CurrentPosition every time anyway.
I'd like to not waste CPU here, and just have it decode frames on-
demand.

I don't need to worry about playing videos backwards, which may
simplify things.

Any advice is welcome,
Thanks,
Jason
date: Sun, 22 Jun 2008 15:27:48 -0700 (PDT)   author:   unknown

Re: Precise control of playback position   
On Sun, 22 Jun 2008 15:27:48 -0700 (PDT), jason.cipriani@gmail.com wrote:

> I have a DirectShow application where I maintain a clock externally,
> and I need to sync video to this clock...
...

Responded to in the Vista dshow forum.

Please do not multi-post.

See:   http://tmhare.mvps.org/help.htm#mp

-- 
Please read this before replying:
1. Dshow & posting help:  http://tmhare.mvps.org/help.htm
2. Trim & respond inline (please don't top post or snip everything)
3. Benefit others:  follow up if you are helped or you found a solution
date: Mon, 23 Jun 2008 10:23:26 -0600   author:   The March Hare [MVP] erland

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us