Smpeg

I am trying to use smpeg for decoding mpeg video and audio.

I built the plaympeg program. If I specify --audio, it plays OK.

However, for the video, it does not show it: it always gives a pointer error
accesing to some not-owned memory. I can play the videos with Windows Media
Player and other programs (such as gplay) without any problem.

The output in a Windows MsgBox is something like
"Instruction in “0x…” has made reference to memory in “0xd3d3d3d3”.
Memory could not be written.

If I run in Debug mode I get
"Unhandled exception in plaympeg.exe (MSVCRT.DLL). 0xC0000005: Access
violation”

when executing the SDL_Delay() in the while loop:

    SMPEG_play(mpeg);
    while ( SMPEG_status(mpeg) == SMPEG_PLAYING ) {
		SDL_Delay(1000/2);
	}

I am using the precompiled smpeg.dll from
http://pygame.seul.org/ftp/pygame-dependencies.zip__________________________________
I?aki Idigoras Igartua <@Idigoras_Inaki>

Hi,

I have problem with smpeg library, can somebody help me ?

for(…) {

mpeg = SMPEG_new(data[i],&info,1);

SMPEG_skip(60);
SMPEG_play(mpeg);

...
while(SMPEG_getinfo(mpeg,&info)&&info.time<120) SDL_Delay(200);

SMPEG_stop(mpeg);
SMPEG_delete(mpeg);

}

it’s work fine, however every time after 200 cycles crash. It’s no
problem with data, it’s get data from file, skip it and after SMPEG_play
i can debug it on next rows, but it isn’t sound more and after short
time crash. Any idea ?

Thank.

Igor

I’ve had problems with smpeg ever since updating to SDL-1.2.7. Can you run it
under gdb and send me the backtrace (email directly to me, please). I’d like
to know if your crash has the same cause as mine. Maybe we can solve it
together.

Also let me know what platform you’re running on, and what version compiler.

Thanks,
JeffOn Saturday 06 March 2004 04:11 pm, Igor wrote:

I have problem with smpeg library, can somebody help me ?

it’s work fine, however every time after 200 cycles crash. It’s no
problem with data, it’s get data from file, skip it and after SMPEG_play
i can debug it on next rows, but it isn’t sound more and after short
time crash. Any idea ?

Hello !

I’m trying to integrate a smpeg video player with my app. I use SMPEG
library v0.4.5
and SDL v1.2.5. When I set the video without SDL_DOUBLEBUFF flag i can play
the
mpeg video fine only with ‘SMPEG_play()’. If i use the SDL_DOUBLEBUFF flag
then i have to program a callback ( SMPEG_setdisplay( …, callback ); )
and
execute a ‘SDL_Flip()’ in the callback function. The problem is that i have
a lot
of frame dropped ! If i don’t call ‘SDL_Flip()’ the frame is not shown.

In the library code file video/gdith.cpp there is the 'DisplayFrame’
function and
it use the ‘SDL_DisplayYUVOverlay( )’ to dump the frame to the display. Is
there
some function like ‘SDL_FlipYUVOverlay()’ to force the flip on overlays ?

Any idea ?? Where can i find more info about overlays ??

Thanks a lot,
Jorge

jorgefm at cirsa.com wrote:

In the library code file video/gdith.cpp there is the 'DisplayFrame’
function and
it use the ‘SDL_DisplayYUVOverlay( )’ to dump the frame to the display. Is
there
some function like ‘SDL_FlipYUVOverlay()’ to force the flip on overlays ?

If you use overlays you don’t need double buffering, I’ve also seen that
the SDL_DisplayYUVOverlay() is VBlank synchronized in WIN32, while it’s
not in Linux and OSX, but also on those cases the wrost problem you can
have is tearing, and tearing is a problem also with SDL_Flip()ed
surfaces if your video card is not synchronized with the VBlank, so it’s
not a YUV related problem at all.

Bye,
Gabry

In the library code file video/gdith.cpp there is the 'DisplayFrame’
function and
it use the ‘SDL_DisplayYUVOverlay( )’ to dump the frame to the display.
Is

there
some function like ‘SDL_FlipYUVOverlay()’ to force the flip on overlays
?

If you use overlays you don’t need double buffering, I’ve also seen that
the SDL_DisplayYUVOverlay() is VBlank synchronized in WIN32, while it’s
not in Linux and OSX, but also on those cases the wrost problem you can
have is tearing, and tearing is a problem also with SDL_Flip()ed
surfaces if your video card is not synchronized with the VBlank, so it’s
not a YUV related problem at all.

That it’s means that i can’t have a double buffer application with
a mpeg video inside ? I’m trying to display a little animation from a
mpeg video when a game is over. Is it not possible if my game is using
double buffering, fullscreen and hardware surfaces ?

Thanks,
Jorge

[…]

If you use overlays you don’t need double buffering, I’ve also
seen that the SDL_DisplayYUVOverlay() is VBlank synchronized in
WIN32, while it’s not in Linux and OSX, but also on those cases
the wrost problem you can have is tearing, and tearing is a
problem also with SDL_Flip()ed surfaces if your video card is not
synchronized with the VBlank, so it’s not a YUV related problem
at all.

