.avi like input

Blitz3D Forums/Blitz3D Beginners Area/.avi like input

PCBGuy(Posted 2005) [#1]
I would like to add 100-300 frame avi files from 3DS Max into my Blitz Strategy game, inside one of my While/Wend loops. I just want to pop up a mini movie inbetween commands or actions. Can it be done or is it to much for Blitz?


IPete2(Posted 2005) [#2]
nah it is easy, render the frames out as a video avi or mpeg whatever.

You will need to use drawmovie something like this

Global file1$= "yourfilehere.mpg"
movie1=OpenMovie( file1$ )
If movie1=0 RuntimeError "Unable to open movie file"


Repeat
DrawMovie movie1,0,0,400,300 ; (this is x position ,y position, width, height)
Flip
Until Not MoviePlaying(movie1)
CloseMovie movie

See, no probelmo!

IPete2.

(if you have trouble with the file format, try renaming the avi to mpg or vice versa - I can't remember why but...)


PCBGuy(Posted 2005) [#3]
Thanks IPete2. Again the Blitz community made my game designing a whole lot easier. It works flawless and alot easier to figure out then the dizzy help example in the program help desc. You are invaluable to this site Pete!
P.S. (.avi) files work OK, renaming them to (.mpg) worked as well. All is good in Blitz land!


Genexi2(Posted 2005) [#4]
Keep in mind that when you use the DrawMovie command the FPS of the program gets locked to the FPS of the video file that's playing...


PCBGuy(Posted 2005) [#5]
Thanks for the input Genexi2. Since this is a static strategy game that may not be an issue. I however am going to design the next section of the game that will be more time sensitive, so for that reason I have to ask: If I need to "unlock" the frame rate, how can I do that?


_PJ_(Posted 2005) [#6]

Keep in mind that when you use the DrawMovie command the FPS of the program gets locked to the FPS of the video file that's playing...



Ahh! hats really interesting. Thanks!


fall_x(Posted 2005) [#7]
renaming them to (.mpg) worked as well.

You do know that when you rename an avi to .mpg, it's still an avi, right?


_PJ_(Posted 2005) [#8]
In fact, providing the original is a blitz-recognised format, you can rename the extension to anything you like or remove it completely and Blitz will still load it, because it is a useable format and Blitz can read the header.


IPete2(Posted 2005) [#9]
Hey Malice that's useful to know, thanks!

PCBGUY it's always a pleasure, thanks for your comments, and I'm glad it worked so well!

IPete2.


_PJ_(Posted 2005) [#10]
oh this works with any loadable files to my knowledge - graphics, meshes, images, sounds etc...