Habe schon viel rumgegoogelt und im deu und engl. PB Forum gesucht.
Meine Absicht ist es, mich mit den funktionen der avifil32.dll auseinanderzusetzen. Nun würde ich gerne aus der Struktur der "AVIFILEINFO" welche die Funktion AVIFileInfo der avifil32.dll hergibt die Werte, wie z.B. Höhe, Breite, FPS etc. des Streams auslesen.
Hier der Code:
Code: Alles auswählen
#streamtypeVIDEO = $73646976
#AVIGETFRAMEF_BESTDISPLAYFMT = 1
#AVI_ERR_OK = 0
#Lib = 0
Procedure READOUTAVI (avifile.s)
Structure AVIFILEINFO
dwMaxBytesPerSec.l
dwFlags.l
dwCaps.l
dwStreams.l
dwSuggestedBufferSize.l
dwWidth.l
dwHeight.l
dwScale.l
dwRate.l
dwLength.l
dwEditCount.l
szFileType.s
EndStructure
res = CallFunction( #Lib, "AVIFileOpen", @pAVIFile, @avifile.s, #OF_SHARE_DENY_WRITE, 0 )
res = CallFunction( #Lib, "AVIFileGetStream", pAVIFile, @pAVIStream, #streamtypeVIDEO, 0 )
firstFrame = CallFunction( #Lib, "AVIStreamStart", pAVIStream )
numFrames = CallFunction( #Lib, "AVIStreamLength", pAVIStream )
CallFunction( #LIB, "AVIFileInfo", pAVIFile, @AVIFILEINFO, SizeOf(AVIFILEINFO))
CallFunction( #Lib, "AVIFileRelease", pAVIFile )
MessageRequester( "AVI Info", "Das Avi: "+avifile.s+" besitzt "+Str(numFrames)+" Frames"+Chr(13)+" Die Breite des AVIs ist is"+Str(dwWidth.AVIFILEINFO), 0 )
;EndIf
EndProcedure
OpenLibrary ( #Lib , "AVIFIL32.DLL")
CallFunction ( #Lib, "AVIFileInit" )
avifile.s = OpenFileRequester ( "Select AVS File", "", "Video|*.avs", 0 )
If avifile : READOUTAVI( avifile.s) : EndIf
CallFunction( #Lib, "AVIFileExit" )
CloseLibrary( #Lib )
Code: Alles auswählen
CallFunction( #LIB, "AVIFileInfo", pAVIFile, @AVIFILEINFO, SizeOf(AVIFILEINFO))
Hier ist ein Beispiel aus einem VB Code, den ich gefunden habe und ihn mal "verstehen" wollte, um es richtig zu PB hin zu portieren.
Code: Alles auswählen
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: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
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
Vielen Dank!
Inc.

PS: Warum ich nicht die PB internen MOVIE() Commands nutze ist, weil sie nicht Informationen über .avs Files wiedergeben können.
avs files sind Scripte/textfiles mit Videosources pointern und Filterroutinen, welche via avisynth (avisynth.dll) im system erkannt und als raw Videostream "frameserved" werden und via TmpgEnc, CCE etc erkannt werden. Die Movie() Commands passen da, aber die Outputs aus Funktionen der avifil32.dll sind correkt. AVIStreamLength funktioniert z.B korrekt.