Re: Moviethumbnails

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On 4 May 2005 00:06:40 -0700, avsforall@xxxxxxxxx wrote:

> Hi,
>
> I am trying to capture first frame of the movie file to display
> thumbnails in one of my application. For creating thumbnails I am using
> CListCrtl control do display thumbnails.I have writen message handler
> for LVN_GETDISPINFO ( i.e., ON_NOTIFY_REFLECT(LVN_GETDISPINFO,
> OnGetdispinfo)) message of CListCtrl. So, when it comes to the message
> controller methode I am tring to grap the first frame from the movie
> file using the following code and adding to the image list of listctrl.
> The code I implemented is given below:
>
> /*---------Code ******************/
> CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
> ID_IGraphBuilder, (void **)&m_pGraph);
> m_pGraph->QueryInterface(IID_IBasicVideo, (void **)&m_pBasicVideo);
> HRESULT hr1;
> hr1 = m_pGraph->RenderFile(wstrMediaFile, NULL);
> m_pBasicVideo->GetCurrentImage(&size, NULL);
> char *pBuffer = new char[size+2];
> m_pBasicVideo->GetCurrentImage(&size, (long *)pBuffer);
>
> m_pBasicVideo->Release();
> m_pGraph->Release();
>
> /*************code -----------*/
>
> For execute the about code taking time. So my application is little bit
> slower so it is taking about 20 seconds to display one screen of images
> from movie.
> In due course if user try to move one more window over my application
> in rapid mannere zigzag way fastly with mouse , then problem comming,
> My application giving "Application Error", then crashing. I tryied to
> debug, but the controle stopped at GetCurrrentImage() when it is
> crashed. So I am feeling that problem with this function.
>
> I would appriciate any one can give what is the problem in the above
> code and please give some tips to make my program faster.
>
> Suresh AV

I'm surprised it works at all. I would have expected you to at least have
to Pause the graph before doing GetCurrentImage.

Also, I would NOT consider trying to get the image on a callback. (My Mfc
is a little in the past so I may get this wrong). AS you point out the
graph building is slow - it can take many seconds. So you need to grab the
image in advance (or as a background task) and cache it.

There is NO alternative to building a graph for each file. You *can* short
circuit this using IMediaDet which encapsulates all the steps you are
doing.

You can also short circuit the graph building time if you KNOW what the
format of the files is (e.g. all MPEG or all WMV).

Iain
--
Iain Downs (DirectShow MVP)
Software Product Consultant
www.idcl.co.uk
.



Relevant Pages

  • Re: MAGIX - MEP Titles
    ... be white paper or video display). ... What appears in your final rendered movie (and what ... The structure of my MEP movie looked like this: ...
    (rec.video.desktop)
  • Re: MAGIX - MEP Titles
    ... be white paper or video display). ... What appears in your final rendered movie (and what ... The new RTF file is RTF-Colours.rtf ...
    (rec.video.desktop)
  • Re: WILL A PAL DVD PLAY IN NTSC COUNTRIES?
    ... The PAL speedup for theatrical movies may wreck havoc with ... |> If the movie is shot at 24 fps, it should be played at 24 fps. ... If I want to run a CRT display at 72 Hz, ... Conversion is so cheap these days. ...
    (rec.video.production)
  • Re: Whiskey Tango Foxtrot, over?
    ... encrypted authenticate-both-ways link between the display card and the ... The movie companies, as far as I can tell, think TCP+HDMI might be ... the performance of the human eye and ... the performance of consumer video cameras, ...
    (rec.arts.sf.fandom)