Thankyou TI994A. You guys are amazing. How do you find out how to do this stuff? I haven't been able to find anything that explains exactly how these commands work.
I tried your code and it works great.
I had to delete part of it in my program because it leaves another window to close after I close the main program and it won't let me show the video twice.
Code: Select all
wFlags = #PB_Window_ScreenCentered | #PB_Window_SystemMenu
OpenWindow(0, 0, 0, 600, 500, "Video Playback", wFlags)
p_PlayPracticeVideo()
Repeat
If IsMovie(450) And MovieStatus(450) = 0
FreeMovie(450)
MessageRequester("Movie Status:", "The playback has ended...")
EndIf
Until WaitWindowEvent() = #PB_Event_CloseWindow
But this part of it is exactly what I needed.
Code: Select all
Procedure p_PlayPracticeVideo()
If InitMovie() = 450
MessageRequester("Error", "Can't initialize movie playback !", 0)
End
Else
If LoadMovie(450, "Videos\ASL.wmv")
PlayMovie(450, WindowID(0))
ResizeMovie(450, 50, 50, 500, 400)
Else
MessageRequester("Error", "Can't load the movie...", 0)
EndIf
EndIf
EndProcedure
Regarding the playback speed, the RenderMovieFrame() function looks promising, although I'm not sure how. Plus, it seems to support only MPEG video, and requires the DirectX system (from the PureBasic manual).
The RenderMovieFrame() function only works under Windows. I want to make the program available on Mac and Linux if possible. On the other hand, I do want at least a Windows version if I can't write the other 2. I made a note to look at RenderMovieFrame() later if I can't find a cross-platform solution. IdeasVacuum may have had a viable solution if nothing else works:
Much depends on the movie format too. If you are using AVI files for example, then you could simply save each one with the range of different frame rates (number of frames per second) you require.