That it’s means that i can’t have a double buffer application with
a mpeg video inside ? I’m trying to display a little animation from
a mpeg video when a game is over. Is it not possible if my game is
using double buffering, fullscreen and hardware surfaces ?

That’s hardware and driver dependent.

On hardware with a real YUV (or other) overlay, the overlay is
effectively an extra “channel”, similar to the normal display
hardware. That is, it has it’s own VRAM pointer, and it can use page
flipping and retrace sync. (Theoretically, you could probably flip
the overlay and the “normal” display independently, but I don’t know
if any drivers support that.)

On systems without a h/w overlay, the video frames end up in the
normal frame buffer one way or another. (Hardware, software or
"hybrid" decoder.) That means it works pretty much like normal
blitting; the video frames end up in the normal frame buffer. Normal
buffering/flipping semantics applies.

Either way, there’s always the option of streaming the video into any
surface you like (including OpenGL textures) using a software (or
hardware, I guess) decoder. You get more control (and accelerated
filtered scaling, color modulation, blending etc with OpenGL), and it
should work as expected everywhere - but you may not get maximum
decoding performance.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Thursday 01 April 2004 08.58, jorgefm at cirsa.com wrote:

If you use overlays you don’t need double buffering, I’ve also
seen that the SDL_DisplayYUVOverlay() is VBlank synchronized in
WIN32, while it’s not in Linux and OSX, but also on those cases
the wrost problem you can have is tearing, and tearing is a
problem also with SDL_Flip()ed surfaces if your video card is not
synchronized with the VBlank, so it’s not a YUV related problem
at all.

That it’s means that i can’t have a double buffer application with
a mpeg video inside ? I’m trying to display a little animation from
a mpeg video when a game is over. Is it not possible if my game is
using double buffering, fullscreen and hardware surfaces ?

That’s hardware and driver dependent.

On hardware with a real YUV (or other) overlay, the overlay is
effectively an extra “channel”, similar to the normal display
hardware. That is, it has it’s own VRAM pointer, and it can use page
flipping and retrace sync. (Theoretically, you could probably flip
the overlay and the “normal” display independently, but I don’t know
if any drivers support that.)

On systems without a h/w overlay, the video frames end up in the
normal frame buffer one way or another. (Hardware, software or
"hybrid" decoder.) That means it works pretty much like normal
blitting; the video frames end up in the normal frame buffer. Normal
buffering/flipping semantics applies.

Either way, there’s always the option of streaming the video into any
surface you like (including OpenGL textures) using a software (or
hardware, I guess) decoder. You get more control (and accelerated
filtered scaling, color modulation, blending etc with OpenGL), and it
should work as expected everywhere - but you may not get maximum
decoding performance.

Thanks David for the info !!

I have tried the last option yet, rendering into a surface and it works.
It’s a bit slower than the SMPEG_play() but it’s posible. A good example
of this technique is ‘glmovie.c’ from the SMPEG library where the video
player uses openGL commands to show the video. Well I’ll study the overlays
a little more.

Thanks again.
Jorge

                  David Olofson                                                                                                      
                  <david at olofson.net>      Para:     sdl at libsdl.org                                                                  
                  Enviado por:             cc:                                                                                       
                  sdl-admin at libsdl.or      Asunto:   Re: [SDL] SMPEG and double buffer                                               
                  g                                                                                                                  
                                                                                                                                     
                                                                                                                                     
                  01/04/2004 09.50                                                                                                   
                  Por favor, responda                                                                                                
                  a sdl                                                                                                              

[…]

If you use overlays you don’t need double buffering, I’ve also
seen that the SDL_DisplayYUVOverlay() is VBlank synchronized in
WIN32, while it’s not in Linux and OSX, but also on those cases
the wrost problem you can have is tearing, and tearing is a
problem also with SDL_Flip()ed surfaces if your video card is not
synchronized with the VBlank, so it’s not a YUV related problem
at all.

That it’s means that i can’t have a double buffer application with
a mpeg video inside ? I’m trying to display a little animation from
a mpeg video when a game is over. Is it not possible if my game is
using double buffering, fullscreen and hardware surfaces ?

That’s hardware and driver dependent.

On hardware with a real YUV (or other) overlay, the overlay is
effectively an extra “channel”, similar to the normal display
hardware. That is, it has it’s own VRAM pointer, and it can use page
flipping and retrace sync. (Theoretically, you could probably flip
the overlay and the “normal” display independently, but I don’t know
if any drivers support that.)

On systems without a h/w overlay, the video frames end up in the
normal frame buffer one way or another. (Hardware, software or
"hybrid" decoder.) That means it works pretty much like normal
blitting; the video frames end up in the normal frame buffer. Normal
buffering/flipping semantics applies.

Either way, there’s always the option of streaming the video into any
surface you like (including OpenGL textures) using a software (or
hardware, I guess) decoder. You get more control (and accelerated
filtered scaling, color modulation, blending etc with OpenGL), and it
should work as expected everywhere - but you may not get maximum
decoding performance.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Thursday 01 April 2004 08.58, @Jorge_Fernandez_Mont wrote:


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