Results 1 to 3 of 3

Thread: How to get AVI's info??such as framerate, resolution, length, etc.

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Location
    Taiwan
    Posts
    2

    Question 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.. >_<
    --------------------------------

  2. #2
    Addicted Member kikelinus's Avatar
    Join Date
    Nov 2000
    Posts
    219
    VB Code:
    1. Private Const OF_SHARE_DENY_WRITE As Long = &H20
    2. Private Type AVIFILEINFO
    3.     dwMaxBytesPerSec As Long
    4.     dwFlags As Long
    5.     dwCaps As Long
    6.     dwStreams As Long
    7.     dwSuggestedBufferSize As Long
    8.     dwWidth As Long
    9.     dwHeight As Long
    10.     dwScale As Long
    11.     dwRate As Long
    12.     dwLength As Long
    13.     dwEditCount As Long
    14.     szFileType As String * 64
    15. End Type
    16. Private Declare Function AVIFileOpen Lib "avifil32" Alias "AVIFileOpenA" (ppfile As Long, ByVal szFile As String, ByVal mode As Long, pclsidHandler As Any) As Long
    17. Private Declare Function AVIFileRelease Lib "avifil32" (ByVal pfile As Long) As Long
    18. Private Declare Function AVIFileInfo Lib "avifil32" Alias "AVIFileInfoA" (ByVal pfile As Long, pfi As AVIFILEINFO, ByVal lSize As Long) As Long
    19. Private Declare Sub AVIFileInit Lib "avifil32" ()
    20. Private Declare Sub AVIFileExit Lib "avifil32" ()
    21. Private Sub Form_Load()
    22.     'KPD-Team 2001
    23.     'URL: [url]http://www.allapi.net/[/url]
    24.     'E-Mail: [email][email protected][/email]
    25.     Dim hFile As Long, AviInfo As AVIFILEINFO
    26.     'initialize the AVIFile library
    27.     AVIFileInit
    28.     'create a handle to the AVI file
    29.     If AVIFileOpen(hFile, "C:\SIERRA\Half-Life\valve\media\sierra.avi", OF_SHARE_DENY_WRITE, ByVal 0&) = 0 Then
    30.         'retrieve the AVI information
    31.         If AVIFileInfo(hFile, AviInfo, Len(AviInfo)) = 0 Then
    32.             MsgBox "AVI dimensions: " + CStr(AviInfo.dwWidth) + "x" + CStr(AviInfo.dwHeight)
    33.         Else
    34.             MsgBox "Error while retrieving AVI information... :("
    35.         End If
    36.         'release the file handle
    37.         AVIFileRelease hFile
    38.     Else
    39.         MsgBox "Error while opening the AVI file... :("
    40.     End If
    41.     'exit the AVIFile library and decrement the reference count for the library
    42.     AVIFileExit
    43. End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Location
    Taiwan
    Posts
    2
    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
  •  



Click Here to Expand Forum to Full Width