AVI-videos

Hi !

I’ve discovered SDL just a few days ago – SORRY, if this is a stupid question:

I plan to use SDL under Linux and need to play videos in AVI format (like xanim does).
Does SDL support this feature. If yes, how do I use it?

Thank you,
Eugen

Hi !

I’ve discovered SDL just a few days ago – SORRY, if this is a stupid question:

I plan to use SDL under Linux and need to play videos in AVI format (like xanim does).
Does SDL support this feature. If yes, how do I use it?

SDL provides all the tools necessary for you to write your own AVI player.
I don’t know of any already written.

Many of the AVI codecs must be licensed from the companies that own them
(Intel, Radius, etc.)

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

I think you can Hack X anim to use SDL as renderer

Stephane Magnenat
----- Message d’origine -----De : Eugen
? : sdl at surfnetcity.com.au
Envoy? : dimanche, 23. mai 1999 21:34
Objet : [SDL] AVI-videos

Hi !

I’ve discovered SDL just a few days ago – SORRY, if this is a stupid question:

I plan to use SDL under Linux and need to play videos in AVI format (like xanim does).
Does SDL support this feature. If yes, how do I use it?

Thank you,
Eugen

Sam Lantinga wrote:

Hi !

I’ve discovered SDL just a few days ago – SORRY, if this is a stupid question:

I plan to use SDL under Linux and need to play videos in AVI format (like xanim does).
Does SDL support this feature. If yes, how do I use it?

SDL provides all the tools necessary for you to write your own AVI player.
I don’t know of any already written.

