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

Quote:

I said:
Get a sh-compatible shell (such as the one that comes with MSys). Then you can run the configure script and then make.

Where can I get a sh-compatible shell?

gnolam
Member #2,030
March 2002
avatar

Kitty Cat said:

such as the one that comes with MSys

--
Move to the Democratic People's Republic of Vivendi Universal (formerly known as Sweden) - officially democracy- and privacy-free since 2008-06-18!

Martano
Member #6,536
October 2005
avatar

???

But....what is MSys?
Windows?
Why isn't it working?

Zaphos
Member #1,468
August 2001

MSYS is a part of MinGW: http://www.mingw.org/msys.shtml
You can't use the windows shell to run scripts written for unix shells (including configure scripts), so you need to use MSYS or something equivalent.

Martano
Member #6,536
October 2005
avatar

Ok, thanks, I downloaded MSys.
Read the "readme".
But HOW DO I USE THAT?

:o

Zaphos
Member #1,468
August 2001

Use what? MSYS? It's a shell. You run it. It gives you a prompt. You type "cd c:", then us cd to navigate to the library directory. Then you type "./configure".

Martano
Member #6,536
October 2005
avatar

OHHHHHHHHHHHH!

Thanks! I was typing "c:" only. ;D

It is too late here, need to sleep.
I will post tomorrow.
Opsss! (Today is tomorrow)
I will post later.

------------------------------------------

EDIT:

Ok, compiled ogg using the "./configure" and "make" commands.
Then tried to compile theora and vorbis the same way, but got an error that says I need to install ogg.
I tried to run "install" in the ogg folder, but got an error about "few arguments". So typed "install --help". It says:
_____________________________________________________
Usage: install [OPTION]... SOURCE DEST (1st format)
or: install [OPTION]... SOURCE... DIRECTORY (2nd format)
or: install -d [OPTION]... DIRECTORY... (3rd format)
In the first two formats, copy SOURCE to DEST or multiple SOURCE(s) to
the existing DIRECTORY, while setting permission modes and owner/group.
In the third format, create all components of the given DIRECTORY(ies).

--backup[=CONTROL] make a backup of each existing destination file
-b like --backup but does not accept an argument
-c (ignored)
-d, --directory treat all arguments as directory names; create all
components of the specified directories
-D create all leading components of DEST except the last,
then copy SOURCE to DEST; useful in the 1st format
-g, --group=GROUP set group ownership, instead of process' current group
-m, --mode=MODE set permission mode (as in chmod), instead of rwxr-xr-x
-o, --owner=OWNER set ownership (super-user only)
-p, --preserve-timestamps apply access/modification times of SOURCE files
to corresponding destination files
-s, --strip strip symbol tables, only for 1st and 2nd formats
-S, --suffix=SUFFIX override the usual backup suffix
-v, --verbose print the name of each directory as it is created
--help display this help and exit
--version output version information and exit

The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.
The version control method may be selected via the --backup option or through
the VERSION_CONTROL environment variable. Here are the values:

none, off never make backups (even if --backup is given)
numbered, t make numbered backups
existing, nil numbered if numbered backups exist, simple otherwise
simple, never always make simple backups

Report bugs to <bug-fileutils@gnu.org>.
______________________________________________

I tried the 3 formats, but only 3rd format worked. But it only created an empty folder.

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

I tried to run "install" in the ogg folder, but got an error about "few arguments".

Run "make install" (without quotes) in the Ogg folder (as well as the Vorbis and Theora folders after running configure and make in them).

--
"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 used:

./configure
make
install

inside the "ogg" folder.
But when I run "./configure" inside the "theora" folder, I get this error at the end:
___________________________________

checking for Ogg... no
*** Could not run Ogg test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means Ogg was incorrectly installed
*** or that you have moved Ogg since it was installed.
configure: error:
libogg is required to build this package!
please see http://www.xiph.org/ for how to
obtain a copy.
__________________________________

My folders:

