Playing movie in texture

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
funcdoobiest
Posts: 48
Joined: Thu Jun 15, 2006 6:35 pm

Post by funcdoobiest »

Sorry! knew it would be something obvious that I had overlooked - can't have a 32-bit back buffer with the stencil buffer enabled - I blatantly ignored the second half of this line in initDriver()

if (bits == 32 && !StencilBuffer)

Right, well thanks for your patience - I'm off to find a corner to stand in and feel stupid!
aerial
Posts: 14
Joined: Mon Sep 26, 2005 11:21 am

Post by aerial »

to funcdoobiest

I've got the same problem, Movie colors blend in fullscreen mode. But I have noticed that if I use avi file, every thing works right. But using other formats brings the problem.
It seems that you have managed the problem, Could you guide me to fix it?[/quote]
dwilson32
Posts: 4
Joined: Tue Sep 05, 2006 1:47 am

Post by dwilson32 »

Hi. I got your code to work....well sort of. The sound loads but then I get a generic windows error right after the sound starts. Any clue about that?
Derik
dwilson32
Posts: 4
Joined: Tue Sep 05, 2006 1:47 am

Post by dwilson32 »

I don't think I used my ITexture object correctly. I need to study that class and learn how to use it. That would have definitely caused a crash.
Derik
goutbouyo
Posts: 47
Joined: Thu Mar 24, 2005 6:55 pm

Post by goutbouyo »

We need the directx SDK for this code, isn't it ???
Emil_halim
Posts: 518
Joined: Tue Mar 29, 2005 9:02 pm
Location: Alex,Egypt
Contact:

Post by Emil_halim »

the code in the Wiki was very old , and i do not develop it instead , i include the feature of playing movie in my magic library ,so you do not have to recompile the code each time and there is no need for DX sdk.

i have managed to play movie with sound with my latest Magic Library for openGL but it limits the FPS to 25 this may make some jerky animations.
funcdoobiest
Posts: 48
Joined: Thu Jun 15, 2006 6:35 pm

Post by funcdoobiest »

aerial,

I'm afraid i have only tried WMVs not any of the other formats and my problem simply turned out to be me trying to use 32-bit colour format AND the stencil buffer (I was using shadows), having the stencil buffer enabled defaults the colour format to 16-bit. Basically my problem was a mismatch between the the colour format of the texture I rendered the movie on to and the surface I was playing the movie on to first. But I am not sure this will be your problem if your AVI's are working?
dwilson32
Posts: 4
Joined: Tue Sep 05, 2006 1:47 am

Post by dwilson32 »

Emil_halim wrote:the code in the Wiki was very old , and i do not develop it instead , i include the feature of playing movie in my magic library ,so you do not have to recompile the code each time and there is no need for DX sdk.

i have managed to play movie with sound with my latest Magic Library for openGL but it limits the FPS to 25 this may make some jerky animations.
I tried your Magic library. I tried one of your movie examples and I get the generic windows error again. I walk it through the debugger and it appears to function correctly but it will not run in the debugger (only when I am walking it through). Not sure what's wrong with it.
Derik
Emil_halim
Posts: 518
Joined: Tue Mar 29, 2005 9:02 pm
Location: Alex,Egypt
Contact:

Post by Emil_halim »

did you mean you correctlly compile and link the movie program then when you run it you got generic windows error again, am i write?

if so i think the problem existes in your system may be your direct show.
dwilson32
Posts: 4
Joined: Tue Sep 05, 2006 1:47 am

Post by dwilson32 »

Correct, it did compile and link correctly to the magic lib. Yeah it could be a problem with DirectShow I suppose. I am all up to date (Directx and vid drivers) and I have a newer ATI Radeon (x800 series) card so I am not sure what I would do to correct the situation.
Derik
aerial
Posts: 14
Joined: Mon Sep 26, 2005 11:21 am

Post by aerial »

Guys, the maximum fps I reach on a GeForce4 MX 4000, is 70 with a movie playing. How do you manage to get fps higher than 200?
funcdoobiest wrote:aerial,

I'm afraid i have only tried WMVs not any of the other formats and my problem simply turned out to be me trying to use 32-bit colour format AND the stencil buffer (I was using shadows), having the stencil buffer enabled defaults the colour format to 16-bit. Basically my problem was a mismatch between the the colour format of the texture I rendered the movie on to and the surface I was playing the movie on to first. But I am not sure this will be your problem if your AVI's are working?
Thanks, I disabled stencilbuffer and it worked right, mine was the same problem as yours. Now what should I do if I want to use shadows?
funcdoobiest
Posts: 48
Joined: Thu Jun 15, 2006 6:35 pm

Post by funcdoobiest »

^haha yup. that was the same question I was asking myself.

I was trying to reset the device when playing a movie, without the stencil buffer enabled, then resetting the device with the stencil buffer enabled when returning to the game. So far it just crashes but I think that is just my bad programming. Also I only want to play fullscreen 'cutscene' movies - if you want to play movies on surfaces in the game whilst in fullscreen with shadows you are going to have problems
joris
Posts: 1
Joined: Tue Jan 02, 2007 7:03 pm

Post by joris »

Hi,

i'm using IrrLicht & MagicLibrary for a project at school. Now, it works fine playing a video on a node, which I added to the Quake 3 Map Tutorial but when I move to far away from the node which plays the movie, I only see a black node. When I move close enough to it, the video gets visible.

Maybe it's allready been asked somewhere else in this thread, or on the forum but I don't find it

Greets,

Joris
juliusctw
Posts: 392
Joined: Fri Apr 21, 2006 6:56 am
Contact:

advice needed

Post by juliusctw »

Hello Emil

I finally got to writing my own linux movie player using FFMPEG and I ran into some performance problems.

after I decode the data using FFMPEG into raw and lock it, I next use
addTexture to get the ITexture to put into draw2DImage

i can get it to play fine, but it only runs 10 frames per/sec, and its suppose to run 24 frames a sec ,

i found out that addTexture is really expensive to get ITexture, I need a faster way, maybe even at the gl level....

I read your TMovie, what I wrote is basically that except i was trying to display the video using draw2Dimage, which i believe is a big mistake
I notice you use this irrVideo class in, what in the world is that?????

Basically, I can get the movie into raw data, what should I do next ??????
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You add a new texture each frame, or what? Basically you should disable mipmapping for one texture, lock that one, put new frame into it, unlock, render. That works as for my libavi scene node.
Post Reply