Video Doesn't Seem to Play in AllegAVI
Dale M.A. Johnson

I'm toying around with AllegAVI and can't seem to get it to work. I've compiled the library and successfully linked it to my program, and when I load the clip, it doesn't give me any error returns. However, when I go to play the clip, it doesn't do anything, and just skips on to the next part of the program. I'm guessing I'm doing something wrong somewhere...

I've tried the demo files included with AllegAVI as well as ones of my own, but still to no avail. I'm using Visual C++ .NET Express Edition if it makes a difference...

A J

show us the code.

i use AllegAVI and it works good.

Dale M.A. Johnson
1 AllegAVI avi;
2 
3 scare_mouse();
4
5 switch(avi.Open("video/intro.avi"))
6 {
7 case -1:
8 allegro_message("The video file isn't there.");
9 exit(1);
10 case -2:
11 allegro_message("The video codec appears to be missing.");
12 exit(1);
13 case -3:
14 allegro_message("There was an error while trying to open the file.");
15 exit(1);
16 }
17 
18 avi.Play(screen, 0, 0, true, false);
19 avi.Close();

Am I not importing the clip right, or am I trying to play it the wrong way?

Oscar Giner

It's a weird error. I'd say the same as always: "it's an old lib that uses VfW and you may not have VfW codecs", but in that case Open should fail.

Are you setting/changing the video mode after calling Open?

Do the examples work for you?
Have you tried loading your movie with example1?

Dale M.A. Johnson

I never could get the examples to compile correctly.

And--This is wierd--On a whim, I replaced

avi.Play(screen, 0, 0, true, false);

with:

avi.PlayStart();
while (playing && !key[KEY_ENTER] && !key[KEY_ESC])
{
    playing = avi.PlayStep(screen, 0, 0, false, true);
}
avi.PlayEnd();

And... It works perfectly? Video shows up, plays sound, and everything. Doesn't make a lick of sense to me, since that's basically all avi.play did for me, right? Now I'm just confused, but it does work now, so I guess it's all good. ???

A J

which version are you using ?

Dale M.A. Johnson

AllegAVI 1.2

Thread #573764. Printed from Allegro.cc