I was able to play AVI file frime by frame using API only.
But i cant capture the frame.
From window point by point it slow and image is corrupded.
Is theri is a way to get to frame data using API.
Or that information must be somwhere in the memory.
PLEASE HELP !
Code: Select all
OpenLibrary(0,"winmm.dll")
width.l=512 ;width of window
height.l=384 ;and the height
mType.s="AviVideo"
statusBuf.s=""
filename.s="shrek.avi" ;the avi file name goes here
command.s=""
OpenWindow(0,0,0,width,height,#PB_Window_ScreenCentered,"",0)
CreateGadgetList(WindowID(0))
TextGadget(1,0,0,width,height,"ljl")
command="open "+Chr(34)+filename+Chr(34)+" type "+mType+" alias sfx"
CallFunction(0,"mciSendStringA",command,"",0,0)
hw1=GadgetID(1)
command = "window sfx handle " + Str(hw1)
CallFunction(0,"mciSendStringA",command,"",0,0)
CallFunction(0,"mciSendStringA","put sfx destination at 0 0 "+Str(width)+" "+Str(height),"",0,0)
CallFunction(0,"mciSendStringA","set sfx time format frames" ,"",0,0)
CallFunction(0,"mciSendStringA","info sfx file wait",statusBuf,254,0)
CallFunction(0,"mciSendStringA","status sfx length",statusBuf,254,0)
playLength=Val(statusBuf)
For r=0 To 50
Delay(1)
WindowEvent()
CallFunction(0,"mciSendStringA","play sfx from "+Str(r)+" To "+Str(r),"",0,0)
Next r
CallFunction(0,"mciSendStringA","close all","",0,0)
CloseWindow(0)
CloseLibrary(0)


