|
Say... what's the usual way of playina a .avi? |
jaime barrachina
Member #6,780
January 2006
|
I suppose there's loads of methods of playing a video file, but has allegro got anything specific for this? What would be the best way of showing a short (like 2 minutes long) avi type file? Any suggestions out there? "Under the sword lifted high There is hell making you tremble: But go ahead, And you have the land of bliss. - Miyamoto Musahshi" |
ReyBrujo
Moderator
January 2001
|
There used to be an add-on library, but I am not sure it is still developed. Better to use a MPEG file and KC's APEG instead. -- |
Jonatan Hedborg
Member #4,886
July 2004
|
Correct me if im wrong, but isnt saying "I want to play an .avi" pretty much the same as saying "I want to play a movie file", as .avi is a container file which can have just about any format inside it (that is, any audio, video, subtitle and what not)? There is a part of directX that can be used to play AVI's, if the user has the correct codecs installed. DirectShow i think?
|
Kitty Cat
Member #2,815
October 2002
|
Allegro has built-in support for playing FLI files. Though they are limited to 8bits-per-frame, don't contain audio, and don't compress well at all. AllegAVI (I don't have a url handy, sorry) uses the Video for Windows codecs to play videos, which are rather outdated in favor of DirectShow codecs. It is also Windows-only, and in C++. APEG (which I just updated) can handle MPEG-1 and Ogg (Vorbis audio and Theora video). It is in C, and should work on the same systems Allegro does. (Ogg Theora, btw, is comparible to DivX and XviD in size-vs-quality) -- |
jaime barrachina
Member #6,780
January 2006
|
So, basically, there's no decent way of playing a video file in allegro, and my other options are APEG, AllegAVI and directX. Any more suggestions? "Under the sword lifted high There is hell making you tremble: But go ahead, And you have the land of bliss. - Miyamoto Musahshi" |
Kitty Cat
Member #2,815
October 2002
|
Depends on what you mean by decent. APEG is quite flexible, and is able to use a modern format in a cross-platform manner. AllegAVI works as long as you have the proper VfW codecs and are in Windows using C++. And DirectX... well, I think I'll leave that one alone. -- |
jaime barrachina
Member #6,780
January 2006
|
Hum, if I'm aiming for simplicity, which one would you recommend? I must admit that AllegAvi non compatibility is a bummer... but I've looked at the code and it seems like something even I could folow. Well, still open to whatever suggestions that might come up. "Under the sword lifted high There is hell making you tremble: But go ahead, And you have the land of bliss. - Miyamoto Musahshi" |
Kitty Cat
Member #2,815
October 2002
|
APEG is quite simple. It comes with an example program called exsimple, which shows one of the simplest methods to getting a video to play. Basically, just call Past that, you can use the non-blocking poll method. // Open the file APEG_STREAM *stream = apeg_open_stream(filename); // Call this regularly to check if the video frame updated // If it returns something other than APEG_OK, playback is stopped apeg_advance_stream(stream, loop);
From here you can check if stream->frame_updated > 0, in which case there's a new frame in stream->bitmap for you to show (which you can blit to the screen, or wherever). Then when you're done with the file, call:
-- |
jaime barrachina
Member #6,780
January 2006
|
Thank you, I'll get to work on it first thing tomorrow. Thank you every one for your help "Under the sword lifted high There is hell making you tremble: But go ahead, And you have the land of bliss. - Miyamoto Musahshi" |
dudaskank
Member #561
July 2000
|
And there is MjpgAlleg too, in my signature, but it's a little old hehe, go for apeg or allegavi... But, if you want to try my lib, you are welcome Toque a balada do amor inabalável, eterna love song de nós dois |
|