AFAIK nothing but XAnim.
You may be interested in Quicktime for Linux (don’t remember URL, but you can
find a link at www.freshmeat.net) - it provides simple API for
compressing/decompressing Quicktime movies (JPEG, YUV and RAW codes if I
remember it well.

Vacalv

Sam Lantinga said:

Many of the AVI codecs must be licensed from the companies that own them
(Intel, Radius, etc.)

This is of course, … Of course, if you simply encode the AVI
in some codec that is free (are there any? which one?), then you can easily
play it back in your code, if you have a player.

-bill!

Sam Lantinga said:

Many of the AVI codecs must be licensed from the companies that own them
(Intel, Radius, etc.)

This is of course, … Of course, if you simply encode the AVI
in some codec that is free (are there any? which one?), then you can easily
play it back in your code, if you have a player.

MPEG is as close to a free codec as there is, that I know of.
If there is a free codec with good compression and quality, let me know! :slight_smile:

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

MPEG is as close to a free codec as there is, that I know of.
If there is a free codec with good compression and quality, let me know!
:slight_smile:

MP3 is patented, I looked into it a little bit for use in our games. The
basic deal is that the royalty is free for freeware decoders, but is a $1
for shareware or commercial stuff. They say they haven’t asserted there
patent for anything less then 10,000 copies. I was wondering if you’ve
looked into this or know how the patent would apply to games. Here’s a link
to the companies patent info:
http://www.iis.fhg.de/amm/legal/index.html

Dan

Actually, I believe he was referring to MPEG-1 audio/visual codec, not
MPEG1 Level 3 (Commonly called MP3). AFIAK, all MPEG codecs are
patented, but some are more liberally licensed than others.On 24 May, Dan wrote:

MPEG is as close to a free codec as there is, that I know of.
If there is a free codec with good compression and quality, let me know!
:slight_smile:

MP3 is patented, I looked into it a little bit for use in our games. The
basic deal is that the royalty is free for freeware decoders, but is a $1
for shareware or commercial stuff. They say they haven’t asserted there
patent for anything less then 10,000 copies. I was wondering if you’ve
looked into this or know how the patent would apply to games. Here’s a link
to the companies patent info:
http://www.iis.fhg.de/amm/legal/index.html


| |/ | | | _ | | | mailto:@Knight_Walker |
| / | / / | | http://www.aros.net/~kwalker |
| \ | ___ | | |
| |\ | | / \ | | The Kobran Imperium (801)265-1299 |
|| || || || _____________________________________/

Hi…Im new to SDL.

I am working on a music studio project of my own currently on Win32, but
for Linux, BeOS, Mac, Mac OSX, Irix/SGI, Alpha NT, Unix, Solaris and Amiga,
and possibly any other OS. I am interested in a few components across all
platforms. MIDI, Audio, Video, Timing, Threading, and GUI related
components. Can SDL provide these capabilities across platforms? To what
degree is it working on each of the above platforms? One of the most
disturbing win32 problems is multi-threaded task switching and an accurate
timer. Under win32, it seems the best you can do is about 55ms or so, (on
average) without doing the 16-bit thunk stuff (if you dont know what this
is…dont worry about it…its a stupid way to achieve 1ms timing under win32
(only win95/98…not NT). None the less, I would like to know if SDL can
achieve 1ms timing resolution, and can it be handled in its own thread on
the various platforms. While I plan to support single cpu systems, I also
want to take advantage of the “big-budget” studios that can afford multiple
cpu systems, and thus allow my music project to handle alot more processing
power for real-time dsp and video/Midi FX capabilities.

Thank you…look forward to your reply.

Kevin Duffey
@Kevin_Duffey

“You wont get muscles watching me lift weights”

I am working on a music studio project of my own currently on Win32, but
for Linux, BeOS, Mac, Mac OSX, Irix/SGI, Alpha NT, Unix, Solaris and Amiga,
and possibly any other OS. I am interested in a few components across all
platforms. MIDI, Audio, Video, Timing, Threading, and GUI related
components. Can SDL provide these capabilities across platforms? To what
degree is it working on each of the above platforms?

SDL supports Audio, Video, Timing and Threading on Linux, Win32, and BeOS.
SDL doesn’t handle MIDI and GUI components, though if you wanted to implement
a MIDI API, I would be happy to include it in SDL.

The timer has a resolution of 10 ms on all platforms.
On Linux, this is a limitation of the kernel scheduler.
On Win32 and BeOS, this is to keep timer overhead fairly low.
I haven’t extensively tested the timers for multi-media applications,
you might want to check out the accuracy for your purposes.

Audio, Video, and Threading are rock solid on all platforms.
(The current CVS release has problems with Win32 which I will fix soon)

To sum up, I’m not sure if SDL has all the components that you want,
but it should be a good starting place if you want your application
to be cross-platform.

If you find any problems in the library, I’ll be happy to take patches
and help you fix them, as I have time.
The SDL mailing list is a good resource for help as well. :slight_smile:

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

I am working on a music studio project of my own currently on Win32, but
for Linux, BeOS, Mac, Mac OSX, Irix/SGI, Alpha NT, Unix, Solaris and Amiga,

I just wanted to say that the Amiga is a very impressive system, and I’m
glad to see people supporting it still. :slight_smile: (I don’t have an Amiga, yet,
but I have a couple of Atari 8-bits, which were pretty much the same thing
but 5 years earlier :slight_smile: )

-bill!

I am working on a music studio project of my own currently on Win32, but
for Linux, BeOS, Mac, Mac OSX, Irix/SGI, Alpha NT, Unix, Solaris and Amiga,

I just wanted to say that the Amiga is a very impressive system, and I’m
glad to see people supporting it still. :slight_smile: (I don’t have an Amiga, yet,
but I have a couple of Atari 8-bits, which were pretty much the same thing
but 5 years earlier :slight_smile: )

Anyone want to port SDL to the Amiga? :slight_smile:

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Well, the only way I know of that you’ll get close to 1ms timing under Linux,
is by setting the program suid root, and giving yourself IO permission (see the
man page for ioperm) to 0x80.

Then, to achieve a 1ms delay, just do an inb(0x80). (Note that the Linux
kernel uses port 0x80 specifically for the purpose of delaying)

The other option is pentium rdtsc, but that’s less portable than the other one.

Both of those options are x86 specific, but should be available (in one form
or another) under any x86 OS.

In general, high-res timing isn’t available under multi-tasking OSs, especially
multi-user ones. (Well, quite a few have “real-time” APIs, but not enough that
you should design your program around their existance)On Mon, May 24, 1999 at 07:38:52PM -0700, Kevin Duffey wrote:


– Michael Samuel

In general, high-res timing isn’t available under multi-tasking OSs,
especially
multi-user ones. (Well, quite a few have “real-time” APIs, but not enough
that
you should design your program around their existance)

Hmm…from my understanding, BeOS is a very real-time multimedia OS. More so
than any other OS. I would think Irix would be up there too…especially due
to its use in the most sophisticated animated sequences movies have ever
seen! :slight_smile:

I thought Linux was much more solid in the area of
multi-tasking/multi-threading than win32 is.

Kevin Duffey
@Kevin_Duffey

“You wont get muscles watching me lift weights”

Then, to achieve a 1ms delay, just do an inb(0x80). (Note that the Linux
kernel uses port 0x80 specifically for the purpose of delaying)

Yes, but aren’t all operations suspended? How about usleep(1000)?

njhOn Wed, 26 May 1999 michael at surfnetcity.com.au wrote:

Hmm…from my understanding, BeOS is a very real-time multimedia OS. More so
than any other OS. I would think Irix would be up there too…especially due
to its use in the most sophisticated animated sequences movies have ever
seen! :slight_smile:

BeOS and Irix basically are “multimedia OSs”.

My point was that 1ms timing will not be very portable, and you can’t get that
kind of timing, without running the program as a real-time task (which not all
OSs will allow you to do, and most won’t let you do it without root privs).

I thought Linux was much more solid in the area of
multi-tasking/multi-threading than win32 is.

Well, I agree there (Linux is definately better than Win9x, and seems a helluva
lot better than NT), but a user process under Linux is still subject to context
switches, and other tasks can get CPU time too. 1ms timing just isn’t
practical. (10ms is, possibly 2-5ms with soft-realtime)On Tue, May 25, 1999 at 08:17:27PM -0700, Kevin Duffey wrote:


– Michael Samuel

Yes, they are.

The best you’ll get out of usleep is 10ms.

Under Linux, you can also use sched_setscheduler() to set soft-realtime, and
then use nanosleep, which will use a busy loop, and should be able to get 1ms
timing out of it.

The fact is, that if you want high-res timing, it isn’t going to be friendly
with the other processes running on your system.On Wed, May 26, 1999 at 05:24:49PM +1000, Nathan J Hurst wrote:

On Wed, 26 May 1999 michael at surfnetcity.com.au wrote:

Then, to achieve a 1ms delay, just do an inb(0x80). (Note that the Linux
kernel uses port 0x80 specifically for the purpose of delaying)

Yes, but aren’t all operations suspended? How about usleep(1000)?


– Michael Samuel

Hmm…from my understanding, BeOS is a very real-time multimedia OS. More so
than any other OS. I would think Irix would be up there too…especially due
to its use in the most sophisticated animated sequences movies have ever
seen! :slight_smile:

These two facts are not really related. Possibly the most impressive
computer graphics every rendered was on a farm of alpha running linux.
raytracing does not require millisecond timing!

BeOS and Irix basically are “multimedia OSs”.

That’s what they are advertised as, yes. But what does this mean?

Well, I agree there (Linux is definately better than Win9x, and seems a helluva
lot better than NT), but a user process under Linux is still subject to context
switches, and other tasks can get CPU time too. 1ms timing just isn’t
practical. (10ms is, possibly 2-5ms with soft-realtime)

I stick 100s of us delays in my serial code all the time using usleep(3).
It is fine if your machine is fast enough.

njhOn Fri, 28 May 1999 michael at surfnetcity.com.au wrote:

On Tue, May 25, 1999 at 08:17:27PM -0700, Kevin Duffey wrote:

The best you’ll get out of usleep is 10ms.

not on my machine(which is admittedly a ppc, which may have different
timing characteristics). If usleep isn’t scheduling fast enough, fix the
scheduler, don’t stuff around with silly user land solutions.

The fact is, that if you want high-res timing, it isn’t going to be friendly
with the other processes running on your system.

Hmm, is does depend on what one wants with the timing - maybe we would be
better with a usec accurate counter?

njhOn Fri, 28 May 1999 michael at surfnetcity.com.au wrote: