PDA

View Full Version : Number of frames in d2v


tbone_uk
3rd June 2002, 02:08
Ok guys I know that this has been covered on http://aquaplaning.20m.com/ site when used with delphi. Indeed I have this working great, but I have recently moved a project completly to Visual c++ 6 and I wondered if anyone has a working example using c++.

I know you have to call the MPEG2DEC.dll and call a function to retrieve the video info but I am at a loss of how to do this. (just having a bitch of a time today with dll's). Is this done in a similar way to the delphi example mpeg2dec_src.

Keep up the good work
:rolleyes:

mtrooper
3rd June 2002, 12:11
Well, my c++ is a little rusty on win32 but it should be done something like this:



//pVideoInfo is pointer at TVideoInfo struct

HMODULE hMPEG2;
pVideoInfo (*openMPEG2video)(filename: PCHar);

void initMpeg2()
{
hMPEG2= = LoadLibrary ( "MPEG2DEC.DLL" );
openMPEG2video = (pVideoInfo (*) (filename: PCHar)) GetProcAddress (hMPEG2, "_openMPEG2Source@4");
}



and then just do the same like in delphi sample to get pVideoInfo and from there number of frames

Ih, yeah: I didn't compile this, so there are probably a million sytax errors but I hope it at least gives you a idea :)