Playing a movie in a non-full screen rectangle - possible?

Hi,

I would really like to play a mpeg2 movie (could be converted to
anything else if needed) as a part of an application in a rectangle that
is not full screen. But I simply cant find any info on how to do this,
and a few feeble n00b attempts to write the code simply fails with hard
crashes.

I’ve looked at the smjpeg and smpeg lib and what else I could find on
the sdl page + Google, but all I can find are full screen examples, or
examples that do not run on Windows (the main platform for my app).

So could someone please point me to some example code that shows me how
to create a rectangle on a screen and play a movie? I’ll promise to send
tons of virtual beer :wink:

Thanks a lot!!!

/Thomas

Thomas Hentschel Lund wrote:

Hi,

I would really like to play a mpeg2 movie (could be converted to
anything else if needed) as a part of an application in a rectangle that
is not full screen. But I simply cant find any info on how to do this,
and a few feeble n00b attempts to write the code simply fails with hard
crashes.

I’ve looked at the smjpeg and smpeg lib and what else I could find on
the sdl page + Google, but all I can find are full screen examples, or
examples that do not run on Windows (the main platform for my app).

So could someone please point me to some example code that shows me how
to create a rectangle on a screen and play a movie? I’ll promise to send
tons of virtual beer :wink:

Thanks a lot!!!

/Thomas

You could try the avi format, parhaps on an opengl context as in:
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=35.

Good luck

Thanks - nice URL. I was hoping not to use OpenGL though, but straight
forward SDL.

As the author on nehe states, its almost impossible to google for info
on playing videos from code - much less details like how to do it
non-full screen.

Just all the codec stuff scares the sh*t out of me, so I have no clue on
where to start on this. So thx for one solution I can fall back upon.

Anyone else? Is there really no one who played around with video
playback?

/Thomas

ons, 2003-09-03 kl. 10:15 skrev J Anderson:> Thomas Hentschel Lund wrote:

Hi,

I would really like to play a mpeg2 movie (could be converted to
anything else if needed) as a part of an application in a rectangle that
is not full screen. But I simply cant find any info on how to do this,
and a few feeble n00b attempts to write the code simply fails with hard
crashes.

I’ve looked at the smjpeg and smpeg lib and what else I could find on
the sdl page + Google, but all I can find are full screen examples, or
examples that do not run on Windows (the main platform for my app).

So could someone please point me to some example code that shows me how
to create a rectangle on a screen and play a movie? I’ll promise to send
tons of virtual beer :wink:

Thanks a lot!!!

/Thomas

You could try the avi format, parhaps on an opengl context as in:
http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=35.

Good luck


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

Thomas Hentschel Lund <@Thomas_Lund>

Thanks - nice URL. I was hoping not to use OpenGL though, but straight
forward SDL.

As the author on nehe states, its almost impossible to google for info
on playing videos from code - much less details like how to do it
non-full screen.

Just all the codec stuff scares the sh*t out of me, so I have no clue on
where to start on this. So thx for one solution I can fall back upon.

Anyone else? Is there really no one who played around with video
playback?

All of Loki’s games were capable of playing video to a window.
Both the SMPEG and SMPJPEG API’s allow you to target a rectangle in an
SDL surface. If you have raw YUV data, the SDL YUV overlay interface
allows you to target an arbitrary rectangle in an SDL surface as well.

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

I would really like to play a mpeg2 movie (could be converted to
anything else if needed) as a part of an application in a rectangle that
is not full screen. But I simply cant find any info on how to do this,
and a few feeble n00b attempts to write the code simply fails with hard
crashes.

What version of smpeg are you using? It should run on Windows, in a
window.

–ryan.

i wrote something that i’m in the process of doing something with - there is a win32/opengl
demo here - http://www.radicalpixels.com/mediator/mediatordemo.zip - make sure you have a
connection to the net - it pulls in media from various sites.

it decodes windows media (avi,wmv,divx,mpeg), quicktime (mov), flash and web pages.

currently it just writes to a chunk of memory which i then pass to opengl to use as a texture
so it could probably be made to work with SDL.

//cal> Anyone else? Is there really no one who played around with video

playback?

Thx a lot for all the feedback. I’ll look at it all and see if I can get
further on. I’ve already rpeviously tested smpeg with the set rectangle
(cant remember the actual call), but my app crashed - worked fine in
full screen. I’ll give it another shot and try again.

It also seems that opengl could be a better/easier way to do this. I’ll
look at that too

Thanks all

/Thomas

Callum Prentice wrote:>i wrote something that i’m in the process of doing something with - there is a win32/opengl

demo here - http://www.radicalpixels.com/mediator/mediatordemo.zip - make sure you have a
connection to the net - it pulls in media from various sites.

it decodes windows media (avi,wmv,divx,mpeg), quicktime (mov), flash and web pages.

currently it just writes to a chunk of memory which i then pass to opengl to use as a texture
so it could probably be made to work with SDL.

//cal

Anyone else? Is there really no one who played around with video
playback?


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