Welcome! Log In Create A New Profile

Advanced

How to Play Sound and Video Files

Posted by Nicholas_Roge 
Re: How to Play Sound and Video Files
June 21, 2009 04:27AM
I don't know what your rules on bumping are, but I hope three days is enough. I'd really like help on this issue.
Re: How to Play Sound and Video Files
June 23, 2009 04:36AM
GX is the "low-level" graphics library for the wii, and is included is libOGC. AFAIK, it is similar to openGL, but I have never used it before, so I am not 100% sure.
Re: How to Play Sound and Video Files
June 24, 2009 04:37AM
@Nicholas_Roge:

As jsmaster said, "GX" refers to the graphics library. The functions that start with GX_ control the 3d hardware and let you do things like display polygons. Normally this is what you want to use when you're making a game because the 3d hardware is specifically designed to do these kind of things, and is very fast.

However, that's not the only way to get things to show up on screen. The way display works on the Wii, you have a block of memory called your "framebuffer" that represents what actually gets displayed. GX works by taking in abstract constructs like polygons, figuring out how to draw them, then drawing the result to the framebuffer. You're also allowed to write directly to the framebuffer (it's just ordinary memory after all). This is slower because you don't get the benefit of hardware acceleration and more complicated because the pixels are stored in a funny format, but for certain types of applications it's a valid option. Video is one of them, mainly because it doesn't benefit at all from the 3d hardware but also because you're already working with the image on a pixel-by-pixel basis so the conversion to the funny format isn't as big a drawback.

If you just want to display a very simple video then the easiest way to show it might be to just store each frame as a texture and quickly cycle through them. It won't be compressed and you can't just load an .avi file and expect it to work, but it's the easiest option using the available tools. You would want to use GX for that.
Re: How to Play Sound and Video Files
June 24, 2009 06:25AM
Quote
ulti
@Nicholas_Roge:

As jsmaster said, "GX" refers to the graphics library. The functions that start with GX_ control the 3d hardware and let you do things like display polygons. Normally this is what you want to use when you're making a game because the 3d hardware is specifically designed to do these kind of things, and is very fast.

However, that's not the only way to get things to show up on screen. The way display works on the Wii, you have a block of memory called your "framebuffer" that represents what actually gets displayed. GX works by taking in abstract constructs like polygons, figuring out how to draw them, then drawing the result to the framebuffer. You're also allowed to write directly to the framebuffer (it's just ordinary memory after all). This is slower because you don't get the benefit of hardware acceleration and more complicated because the pixels are stored in a funny format, but for certain types of applications it's a valid option. Video is one of them, mainly because it doesn't benefit at all from the 3d hardware but also because you're already working with the image on a pixel-by-pixel basis so the conversion to the funny format isn't as big a drawback.

If you just want to display a very simple video then the easiest way to show it might be to just store each frame as a texture and quickly cycle through them. It won't be compressed and you can't just load an .avi file and expect it to work, but it's the easiest option using the available tools. You would want to use GX for that.

Of course that would mean you would need thousands of textures just for a short video. I would think the best (and easiest) solution would be to copy some of mplayer's source (if that is allowed with the licensing).
Re: How to Play Sound and Video Files
June 25, 2009 06:46PM
I meant for a *very* short video. Like, animated GIF level. Though even a thousand-frame video could be made to work that way if the resolution is small enough or you load textures from SD.

My guess is that Nicholas_Roge doesn't have the experience to be able to adapt mplayer's source and just wants a simple AVI_PlayVideo() function (which doesn't exist, so don't look for it). Given that, the mplayer option is not "easy" enough to be a viable option, though I agree that it's the best approach if you *do* have the expertise.
Re: How to Play Sound and Video Files
June 25, 2009 11:45PM
No, no. By no means do I want a simple fix. I plan on majoring in Computer Science, so as much knowledge before hand would be nice. And I'm gonna take a look at mplayer's source. That still doesn't fix my previous problem with the sound though.
Re: How to Play Sound and Video Files
June 26, 2009 02:06AM
Quote
Nicholas_Roge
No, no. By no means do I want a simple fix. I plan on majoring in Computer Science, so as much knowledge before hand would be nice. And I'm gonna take a look at mplayer's source. That still doesn't fix my previous problem with the sound though.

Why not try the SDL port. The video system uses GX and ogg works great. I've not tried mp3 with it yet.

There are thousands of tutorials around the web for SDL and I'm sure a few projects that use SDL as video players. It would be easy to port a SDL video player to Wii.

[code.google.com]
Sorry, only registered users may post in this forum.

Click here to login