|
-
Jan 17th, 2002, 04:51 PM
#1
Thread Starter
New Member
How to get AVI's info??such as framerate, resolution, length, etc.
Hi all..
I need to get the AVI's info by My VB Program.
Some one know how to do??
I want to get size,framerate, resolution, length, etc.
THX for everyone try to find the anser for me... m(_ _)m
--------------------------------
my English too bad.. >_<
--------------------------------
-
Jan 17th, 2002, 08:04 PM
#2
Addicted Member
VB Code:
Private Const OF_SHARE_DENY_WRITE As Long = &H20
Private Type AVIFILEINFO
dwMaxBytesPerSec As Long
dwFlags As Long
dwCaps As Long
dwStreams As Long
dwSuggestedBufferSize As Long
dwWidth As Long
dwHeight As Long
dwScale As Long
dwRate As Long
dwLength As Long
dwEditCount As Long
szFileType As String * 64
End Type
Private Declare Function AVIFileOpen Lib "avifil32" Alias "AVIFileOpenA" (ppfile As Long, ByVal szFile As String, ByVal mode As Long, pclsidHandler As Any) As Long
Private Declare Function AVIFileRelease Lib "avifil32" (ByVal pfile As Long) As Long
Private Declare Function AVIFileInfo Lib "avifil32" Alias "AVIFileInfoA" (ByVal pfile As Long, pfi As AVIFILEINFO, ByVal lSize As Long) As Long
Private Declare Sub AVIFileInit Lib "avifil32" ()
Private Declare Sub AVIFileExit Lib "avifil32" ()
Private Sub Form_Load()
'KPD-Team 2001
'URL: [url]http://www.allapi.net/[/url]
Dim hFile As Long, AviInfo As AVIFILEINFO
'initialize the AVIFile library
AVIFileInit
'create a handle to the AVI file
If AVIFileOpen(hFile, "C:\SIERRA\Half-Life\valve\media\sierra.avi", OF_SHARE_DENY_WRITE, ByVal 0&) = 0 Then
'retrieve the AVI information
If AVIFileInfo(hFile, AviInfo, Len(AviInfo)) = 0 Then
MsgBox "AVI dimensions: " + CStr(AviInfo.dwWidth) + "x" + CStr(AviInfo.dwHeight)
Else
MsgBox "Error while retrieving AVI information... :("
End If
'release the file handle
AVIFileRelease hFile
Else
MsgBox "Error while opening the AVI file... :("
End If
'exit the AVIFile library and decrement the reference count for the library
AVIFileExit
End Sub
-
Jan 18th, 2002, 05:37 AM
#3
Thread Starter
New Member
THX....i tried it
but some info is wrong...
my avi's code is mpeg4 v2,
such rate,MaxBytesPerSec got wrong info...
and how to get my avi'code(mpeg4 v2) in VB program??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|