TUTORIAL PART 1 - The video
PREFACE: I should point out here that most videos you find on the net are copyrighted - even if they say they are not. Videos are automatically copyrighted as soon as they are taken, and more often then not that copyright has been transferred to the owner of the website or other persons.
Now that that is out of the way.... thisis a very brief and simplified version of how to get video into GE, if you are really interested in this concept you should read up on video formats and compression, how and what streaming video is, and what a frame server is ( for more complex videos). In general tho, for our uses the following simple method should work.
first getting the video..
your best bet is to try to get an original AVI version or at least a downloadable version of the vid you want, becuase streaming videos are often heavily compressesed and as such will suffer in quality.
if you cannot get any version other then a streaming version you will need to use a "service" which captures the stream for you.. you can either use an online webservice, or there are downloadable applications that can do it for you, ....google for capture streaming video, or if you know where you are capturing from eg: youtube, then google for "capture youtube". or "save youtube";....... if you get stuck, pm me
next your best method of saving the video should be as a AVI - preferably a simple version not divx or such, but if you have to save it as a mpeg, or divx or flv etc etc you will then need to either
A: find a program that will convert your format to bitmaps, or
B: convert your video format to video AVI ( or some other acceptable format.)
For converting to bitmaps, usually you just need to google for your format plus "2bmp" eg: flv2bmp or divx2bmp or mpg2bmp etc etc
but the easiest solution is usually to convert the original to AVI because there are a LOT of AVI2BMP apps out there.
OK, so by now you should have a series of sequentially numbered bitmaps
(note: other formats are acceptable eg: sequentially numbered PNG files, or Jpeg files, but this will make no difference to the end size of your executable, because GE will convert them all to BMPs anyway. smaller files are only worth using if you plan on posting your GED files)
now with the sequenced Bitmaps, simply create a new actor, with multiple frames and direct it to load your bitmap sequence.
immediately ( you should see a "movie" ) you will notice 2 things
1. there may be unwanted "artifacts" or missing pixels in your movie (I will cover that shortly) or
2. your movie will run too fast or slow.. to fix this you must change the frame rate of the actor to match the original frame rate of the movie..
If the movie runs at a high frame rate you may have to change the frame rate of your entire game to one that is as high or higher then the original movie.
THE MISSING PIXELS...!! arrgg
One of the problems with using GE for movies, is that it assumes that every frame is like a normal sprite, and it will select the top left corner pixel of each frame and make all other pixels of the same color (in the same frame) transparent..
if the top left hand corner of the movies is nearly always the same or similar color, you can simply make a backdrop of the same ( or similar color) and place it behind the movie, this way any missing ( transparent) pixels will show the backdrop
for example: in my demo movie it showed the sky, so the transparent color was always some shade of light blue. if I were to place a light blue backdrop behind the video, all the missing pixels would appear light blue instead of black ( you can also do the same thing by changing the background color of the game..
however, if the top left pixels changes a lot in color, for example in scene changes or if action is occurring in that area of the vid.then you will need to modify every frame by hand and change that pixel to the same color in every frame ( and to a color that does not get used in your movie)
or, if there is enough interest I will write an application that will load up everyframe and add a single color 1 pixel border around each frame - using a method similar to my sprite designer..GE will then assume that is the transparent color and leave the rest of your video alone...
if enough people are interested ( please PM me) otherwise you may be able to write a script in photoshop or the gimp or some other tool to do the same thing
OK that should cover the basics of the video capture.. if not, or if i missed, something let me know..
In the next tutorial I will explain how to grab the sound, and how to synchronize it with your video..
and then if needed i will explain why you should use a canvas to display it ( saves space) and how to use the canvas - unless that is already obvious from previous posts..
oh and before you ask (and this is not an advert , simply one of the first tools i found, there are plenty more.. and you may already have some on your PC ( windows movie maker for example))
- I used
virtual dub
if you get errors you may need to also download the latest version of ffmpeg
http://ffdshow.faireal.net/mirror/ffmpeg/and use virtual dub to export to bmps (file->export->image sequence)
if you need the audio ( file->save wav)
have fun
feral
PS: i typed this in a bit of a hurry, so if there are any glaring spelling mistakes, or grammer issues, or I wrote something wrong
please PM me and i will fix it..