The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
playing an MPEG
Torsten Mohr
Guest

Hi,

are there any examples on how to play an MPEG video on SDL?

I once wrote an example on how to play an MJPEG (based on libmjpegutils).

What lib would i use best (video and sound) to just play an MPEG
on Linux?


Thanks for any hints,
Torsten.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060122/49883e5e/attachment.html
playing an MPEG
Chris Nystrom
Guest

On 1/22/06, Torsten Mohr <tmohr at s.netic.de> wrote:
Quote:

What lib would i use best (video and sound) to just play an MPEG
on Linux?

Try SMPEG:

http://www.lokigames.com/development/smpeg.php3
http://icculus.org/smpeg/

Chris

--
E-Mail: Chris Nystrom <cnystrom at gmail.com>
Blog: http://newio.blogspot.com/
AIM: nystromchris
playing an MPEG
Andrew Lee
Guest

Hi Torsten -

Could I get a copy of that example you wrote on how to play an MJPEG movie?

I'd appreciate it.

-Andrew

Torsten Mohr wrote:

Quote:
Hi,

are there any examples on how to play an MPEG video on SDL?

I once wrote an example on how to play an MJPEG (based on libmjpegutils).

What lib would i use best (video and sound) to just play an MPEG

on Linux?

Thanks for any hints,

Torsten.

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

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

playing an MPEG
Chris Nystrom
Guest

On 1/22/06, Andrew Lee <arl at corticsoft.com> wrote:
Quote:
Hi Torsten -

Could I get a copy of that example you wrote on how to play an MJPEG movie?

I write a little wrapper around SMPEG:

/******************************************************************************
*
* movie_demo.c
*
* Copyright (c) 2005 Chris Nystrom
*
* This program is public domain.
*
* This program is distributed in the hope that it will be useful,
* but without any warranty whatsoever.
*
* Contact Author at:
*
* Chris Nystrom
* 11013 Prairie Dove Circle
* Austin, Texas 78758
*
* E-Mail: cnystrom at gmail.com
* Blog: http://conversazione.blogspot.com
* AIM: nystromchris
*
* Soli Deo Gloria
*
*/

#include <stdlib.h>
#include <stdio.h>
#include "SDL.h"
#include <smpeg/smpeg.h>
#include "sdl_lib.h"
#include "movie_lib.h"

static int done = 0;

int main(int argc, char *argv[])
{
sdl_init();
sdl_setup_video(640, 480);

movie_load("1.mpg", TRUE);
movie_scale_XY(320, 240);
movie_set_display();
movie_play();

while (!done && (movie_playing())) {
SDL_Event event;
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_KEYDOWN:
if (event.key.keysym.sym == SDLK_ESCAPE)
done = 1;
break;
case SDL_QUIT:
done = 1;
break;
default:
break;
}
}

SDL_Delay(200);
}

movie_delete();

SDL_Quit();

return 0;
}

--

If you want to check out my wrapper:

ftp://ftp.newio.org/pub/d0-libs/movie_lib.0.08_046D_102405.tar.gz

Chris

--
E-Mail: Chris Nystrom <cnystrom at gmail.com>
Blog: http://newio.blogspot.com/
AIM: nystromchris
playing an MPEG
Torsten Mohr
Guest

Hi Chris,

great, thanks for that one. I've just downloaded your wrapper.


Best regards,
Torsten.

Quote:
On 1/22/06, Andrew Lee <arl at corticsoft.com> wrote:
Quote:
Hi Torsten -

Could I get a copy of that example you wrote on how to play an MJPEG
movie?

I write a little wrapper around SMPEG:

/**************************************************************************
**** *
* movie_demo.c
*
* Copyright (c) 2005 Chris Nystrom
*
* This program is public domain.
*
* This program is distributed in the hope that it will be useful,
* but without any warranty whatsoever.
*
* Contact Author at:
*
* Chris Nystrom
* 11013 Prairie Dove Circle
* Austin, Texas 78758
*
* E-Mail: cnystrom at gmail.com
* Blog: http://conversazione.blogspot.com
* AIM: nystromchris
*
* Soli Deo Gloria
*
*/

#include <stdlib.h>
#include <stdio.h>
#include "SDL.h"
#include <smpeg/smpeg.h>
#include "sdl_lib.h"
#include "movie_lib.h"

static int done = 0;

int main(int argc, char *argv[])
{
sdl_init();
sdl_setup_video(640, 480);

movie_load("1.mpg", TRUE);
movie_scale_XY(320, 240);
movie_set_display();
movie_play();

while (!done && (movie_playing())) {
SDL_Event event;
while (SDL_PollEvent(&event)) {
switch (event.type) {
case SDL_KEYDOWN:
if (event.key.keysym.sym == SDLK_ESCAPE)
done = 1;
break;
case SDL_QUIT:
done = 1;
break;
default:
break;
}
}

SDL_Delay(200);
}

movie_delete();

SDL_Quit();

return 0;
}

--

If you want to check out my wrapper:

ftp://ftp.newio.org/pub/d0-libs/movie_lib.0.08_046D_102405.tar.gz

Chris

--
E-Mail: Chris Nystrom <cnystrom at gmail.com>
Blog: http://newio.blogspot.com/
AIM: nystromchris

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