Page 7 of 7

Re: (Code Snippet) Video reproduction using DirectShow

Posted: Mon Mar 21, 2011 1:26 pm
by davisdmg
I can reproduce the avi file in windows media player without problems, so I suposse that I have the codecs.

The problems is with all videos (.avi, .mpg) :(


Sorry my english, I'm spanish.

Re: (Code Snippet) Video reproduction using DirectShow

Posted: Mon Mar 21, 2011 5:44 pm
by vitefalcon
Windows media player and DirectShow are not the same. So you cannot assert that you've got the codec just because you play that file in WMP. You'll need to find the encoding of the AVI. Hopefully this link should be useful to you.

Re: (Code Snippet) Video reproduction using DirectShow

Posted: Fri Jun 03, 2011 11:26 am
by ProDOgre
Hi guys,

I'm playing videos normally when the application is in windowed mode but when the application is in full screen, when
I execute the playMovie() method the application goes to windows and I have to click in the application icon to go back
to the fullscreen again... it seems when playing the video for the first time it sends a Device reset or something...
I have windows7 with a nice graphics cards... Do you have any solution for this issue?

Thank you in advace!

Re: (Code Snippet) Video reproduction using DirectShow

Posted: Sat Jan 14, 2012 1:54 am
by lacasta3
Hello ,i tried to play a movie in a basic ogre application,i hear the sound but i dont cant see the movie
my video is an AVI video with alpha i think and this is my code :

void TutorialApplication::createScene(void)
{
OgreUtils::DirectShowMovieTexture* directShozTextSys = new OgreUtils::DirectShowMovieTexture(960,540);


Ogre::MaterialPtr mat;
Ogre::TextureUnitState* tex;


Ogre::String moviename = "D:/video/PixOrb_1.avi";
directShozTextSys->loadMovie(moviename);


Ogre::String materialName="MyMaterial";



if (Ogre::MaterialManager::getSingleton().resourceExists(materialName))
{


mat=Ogre::MaterialManager::getSingleton().getByName(materialName);
tex=mat->getTechnique(0)->getPass(0)->getTextureUnitState(0);
tex->setTextureName(directShozTextSys->getMovieTexture()->getName() );

}

directShozTextSys->playMovie();

....

can anyone help me plz,i really need to resolve this.

Re: (Code Snippet) Video reproduction using DirectShow

Posted: Mon Jun 02, 2014 7:50 am
by Uma
Hi all,

I have a problem with video loading on Ogre using DirectShow.
I followed example here: http://www.ogre3d.org/tikiwiki/tiki-ind ... re+texture

This is my code:

Code: Select all

void SampleVideo::createScene(void)
{
	OgreUtils::DirectShowMovieTexture* dshowMovieTextureSystem = new OgreUtils::DirectShowMovieTexture(320, 240);
	Ogre::String movieName="C:/Video/composite.avi";
	dshowMovieTextureSystem->loadMovie(movieName);

	dshowMovieTextureSystem->playMovie();
	dshowMovieTextureSystem->pauseMovie();
	dshowMovieTextureSystem->stopMovie();
	dshowMovieTextureSystem->rewindMovie();

	bool isPlaying = dshowMovieTextureSystem->isPlayingMovie();

	dshowMovieTextureSystem->updateMovieTexture();

	Ogre::MaterialPtr mat;
	Ogre::TextureUnitState* tex;
 
	Ogre::String materialName="MyMaterial";
	if (!Ogre::MaterialManager::getSingleton().resourceExists(materialName))
	{
		throw("Error, material doesn't exist!");
		//return 0;
	}
	mat = Ogre::MaterialManager::getSingleton().getByName(materialName);
	mat->load();
	tex = mat->getTechnique(0)->getPass(0)->getTextureUnitState(0);
	tex->setTextureName(dshowMovieTextureSystem->getMovieTexture()->getName());

	delete dshowMovieTextureSystem;

	if (Ogre::MaterialManager::getSingleton().resourceExists(materialName))
	{
		Ogre::MaterialPtr mat;
		Ogre::TextureUnitState* tex;
 
		mat=Ogre::MaterialManager::getSingleton().getByName(materialName);
		tex=mat->getTechnique(0)->getPass(0)->getTextureUnitState(0);
		tex->setTextureName(Ogre::String(""));
	}
}
But there was an error:

Code: Select all

Error	1	error LNK2019: unresolved external symbol "public: class Ogre::TexturePtr __thiscall OgreUtils::DirectShowMovieTexture::getMovieTexture(void)" (?getMovieTexture@DirectShowMovieTexture@OgreUtils@@QAE?AVTexturePtr@Ogre@@XZ) referenced in function "protected: virtual void __thiscall SampleVideo::createScene(void)" (?createScene@SampleVideo@@MAEXXZ)	C:\Univotec\Task\Process\SampleVideo\SampleVideo\SampleVideo.obj
Error	2	error LNK2019: unresolved external symbol "public: void __thiscall OgreUtils::DirectShowMovieTexture::updateMovieTexture(void)" (?updateMovieTexture@DirectShowMovieTexture@OgreUtils@@QAEXXZ) referenced in function "protected: virtual void __thiscall SampleVideo::createScene(void)" (?createScene@SampleVideo@@MAEXXZ)	C:\Univotec\Task\Process\SampleVideo\SampleVideo\SampleVideo.obj
Error	3	error LNK2019: unresolved external symbol "public: bool __thiscall OgreUtils::DirectShowMovieTexture::isPlayingMovie(void)" (?isPlayingMovie@DirectShowMovieTexture@OgreUtils@@QAE_NXZ) referenced in function "protected: virtual void __thiscall SampleVideo::createScene(void)" (?createScene@SampleVideo@@MAEXXZ)	C:\Univotec\Task\Process\SampleVideo\SampleVideo\SampleVideo.obj
Error	4	error LNK2019: unresolved external symbol "public: void __thiscall OgreUtils::DirectShowMovieTexture::rewindMovie(void)" (?rewindMovie@DirectShowMovieTexture@OgreUtils@@QAEXXZ) referenced in function "protected: virtual void __thiscall SampleVideo::createScene(void)" (?createScene@SampleVideo@@MAEXXZ)	C:\Univotec\Task\Process\SampleVideo\SampleVideo\SampleVideo.obj
Error	5	error LNK2019: unresolved external symbol "public: void __thiscall OgreUtils::DirectShowMovieTexture::stopMovie(void)" (?stopMovie@DirectShowMovieTexture@OgreUtils@@QAEXXZ) referenced in function "protected: virtual void __thiscall SampleVideo::createScene(void)" (?createScene@SampleVideo@@MAEXXZ)	C:\Univotec\Task\Process\SampleVideo\SampleVideo\SampleVideo.obj
Error	6	error LNK2019: unresolved external symbol "public: void __thiscall OgreUtils::DirectShowMovieTexture::pauseMovie(void)" (?pauseMovie@DirectShowMovieTexture@OgreUtils@@QAEXXZ) referenced in function "protected: virtual void __thiscall SampleVideo::createScene(void)" (?createScene@SampleVideo@@MAEXXZ)	C:\Univotec\Task\Process\SampleVideo\SampleVideo\SampleVideo.obj
Error	7	error LNK2019: unresolved external symbol "public: void __thiscall OgreUtils::DirectShowMovieTexture::playMovie(void)" (?playMovie@DirectShowMovieTexture@OgreUtils@@QAEXXZ) referenced in function "protected: virtual void __thiscall SampleVideo::createScene(void)" (?createScene@SampleVideo@@MAEXXZ)	C:\Univotec\Task\Process\SampleVideo\SampleVideo\SampleVideo.obj
Error	8	error LNK2019: unresolved external symbol "public: void __thiscall OgreUtils::DirectShowMovieTexture::loadMovie(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (?loadMovie@DirectShowMovieTexture@OgreUtils@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z) referenced in function "protected: virtual void __thiscall SampleVideo::createScene(void)" (?createScene@SampleVideo@@MAEXXZ)	C:\Univotec\Task\Process\SampleVideo\SampleVideo\SampleVideo.obj
Error	9	error LNK2019: unresolved external symbol "public: __thiscall OgreUtils::DirectShowMovieTexture::DirectShowMovieTexture(int,int,bool)" (??0DirectShowMovieTexture@OgreUtils@@QAE@HH_N@Z) referenced in function "protected: virtual void __thiscall SampleVideo::createScene(void)" (?createScene@SampleVideo@@MAEXXZ)	C:\Univotec\Task\Process\SampleVideo\SampleVideo\SampleVideo.obj
Error	10	error LNK1120: 9 unresolved externals	C:\Univotec\Task\Process\SampleVideo\SampleVideo\bin\Debug\\SampleVideo.exe	1
Is there anyone deal with that error before, please help me..............

Re: (Code Snippet) Video reproduction using DirectShow

Posted: Mon Jun 02, 2014 12:41 pm
by c6burns
This is the same problem as your other thread http://www.ogre3d.org/forums/viewtopic.php?f=10&t=81079
(aka linking 101)