Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
18:48:56: [DSHOW] Creating texture with dimensions 2048x1024.
18:48:56: WARNING: Texture instance 'DirectShowManualTexture' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
18:48:56: Creating viewport on target 'Lumeria', rendering from camera 'System_Movie_Camera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
18:48:56: Viewport for camera 'System_Movie_Camera', actual dimensions L: 0 T: 0 W: 1280 H: 1016
18:48:56: [DSHOW] Loading movie named 'C:/Ugly.Betty.S01E14.HDTV.XviD-XOR.avi'.
18:48:57: [DSHOW] -> This movie has dimensions: 608x336.
So what should my code look like if I want to gaurd against resolution with X wdith and Y height?
Also, I copied/pasted right out of the wiki yesterday, and the versions do match up.
>> Edit: why did the page got so wide with this post??
Because of the big image above.
A phpBB MOD/fix is discussed on the phpBB boards and the fix to download. There's also EasyMOD, a MOD Installation modification. Hopefully some of these features will be included in v3 of phpBB.
mDShowMovieTexture = new OgreUtils::DirectShowMovieTexture(mWindow->getWidth(), mWindow->getHeight());
You are asking the program to create a texture that has the same dimensions of the window; when you should rather create a texture that has the same dimensions of the video (that, in your case is 608 x 336).
If you don't know the size of the video when starting, you'll need to create the dshow object telling a texture size that is bigger than any video you are going to play (for example, in your case maybe 800x600). Then you'll need to use some basic maths to make the overlay UVs map to the region of the texture that is in use in each video you choose to play (so you'll have to update the UVs in any video change; at least if the new video has a size that is different than the video that was being played before).
And thanks Rackle for your post, I thought the table width got so wider only after I posted my reply, so I was only looking for something bad in my post.
// Create Panel, Overlay, and Show the Overlay
Ogre::OverlayManager* OM = Ogre::OverlayManager::getSingletonPtr();
if( mOPanel == NULL )
{
// Create a panel
mOPanel = static_cast<Ogre::OverlayContainer*>(
OM->createOverlayElement("Panel", "MoviePanel"));
}
mOPanel->setPosition(0.0,0.0);
mOPanel->setDimensions(1.0,1.0);
mOPanel->setColour(Ogre::ColourValue(1.0,1.0,1.0,1.0));
mDShowMovieTexture->loadMovie(mMoviePath);
Ogre::Vector2 v2 = mDShowMovieTexture->getMovieDimensions();
dynamic_cast<Ogre::PanelOverlayElement*>(mOPanel)->setUV(0,0,
v2.x / mWindow->getWidth(),
v2.y / mWindow->getHeight());
mOPanel->setMaterialName(mOverlayMaterial.get()->getName());
mDShowMovieTexture->playMovie();
// Create an overlay, and add the panel
if( mOverlay == NULL )
mOverlay = OM->create("MovieOverlay");
mOverlay->add2D(mOPanel);
mOverlay->show();
This code does the trick for me. Haven't tried different window resolutions, but I have tried another movie, and it took up the screen. Really close to what genva wrote to me earlier.
Has anybody been able to successfully stop/pause a movie and then play it again? I wish to pause the movie and ask the user if they want to skip it. If they say no, the movie should resume playing of the movie. However, after calling pause or stop I cannot resume playing or even play the video again. Anybody experiencing anything similar?
04:31:21: [DSHOW] Creating texture with dimensions 1280x1016.
04:31:21: WARNING: Texture instance 'DirectShowManualTexture' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
04:31:21: Texture: _cegui_ogre_0: Loading 1 faces(PF_A8R8G8B8,256x256x1) with 0 generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
04:31:21: Creating viewport on target 'Lumeria', rendering from camera 'System_Movie_Camera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
04:31:21: Viewport for camera 'System_Movie_Camera', actual dimensions L: 0 T: 0 W: 1280 H: 1016
04:31:21: [DSHOW] Loading movie named './media/Movies/01 - 14 Years Ago.avi'.
04:31:21: [DSHOW] -> This movie has dimensions: 608x448.
You should be able to do stop, pause, and play as many times as you wish with no problems, as far as you only pause the video, and don't unload it or anything like that. Do you get the same results when playing other kinds of videos? (videos that use some other code, some mpeg, etc)
I've created a small 30 second clip to test out this direct show with ogre. The movie resolution is 1024x768. The window size is also 1024x768. However everytime i play i just get a white screen. I've tired mulitple movies to see if it was the code. Tired avi, mpg, mpeg and wmv. all with the same result. I've even tired different resolution movies, 320x240 and 640x480. It still remains that white till the length of the movie. So i assume it's playing something but i can't see anything other then white. I
friend looked at it. and realized i was missing this. now the movie is playing. but there is lag. any idea guys as to why? does the resolution size matter? currently it is 1024x768. The file size is about 5mbs.
The dshow class isn't very optimized; it copies each frame pixel per pixel to the target texture, using a pair of C for-loops, no asm, no other code optimization (and anyway, as writing to texture is always slow because of the video card, there wouldn't such an important gain if optimizing it in the cpu). So yes, 1024x768 can be part of the problem, if the computer isn't fast enough; try with 800x600 or some similar res to see if you keep having that problem.
ya i just checked a really same resolution size. 320x240. Tired it on two different computers still lag. I'm wondering if there something wrong with the codec or any optimization that i could do. i read something about doubling the texture size and that this feature by default disabled? would that work? if so how to enable it?
What do you call lag? is it the time between loading and playing, or is it a decrease in fps?
You shouldn't be experiencing the second in your computer; the first is possible as direct show is doing streaming and it's no rare that it takes around half a second to start streaming.
Do you have the same problem when playing the video with the media player? can you try with another video (some movie, etc)?
yes i've tired multiple videos. Using windows media player it plays fine. It's choppy. As in i can see it ghosting and skipping frames. I'm using standard 29.7 frames per second for the video. It's just directly exported out of adobe premiere. I've even brought the quality down even further by using window movie maker so the its a 512kps. Still the same problem.
i thought maybe im doing something really wrong with the video. But when i turned on my speakers, the audio is choppy as well. Lots of weird stuttering. I put a frame counter on it. It's running between 30fps to 35fps. But it does drop sometimes to 24fps.
do you happen to know if a specific setting i should be using for DirectShow to render correctly. I downloaded window media encoder and am trying the settings.
Hey,
I've got the runtime error while trying to run my app. I've used the simplest code from wiki and it compiles fine though there was a problem with missing ddraw.h file but after installing directx sdk all went well. Anyone has encountered that issue with runtime error?
really? did u you see my source code up on top. i made an overlay. you got all resolutions working with sound and no stuttering? Because right now im running at 320x240 and i really hate it. lol. please help.