Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Video files in Allgro?

Credits go to Ariesnl, Arthur Kalliokoski, Derezo, Evert, gnolam, HoHo, Jonny Cook, Kitty Cat, Michael Faerber, Michael Jensen, Randal Stackpoole, ReyBrujo, Thomas Fjellstrom, Tobias Dammers, Victor Williams Stafusa da Silva, and Zaphos for helping out!
This thread is locked; no one can reply to it. rss feed Print
Video files in Allgro?
Martano
Member #6,536
October 2005
avatar

Is there a way to play a video file ( like .avi ) in Allegro?

ReyBrujo
Moderator
January 2001
avatar

Yes, several. Apeg is the one that comes to my mind.

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

Kitty Cat
Member #2,815
October 2002
avatar

Note that APEG won't play AVI files. It will play MPEG-1 and Ogg Vorbis/Theora files, though.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Martano
Member #6,536
October 2005
avatar

Ogg? Can it play music files too?

Ariesnl
Member #2,902
November 2002
avatar

If you're making a freeware / opensource game you could use Fmod vor music and sound effects

Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard)
Current project: [Star Trek Project ] Join if you want ;-)

Martano
Member #6,536
October 2005
avatar

I am making a small game, just for my friends. ;D

And I would like to play a video and some musics. I am using .wav files, but they are too big. Is there a way to use .gif files too?

Ariesnl
Member #2,902
November 2002
avatar

not that I know..

wav is good for soundeffects for other things ude MP3 or trackermusic ( mod s3m etc) midi sounds bad

Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard)
Current project: [Star Trek Project ] Join if you want ;-)

Kitty Cat
Member #2,815
October 2002
avatar

APEG can play Ogg Vorbis audio/music too, yes.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Tobias Dammers
Member #2,604
August 2002
avatar

Quote:

And I would like to play a video and some musics. I am using .wav files, but they are too big. Is there a way to use .gif files too?

You do realize that .gif files are images (albeit with limited animation possibilities), not audio or video files?

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

Martano
Member #6,536
October 2005
avatar

Quote:

You do realize that .gif files are images (albeit with limited animation possibilities), not audio or video files?

Sure. ;D
But I would like to use .gif to save some space. Is there a way to do this?

Michael Jensen
Member #2,870
October 2002
avatar

There is a png library that you can use (which is much more flexible than gif, and about the same size) if you don't need animation, gif limits you to 256 colors anyway, why not use the built in pcx? (also loading gif animations would be a lot harder than putting a list of images into a single pcx file, the only limits that I know of with pcx is that allegro will only load 8 bit pcx files, no loss compared to gif tho) also pcx are RLE encoded so you see a huge compression compared to bmp. (png is still smaller)

Evert
Member #794
November 2000
avatar

Quote:

the only limits that I know of with pcx is that allegro will only load 8 bit pcx files

Eh?

PCX is a bad choice for true colour image files though... the RLE compression doesn't help as much as with 8 bit images. You also need to be careful about selecting what palette entries you use the most for a PCX file, otherwise you'll end up with a much larger file (I oncereduced a PCX file more than 50% in size by reshuffling the palette).

There is also a trick (that is seldom if ever used) that makes it possible to have more than 256 colours in one GIF image. I lost the link though.

Martano
Member #6,536
October 2005
avatar

So.... I tried to download the Apeg. But I found only the code, so needs to compile.... but as always.... ERRORS:
____________________________________________________

C:\Hangar6\apeg\main.cpp In function `void setenv(const char*, const char*, int)':

38 C:\Hangar6\apeg\main.cpp `_putenv' undeclared (first use this function)

C:\Hangar6\apeg\main.cpp In function `int check_obj_deps(char*, time_t)':

143 C:\Hangar6\apeg\main.cpp invalid conversion from `void*' to `char*'

__________________________________________________

Missing Library?
Is there a place where I can download the compiled version?

Kitty Cat
Member #2,815
October 2002
avatar

It looks like you're trying to compile cbuild.c as a C++ file, which won't work. Just use the makefile, it'll compile cbuild for you then you can run cbuild to build the library. You'll also need libogg, libvorbis, and libtheora to use Ogg media.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Martano
Member #6,536
October 2005
avatar

How to use the makefile?

Kitty Cat
Member #2,815
October 2002
avatar

Run 'make' or 'mingw32-make'.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Martano
Member #6,536
October 2005
avatar

I copied "make.exe" to the same folder where the "makefile" is. I ran the "make.exe" but it complains: "Couldn't find the file."

I tried with the "mingw32-make.exe", but got the same error.

Arthur Kalliokoski
Second in Command
February 2005
avatar

The name of the makefile isn't makefile.txt or something, is it? If you're using windows then the file display junk might be hiding the extensions. Right click "makefile" and select properties to see true name.

They all watch too much MSNBC... they get ideas.

Martano
Member #6,536
October 2005
avatar

There are 2 makefiles: "Makefile" and "Makefile.win".

Do I need to use any command with the "make.exe" or just run it?

Arthur Kalliokoski
Second in Command
February 2005
avatar

Oh, Microsoft stuff... I've never had MS stuff, but I remember seeing a lot of references to "nmake" which I guess is the Microsoft equivalent to make.exe

They all watch too much MSNBC... they get ideas.

Martano
Member #6,536
October 2005
avatar

...I am lost... :-[

I downloaded a program called "nmake" for Windowns 2000. But it didn't work. Is there a "nmake" for XP? ( My Windows is XP )

And.... isn't there an easier way to use apeg?

Kitty Cat
Member #2,815
October 2002
avatar

I'm lost. APEG has only one makefile, called Makefile. The make you run is the same one you used to build Allegro and the Ogg stuff. You don't need to copy it to APEG's directory because it should be in your PATH environment variable.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Michael Jensen
Member #2,870
October 2002
avatar

make will automatically load "makefile." from the directory you run it from (as in makefile with NO extension) to make anything else you need to supply a file name.

As KC already said you do NOT need it to be in the same folder; remove it now.

As for version of windows, make has nothing to do with the version of windows you have, but instead has to do with the version of the compiler it was designed for, nmake is with microsoft's visual c++, you should use the same make that you built allegro with (or whatever make APEG is compatable with...)

Quote:

PCX is a bad choice for true colour image files though... the RLE compression doesn't help as much as with 8 bit images.

That's a really good point.

Quote:

You also need to be careful about selecting what palette entries you use the most for a PCX file, otherwise you'll end up with a much larger file (I oncereduced a PCX file more than 50% in size by reshuffling the palette).

Unless you have no runs, or 90% of your colors are above like 240 (or so?) in the pallette this really isn't an issue; 99% of image conversions should be smaller than bitmaps, and I've never encountered one that wouldn't be, it really seems like you'd have to doctor it that way, or have an extreemly prominant background color as index 255.

Quote:

You'll also need libogg, libvorbis, and libtheora to use Ogg media.

One of the reasons that I complain that we don't have enough built into allegro, if your project uses APEG, now you also have to manually install libogg, libvorbis, libtheora (and any dependencies they have).... and ANYONE who wants to recompile your code not only needs allegro, but also libogg, libvorbis, libtheora (and any dependencies they have), and APEG.... and APEG is not an isolated case for this; there are many other libraries with nighmareish cascading trees of dependencies... :'(

edit: (Also consider, who knows what version of which library a specific library is dependant on? and NO it's not as simple as just downloading it and running make; first off it's finding the files to download, which I kid you not for some auxiallary libraries I gave up on... and some simply do not make(current build is broken) or are the wrong version... etc etc, I've run into MANY problems of this type before, and it's not just typing make.)

Evert
Member #794
November 2000
avatar

Quote:

Unless you have no runs, or 90% of your colors are above like 240 (or so?) in the pallette this really isn't an issue; 99% of image conversions should be smaller than bitmaps, and I've never encountered one that wouldn't be, it really seems like you'd have to doctor it that way, or have an extreemly prominant background color as index 255.

It can happen if you have an image with many colours. You won't get a 100% size increase from that though, mostly a 33%.
The image I had that I was refering to did seem that it was specifically tailored to be bad for PCX files - it had 63 colours in it, all of them above 192 (which is the magical number).

Quote:

One of the reasons that I complain that we don't have enough built into allegro

You're spoiled by Allegro having so few external dependencies. ;)
Anyway, we won't be including all sorts of thirdparty libraries into the Allegro distribution.

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

if your project uses APEG, now you also have to manually install libogg, libvorbis, libtheora (and any dependencies they have).... and ANYONE who wants to recompile your code not only needs allegro, but also libogg, libvorbis, libtheora (and any dependencies they have), and APEG...

Dependancies can be a bitch, unfortunately. Some pacakge managers can help, by installing the dependancies before the requested package automatically (which is why I'd recommend distros like Gentoo or Sourcemage). Unfortuantely Windows isn't very well off in this regard, not only by not having a package manager, but also by having a crippling shell. You can use MSYS, which I was able to use to build libogg/libtheora/libvorbis/etc, but that would be yet another dependancy..

And this is why Allegro doesn't support PNG or ZIP or any of that stuff built in, or else it'd have the same dependancy issues. Dynamicly loading shared libs would absolve the need for them to be required at compile time (and thusly become a run-time thing), but that will only work on platforms that can use shared libs and would lock your program into needing the shared libs without any easy way of staticlinking them.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham



Go to: