IMediaInfo Interface

vbimport

#1

NeroVersionAPI has the IMediaInfo interface.

I create an IMediaAnalyzer object
I get the IFileInfo object from it using AddFile(“my video file”)
I get the IMediaInfo object from it using GetSegmentMediaInfo

I want the image at the 0 second position, so I do this

HBITMAP hFrame = NULL;
MediaInfo->raw_GetImage(0,(unsigned long *)&hFrame);

The returned ‘HBITMAP’ is not correct.

Can anyone tell me what kind of return variable “GetImage” returns. The docs only show unsigned long, but the IDL shows “HANDLE_PTR”, indicating some kind of GDI object.

I’d like to be able to extract video frames and modify them for my own purpose.


#2

Hi Gravy Jones,

I realize that I want to do the same thing as you. For last week have you had better result ?

Sly


#3

May be you will come back here one day…

Here is my code about what you said :

IMediaAnalyzer * mediaAnalyzer = NULL;
IFileInfo ** fileInfo = NULL;
mediaAnalyzer->raw_AddFile((BSTR)psPath,fileInfo);

int segIndex=0;
IMediaInfo ** pMediaInfo = NULL;
(*fileInfo)->raw_GetSegmentMediaInfo(segIndex,pMediaInfo);

HBITMAP hFrame = NULL;
(*pMediaInfo)->raw_GetImage(0,(unsigned long *)&hFrame);

I have a problem to initialize my IMediaAnalyzer pointer. I don’t know yet how to do.

Can you give me your feedback ?


#4

IMediaAnalyzerPtr spAnalyzer = NULL;
IFileInfoPtr spFileInfo = NULL;
HRESULT hr = spAnalyzer.CreateInstance(__uuidof(MediaAnalyzer), NULL, CLSCTX_INPROC_SERVER);
if(SUCCEEDED(hr))
{
spFileInfo = spAnalyzer->AddFile(psPath);

IProgressCallbackPtr spCallback = NULL;
QueryInterface(__uuidof(IProgressCallback),(LPVOID *) &spCallback);
spAnalyzer->AnalyzeFiles(spCallback);

Now i have that. To correctly filled spFileInfo, NeroVisionAPI doc says you must call the AnalyzeFiles method. But it needs to have a IProgressCallback pointer well initialized.

No news Gravy Jones ? Or anyone else ?