C:\Hangar6\apeg (Apeg folder)
C:\Hangar6\o (ogg folder, where I ran the configure, make and make install)
C:\Hangar6\t (theora folder, where I tried to run the configure)
C:\Hangar6\v (vorbis folder, where I tried to run the configure)

Do I need to change anything about the folders?

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

./configure
make
install

Run 'make install", not 'install".

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

Opsss.
Mistyped.
I ran "make install"

-------------

It looks like that theora wants the "ogg.h".
But where should I place it?

Kitty Cat
Member #2,815
October 2002
avatar

In the Ogg folder, run "make uninstall". Then run "./configure --prefix=/mingw" and then "make install" again.

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

Thanks!

(I had to use "./configure --prefix=/mingw" in theora folder too.)

Then tried the same at vorbis, and worked.
After tried "make", but got this error:
_____________________________

collect2: ld returned 1 exit status
make[3]: *** [libvorbisfile.la] Error 1
make[3]: Leaving directory `/c/hangar6/v/lib'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/c/hangar6/v/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/c/hangar6/v'
make: *** [all] Error 2
_____________________________

Tried "make install after that, but got the same error.

Then I checked the "C:\1.0\mingw\" folder to see the installed files.

There are include and lib files for ogg and theora, but no vorbis and only one dll (libogg-0.dll).

Kitty Cat
Member #2,815
October 2002
avatar

I think libtheora is currently broken. You should be able to disable libvorbisfile and/or build static-only libs instead. Check ./configure --help for the switches.

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

Victor Williams Stafusa da Silva
Member #4,212
January 2004
avatar

I'm gotting the same problem with allog, but i'm using only libogg and libvorbis. Trying to compile that for 12 or 13 now, and it just don't work. Libvorbis doesn't focken compiles even by the hell!

And ./configure --help doesn't give any useful flagss.

EDIT (some hours later): I was very stressed and angry with that, let's try again...

[The attack of the space bugs - Speedhack 2005] [Rambananas - Speedhack 2006] [Make clean - Speedhack 2009] [The source god - TINS 2010]

Martano
Member #6,536
October 2005
avatar

Which switch should I use? "--disable-vorbistest"?

Kitty Cat
Member #2,815
October 2002
avatar

I think it was --enable-static and/or --disable-dynamic, or something along those lines. You can also send an email to libvorbis's maintainers and inform them of the problem.

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

Victor Williams Stafusa da Silva
Member #4,212
January 2004
avatar

Ohhh. FINALLY!!!!

I COMPILED THAT LIBVORBIS!

After trying to understand the structure of that horrible messy, confusing, large and incompreensible makefiles, i could fix it with that script:


cd ./lib
/bin/sh ../libtool --tag=CC --mode=link gcc  -O20 -D__NO_MATH_INLINES -fsigned-char  -DUSE_MEMORY_H   -o libvorbisfile.la -no-undefined -version-info 4:0:1 vorbisfile.lo libvorbis.la 
sys_lib_search_path_spec=" =c:/Dev-Cpp/lib/gcc/mingw32/3.4.2/ c:/Dev-Cpp/lib/gcc/mingw32/ c:/Dev-Cpp/lib/gcc/ c:/Dev-Cpp/mingw32/lib/ c:/Dev-Cpp/lib/"
rm -fr  .libs/libvorbisfile.dll.a
gcc -shared  .libs/vorbisfile.o  -logg -logg.dll  ./.libs/libvorbis.dll.a  -o .libs/libvorbisfile-3.dll -Wl,--image-base=0x10000000 -Wl,--out-implib,.libs/libvorbisfile.dll.a

Save this in some file called, say "fixthatsh1t".

So, first of all: Install Ogg, which is "./configure --prefix=/mingw", then "make" and "make install".

Second, install Vorbis: "./configure --prefix=/mingw", "make", you'll get some errors about make, so run "./fixthatsh1t", run "make" again and then "make install".

Third, install Theora: I will try this later, but if we are luck it will be the same to install Ogg.

Forth (finally): Install Apeg.

But, i still need know something. When i compile my game (in Alogg), i get that:


Info: resolving _allegro_errno by linking to __imp__allegro_errno (auto-import)
fu000001.o:: undefined reference to `lib_mingw32_liballeg_a_iname'
nmth000000.o:: undefined reference to `_nm__allegro_errno'
collect2: ld returned 1 exit status

make.exe: *** [Asmodan.exe] Error 1

We are almost there!

[The attack of the space bugs - Speedhack 2005] [Rambananas - Speedhack 2006] [Make clean - Speedhack 2009] [The source god - TINS 2010]

Martano
Member #6,536
October 2005
avatar

Weeeeeeeeeeeeeeeeeeeeeeeeeeeew! :D

It worked!

GREAT THANKS TO EVERYONE!!!!

I needed to reconfigure ogg to "mingw32" (it was set to "mingw").
And needed to copy the "ogg\ogg.h", "theora\theora.h" and "vorbis\codec.h" to "apeg\include\" folder manually, and needed to copy "libapeg.a" to "Dev-Cpp\lib" manually too.
And needed to use this sequence in the linkers:

-lapeg
-ltheora
-lvorbis
-lvorbisenc
-logg
-lalleg

But got no "linker error"!

Now I just need to learn Apeg's commands. ;D

-----------------------------------

EDIT:

I need to play an .ogg music.
Found this command in apeg.txt:

SAMPLE *apeg_preload_audio(const char *filename);

I tried:

SAMPLE *apeg_preload_audio("15.ogg");

But it complained about "bad conversion - const chat to SAMPLE*".

So tried:

SAMPLE *musica = load_sample("15.ogg");
SAMPLE *apeg_preload_audio(musica);
play_sample(apeg_preload_audio, 255, 128, 1000, 0);

It compiles, but closes the program when I click to load it.

PS.: Does anyone know a good AVI->MPG converter? ;D

Evert
Member #794
November 2000
avatar

Sure, it'll compile, but it should die horribly when run.

Quote:

SAMPLE *spl = apeg_preload_audio("somefilename.someextension");
play_sample(spl, 255, 128, 1000, 0);

Don't take this the wrong way, but do you even know C?

Martano
Member #6,536
October 2005
avatar

Quote:

Don't take this the wrong way, but do you even know C?

In real all I know about C, I learnt reading one or two tutorials over the internet. :P

--

I tested:

SAMPLE *spl = apeg_preload_audio("example.ogg");
play_sample(spl, 255, 128, 1000, 0);

But happened the same as before. Is it possible to be using an incompatible ogg format?

Kitty Cat
Member #2,815
October 2002
avatar

Its possible apeg_preload_audio is buggy. Everytime I think I fix it, I find something else wrong. It might also be that the file isn't loading, so check if it's NULL before calling play_sample.

If it crashes before it ever gets to play_sample, try using apeg_play_mpg instead (yes, the name is a misnomer; it's a hold-over from before Ogg support was added :P). If that plays, doesn't crash, and doesn't return an error, then it's a problem in apeg_preload_audio.

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

apeg_play_mpg worked.

But it shows a black screen. I need to show another images, and make the music to fade out after sometime.

Kitty Cat
Member #2,815
October 2002
avatar

apeg_play_mpg was just a test to make sure it wasn't a problem with the file. I think I found the problem, so I'll upload a new version of APEG (1.1.2). Delete your current APEG directory and extract the new archive.

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

NEW? :o

Don't tell me that I will need to recompile that thing! :o

hehe

Downloading.... ;D

-------------------------------

EDIT:

Recompiled APEG, and updated the "libapeg.a".
Then tried again the:

SAMPLE *spl = apeg_preload_audio("15.ogg");

//++++++++++     
     if(spl == NULL)
{
   set_gfx_mode(GFX_TEXT,0,0,0,0);
   allegro_message("Could not load 15.ogg!");
   exit(EXIT_FAILURE);
}
//++++++++++ 

play_sample(spl, 255, 128, 1000, 0);

This time it closes the program without the error message. So I think the problem is in the last command.



Go to: