Mpeg2/4

Hi

Does anyone have any suggestions to allow me to add Mpeg2 or 4/DivX :slight_smile:
playback inside an SDL application, to an SDL surface. I need to be able to
scale to fullscreen (800x600x32bpp hardware assisted) if possible.

I have found quite a few libraries that might help such as LibMpeg3,
LibMpeg2, Avifile etc. but was after some advice as to which one to use. My
main concern is development time as I don’t have much time for this project
and don’t really have time to mess around with the Mpeg side of things too
much…

SMPEG may be a better choice but I have read the Mpeg1 is limited to (IIRC)
352x288 and scaling to 800x600 might be a bit blocky, the docs suggest there
may also be an issue with the audio timing for longer mpegs. My mpegs would
be no linger than 30 seconds so I am not sure if the audio lag will be a
problem.

Any help would be appreciated.

Thanks

Paul

Hiya,

P> Does anyone have any suggestions to allow me to add Mpeg2 or 4/DivX :slight_smile:
P> playback inside an SDL application, to an SDL surface. I need to be able to
P> scale to fullscreen (800x600x32bpp hardware assisted) if possible.

http://libmpeg2.sourceforge.net/

Take a look at the Mplayer project. That also (IIRC) handles DivX
streams and uses SDL, so you should be interested in the source.

P> I have found quite a few libraries that might help such as LibMpeg3,
P> LibMpeg2, Avifile etc. but was after some advice as to which one to use. My
P> main concern is development time as I don’t have much time for this project
P> and don’t really have time to mess around with the Mpeg side of things too
P> much…

LibMPEG2 looks good to me, though I haven’t written anything yet - I’m
only just starting…

P> SMPEG may be a better choice but I have read the Mpeg1 is limited to (IIRC)
P> 352x288 and scaling to 800x600 might be a bit blocky, the docs suggest there
P> may also be an issue with the audio timing for longer mpegs. My mpegs would
P> be no linger than 30 seconds so I am not sure if the audio lag will be a
P> problem.

MPEG1 isn’t limited to that, that sounds more like VideoCD (which uses MPEG1). Maybe
SMPEG limits it to that, I don’t know. Strange though. Anyway, you’d
have problems upsampling from that resolution to 800x600 - especially
doing it quickly. Best bet would be to double each pixel, maybe
filtering a little to smoothen the image.

Neil.

MPEG1 isn’t limited to that, that sounds more like VideoCD (which uses MPEG1). Maybe
SMPEG limits it to that, I don’t know. Strange though. Anyway, you’d
have problems upsampling from that resolution to 800x600 - especially
doing it quickly. Best bet would be to double each pixel, maybe
filtering a little to smoothen the image.

FYI, the “plaympeg” sample program that comes with SMPEG supports
various forms of scaling and filtering. Check out the command line
options and the source code.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

I found the plaympeg programme and have had very good results with a few
files I got off the net. Great work guys. I have a 216 second 720x480 mpeg
(19.5MB) that I downloaded and it plays that quite well and the voice/sound
doesn’t lose sync at all, so that’s great. It does seem to skip frames
(picture jerks very slightly every 1/4 to 1/2 a second) that may be in the
file though, I’ve got to try some more mpegs yet :slight_smile:

I have smpeg-0.4.4-1 and smpeg-devel-0.4.4-1 but can’t seem to locate the
source code for the plaympeg application. Any hints as to the location :slight_smile:

The mpeg encoder we have only encodes at 358x288 (IIRC) so it seems that the
size is only limited in that encoder. I have read the mpeg1 files must be a
multiple of 16 bytes in each direction but I haven’t read any size
limitations yet, better keep looking for another encoder I think ;)On Sat, 6 Oct 2001 14:58, you wrote:

MPEG1 isn’t limited to that, that sounds more like VideoCD (which uses
MPEG1). Maybe SMPEG limits it to that, I don’t know. Strange though.
Anyway, you’d have problems upsampling from that resolution to 800x600 -
especially doing it quickly. Best bet would be to double each pixel,
maybe
filtering a little to smoothen the image.

FYI, the “plaympeg” sample program that comes with SMPEG supports
various forms of scaling and filtering. Check out the command line
options and the source code.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I found the plaympeg programme and have had very good results with a few
files I got off the net. Great work guys.

Thanks. :slight_smile:

I have smpeg-0.4.4-1 and smpeg-devel-0.4.4-1 but can’t seem to locate the
source code for the plaympeg application. Any hints as to the location :slight_smile:

Yep, grab the source tarball from Loki’s FTP site.

The mpeg encoder we have only encodes at 358x288 (IIRC) so it seems that the
size is only limited in that encoder. I have read the mpeg1 files must be a
multiple of 16 bytes in each direction but I haven’t read any size
limitations yet, better keep looking for another encoder I think :wink:

MPEG-1 video must be encoded in blocks of 16x16 pixels.
Be warned that large MPEG videos play poorly on low end systems.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

You can try our open source mpeg4 system. http://www.mpeg4ip.net
It will stream, or play back local files.

We use smpeg’s mp3 decoder, and have plans to use the mpeg1 video
decoder at some point.

Bill May

Paul wrote:> Hi

Does anyone have any suggestions to allow me to add Mpeg2 or 4/DivX :slight_smile:
playback inside an SDL application, to an SDL surface. I need to be able to
scale to fullscreen (800x600x32bpp hardware assisted) if possible.

I have found quite a few libraries that might help such as LibMpeg3,
LibMpeg2, Avifile etc. but was after some advice as to which one to use. My
main concern is development time as I don’t have much time for this project
and don’t really have time to mess around with the Mpeg side of things too
much…

SMPEG may be a better choice but I have read the Mpeg1 is limited to (IIRC)
352x288 and scaling to 800x600 might be a bit blocky, the docs suggest there
may also be an issue with the audio timing for longer mpegs. My mpegs would
be no linger than 30 seconds so I am not sure if the audio lag will be a
problem.

Any help would be appreciated.

Thanks

Paul