PC Review


Reply
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average.

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

 
 
Hartmut Schroth
Guest
Posts: n/a
 
      13th Dec 2003
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
 
Reply With Quote
 
 
 
 
RxR
Guest
Posts: n/a
 
      14th Dec 2003
Try http://www.directx4vb.com

Lots of good stuff re various versions of directx.



"Hartmut Schroth" <(E-Mail Removed)> wrote in message
news:059801c3c16b$d36ea0d0$(E-Mail Removed)...
> 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



 
Reply With Quote
 
Hartmut Schroth
Guest
Posts: n/a
 
      15th Dec 2003
Thanks a lot, seems to be quite good!
>-----Originalnachricht-----
>Try http://www.directx4vb.com
>
>Lots of good stuff re various versions of directx.
>
>
>
>"Hartmut Schroth" <(E-Mail Removed)> wrote in

message
>news:059801c3c16b$d36ea0d0$(E-Mail Removed)...
>> 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

>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DirectShow video editing in C# Michael A. Covington Microsoft C# .NET 1 2nd Apr 2006 06:22 AM
MediaDet class RicercatoreSbadato Microsoft C# .NET 0 29th Sep 2005 11:21 AM
MediaDet and StreamWriter (C#) RicercatoreSbadato Microsoft C# .NET 2 30th Jun 2005 04:22 PM
MediaDet and StreamWriter (C#) RicercatoreSbadato Microsoft C# .NET 1 30th Jun 2005 04:00 PM
DirectShow: Cannot assign Filename property of Dexter MediaDet object Hartmut Schroth Microsoft VB .NET 3 18th Dec 2003 05:55 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:39 PM.