Using DirectShow to 1) count frames 2) Grab a frame by index, not the time

Hi, I am writing an app that will extract information about movies. It should be able to get the ***exact*** number of frames in a movie and also it should extract a frame ***with a given index*** and store it as a thumbnail.

I'm pretty new to DirectShow, just went through that GrabBitmaps sample project. It's neat and all, but IMediaSeeking accesses frames through time, which is just not quite what I need.

IVideoFrameStep::Step looks great except that it works no faster than simply playing the movie (according to the docs, haven't tried it myself). 8 - (

Well, that's my situation. HEEEELPP!!! 8 - D




Answer this question

Using DirectShow to 1) count frames 2) Grab a frame by index, not the time

  • Artix

    Well I figured a few things out. There is a call

    IMediaSeeking->SetTimeFormat( &TIME_FORMAT_FRAME ) that does exactly what I need. The only problem is: it doesn't seem to work for WMV video. BUT! For that case we have Windows Mediaformat SDK interface IWMSyncReader, which is also not bad at all. There are issues with indexing and re-indexing .wmv files (in case the previous index was not frame-based).

     

    This is all the info I have for the moment. Did anyone dig any deeper 8 - )



  • Brian Rogers

    I'm having the exact same problem. I don't know much about DirectShow, but I can't find a way to simply get the number of frames in a mediafile. I want to do the exact same thing, get frames by their numbers.

  • Using DirectShow to 1) count frames 2) Grab a frame by index, not the time