Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Video Doesn't Seem to Play in AllegAVI

This thread is locked; no one can reply to it. rss feed Print
Video Doesn't Seem to Play in AllegAVI
Dale M.A. Johnson
Member #1,103
March 2001
avatar

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...

------> SIG TIME!

"You know, I could be working on that battle engine... But NOOOO~, I'm too busy tweaking the title page." -Me

A J
Member #3,025
December 2002
avatar

show us the code.

i use AllegAVI and it works good.

___________________________
The more you talk, the more AJ is right. - ML

Dale M.A. Johnson
Member #1,103
March 2001
avatar

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?

------> SIG TIME!

"You know, I could be working on that battle engine... But NOOOO~, I'm too busy tweaking the title page." -Me

Oscar Giner
Member #2,207
April 2002
avatar

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
Member #1,103
March 2001
avatar

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. ???

------> SIG TIME!

"You know, I could be working on that battle engine... But NOOOO~, I'm too busy tweaking the title page." -Me

A J
Member #3,025
December 2002
avatar

which version are you using ?

___________________________
The more you talk, the more AJ is right. - ML

Dale M.A. Johnson
Member #1,103
March 2001
avatar

AllegAVI 1.2

------> SIG TIME!

"You know, I could be working on that battle engine... But NOOOO~, I'm too busy tweaking the title page." -Me

Go to: