Ne znam da li moze da pomogne, ali ovo je gotovo resenje koje ja koristim u VB-u, verujem da nije tesko da se prepravi za java-u posto je Win32 API u pitanju.
deklaracije :
Public Declare Function AVIFileOpen Lib "avifil32.dll" (ByRef ppfile As Long, ByVal szFile As String, ByVal uMode As Long, ByVal pclsidHandler As Long) As Long 'HRESULT
Public Declare Function AVIFileGetStream Lib "avifil32.dll" (ByVal pfile As Long, ByRef ppaviStream As Long, ByVal fccType As Long, ByVal lParam As Long) As Long
Public Declare Function AVIStreamLength Lib "avifil32.dll" (ByVal pavi As Long) As Long
Public Declare Function AVIStreamRelease Lib "avifil32.dll" (ByVal pavi As Long) As Long 'ULONG
Public Declare Function AVIFileRelease Lib "avifil32.dll" (ByVal pfile As Long) As Long
Public Const streamtypeVIDEO As Long = 1935960438 'equivalent to: mmioStringToFOURCC("vids", 0&)
Public Const OF_SHARE_DENY_WRITE As Long = &H20
procedura:
Dim res As Long 'result code
Dim szFile As String 'filename
Dim pAVIFile As Long 'pointer to AVI file interface (PAVIFILE handle)
Dim pAVIStream As Long 'pointer to AVI stream interface (PAVISTREAM handle)
Dim numFrames As Long 'number of frames in video stream
szFile = ime_AVI_fajla
'Open the AVI File and get a file interface pointer (PAVIFILE)
res = AVIFileOpen(pAVIFile, szFile, OF_SHARE_DENY_WRITE, 0&)
'Get the first available video stream (PAVISTREAM)
res = AVIFileGetStream(pAVIFile, pAVIStream, streamtypeVIDEO, 0)
'get the length of video stream in frames
numFrames = AVIStreamLength(pAVIStream)
Call AVIStreamRelease(pAVIStream) '//closes video stream
Call AVIFileRelease(pAVIFile) '// closes the file
fire, walk with me