How can I use DirectShow Editing Services (MediaDet object) in VB.NET

H

Hartmut Schroth

Hi,

I want to develop a VB.NET application for saving video
frames (e.g. from an AVI file) to a JPEG-file and want to
use the MediaDet object of DirectShow Editing Services for
that.

The only code example I can find is the following script
in the DirectX help file:

-----------------------------------------------------------
-
Dim Det As New MediaDet
Const VideoGUID As String = "{73646976-0000-0010-8000-
00AA00389B71}"
bFoundVidStream = False

Det.FileName = "C:\Media\Example.avi"

' Look for a video stream.
For i = 0 To Det.OutputStreams - 1
Det.CurrentStream = i
StreamType = Det.StreamTypeB
If StrComp(StreamType, VideoGUID, vbTextCompare) = 0
Then
bFoundVidStream = True
Exit For
End If
Next

If bFoundVidStream Then
' Update the label with the duration.
VideoInfo.Caption = Det.FileName + ": " + Str
(Det.StreamLength) + " seconds"

' Load a poster frame.
TempFile = "C:\Temp.bmp"
Preview.ScaleMode = vbPixels ' Scale twips to pixels.
Det.WriteBitmapBits 0, Preview.ScaleWidth,
Preview.ScaleHeight, TempFile
Preview.Picture = LoadPicture(TempFile)
End If
-----------------------------------------------------------
-------

My Problem now is: how can I access a MediaDet object in a
VB project? Which references do I have to declare? Are
there any other code or project examples for the use of
MediaDet objects in VB.NET?

Regards and thanks for help in advance

Hartmut
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top