Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Pages: [1] 2

Author Topic: The beginning  (Read 3704 times)

renegadeandy

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 14
    • View Profile
The beginning
« on: July 25, 2008, 05:14:28 PM »

I need to try the Theora plugin with Ogre preferrably under Linux.

I have read the Ogre forum and the wrecked games forum a bit and cannot find anything which walks through the build process so I have got ogre working with the plugin. Where do I download the plugin and what is it compatible with to begin with! Once I have everything, i guess I somehow need to build it so it works with Ogre?!

Please help - I am on Ubuntu 8.04.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Re: The beginning
« Reply #1 on: July 25, 2008, 06:45:19 PM »

The plugin is compatible with recent Ogre's, while the CEGUI demo is compatible with Ogre 1.2 I believe (maybe one before that, would have to really look). Anyway, I don't really develop/support it in years; though, Ice mentioned forking the project and maintaining that.

I think there is a readme that contains info. Anyway, is pretty simple. Build/Install Ogre, CEGUI (for demo), make sure you have libtheora installed. Go to theora plugin directory, configure, make, make install, go to demo folder, same thing.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Re: The beginning
« Reply #2 on: July 25, 2008, 06:46:39 PM »

Oh, and as for where to find it, check out the Ogre Addons SVN project (from Ogre site) for SVN location. It was under ogreaddons/videoplugin (as well as an older ffmpeg example, and a directshow example), not sure about new SVN structure.
Logged

renegadeandy

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 14
    • View Profile
Re: The beginning
« Reply #3 on: July 27, 2008, 12:13:58 PM »

Ok, im all set to try to find the videoplugin folder, but cnt find it anywhere - anybody got a path?!
Logged

renegadeandy

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 14
    • View Profile
Re: The beginning
« Reply #4 on: July 27, 2008, 02:03:24 PM »

Ah right so i downloaded the svn stuff - and ive run autoconf, but it says :

 error: possibly undefined macro: AM_PROG_LIBTOOL

and a couple of various other undefined things, libtool is definatelly 100% installed.

along with the other things it needs!

Help
« Last Edit: July 27, 2008, 02:39:37 PM by renegadeandy »
Logged

renegadeandy

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 14
    • View Profile
Re: The beginning
« Reply #5 on: July 27, 2008, 05:09:48 PM »

Ok solved all that and EVENTUALLY had built my Plugin_TheoraVideoSystem.so

Finally!

Ok, so

Now i have the following code and am trying to compile :

Code: [Select]
#include <OGRE/Ogre.h>
#include <OGRE/OgreString.h>
#include <OGRE/OgreTexture.h>
#include <OGRE/OgreTextureManager.h>
#include <OGRE/OgreMaterialManager.h>
#include <OGRE/OgreTechnique.h>
#include <OGRE/OgreResourceManager.h>
#include <OGRE/OgreExternalTextureSourceManager.h>


#include "TheoraVideoController.h"
#include "TheoraMovieClip.h"
#include "TheoraSeekUtility.h"
#include "TheoraVideoDriver.h"

using namespace Ogre;

int main(int argc, char **argv)

{
    // Create application object
 

    try {
        TheoraVideoController* mVideoControl = static_cast<TheoraVideoController*> (ExternalTextureSourceManager::getSingleton().getExternalTextureSource("ogg_video"));
TheoraMovieClip *pClip = mVideoControl->getMaterialNameClip("Movie");
MaterialPtr material = Ogre::MaterialManager::getSingleton().create("Background", "General");
material->getTechnique(0)->getPass(0)->createTextureUnitState();
//rect->setMaterial("Movie");



//if(pClip)
//
//{
// pClip->changePlayMode(TextureEffectPause);
// mVideoControl->destroyAdvancedTexture("Movie");
//}


    } catch( Exception& e ) {

        fprintf(stderr, "An exception has occurred: %s\n",
                e.what());

    }

    return 0;
}


Its stupidly simple to try to get it to compile - anyway - it says this :

andy@andylinux:~/devel/video$ g++ main.cpp -o main -DOGRE_GUI_GLX -DOGRE_CONFIG_LITTLE_ENDIAN -I/usr/include/OGRE `pkg-config --cflags --libs OGRE`
/tmp/ccBZMGQk.o: In function `main':
main.cpp:(.text+0x280): undefined reference to `Ogre::TheoraVideoController::getMaterialNameClip(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
collect2: ld returned 1 exit status
andy@andylinux:~/devel/video$

So i obviously am not linking correctly to the right thing - or something... I have placed that plugin in the /usr/lib/OGRE directory and have created a plugins.cfg in the directory of my project which has :

Code: [Select]
# Defines plugins to load

# Define plugin folder
PluginFolder=/usr/lib/OGRE/

# Define plugins
Plugin=Plugin_TheoraVideoSystem



Please help - i really need this to FINALLY work!

It looks like i need a .la, or .a file for the plugin - but it didnt seem to generate one, or dont no where to get it!
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Re: The beginning
« Reply #6 on: July 27, 2008, 06:53:55 PM »

If you are going to call the plugin class directly, as your code does, you will need to link against the shared library (Plugin_TheoraVideoSystem.so). You don't need to link against it if you are just making use of the base class Ogre::ExternalTextureSourceManager... But, you will likely want to call the class directly, so linking to it is needed to build. How you link against it is simply to gcc add the -lPluginTheoraVideoSystem kind of thing. You can also look at the CEGUI exmple which has the autoconf makefiles and also links to it.
Logged

renegadeandy

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 14
    • View Profile
Re: The beginning
« Reply #7 on: July 27, 2008, 11:42:25 PM »

Thanks for the swift reply!

Didnt know you could do that - well i therefore tried this :

 g++ main.cpp -o main -DOGRE_GUI_GLX -DOGRE_CONFIG_LITTLE_ENDIAN -I/usr/include/OGRE `pkg-config --cflags --libs OGRE` -lPluginTheoraVideoSystem
/usr/bin/ld: cannot find -lPluginTheoraVideoSystem
collect2: ld returned 1 exit status
andy@andylinux:~/devel/video$

However as you can see - it cannot find the file, what next!

Also I dont no where to find that CEGUI example makefile etc!

Thanks - Andy
Logged

renegadeandy

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 14
    • View Profile
Re: The beginning
« Reply #8 on: July 28, 2008, 10:31:26 AM »

Ok, solved another problem too!

Right so im down to the bit where it tries to load the material, so i have made a folder called data and stuck myMaterial.material in there which contanis this:
Code: [Select]
material Examples/TheoraVideoPlayer/Play
{
technique
{
pass
{
texture_unit
{
texture_source ogg_video
{
filename test.ogg
//play, pause, or loop are valid
play_mode loop
}
}
}
}
}

Then i did mRoot->addResourceLocation("./data","FileSystem","General",true);

and it said it loaded it fine on command line when running.

However material is still null, so it must not be loadnig the material properly.

Any ideas?!
« Last Edit: July 28, 2008, 03:03:20 PM by renegadeandy »
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Re: The beginning
« Reply #9 on: July 28, 2008, 04:34:24 PM »

You should check out Ogre.log. When Ogre adds resource locations it (I think) displays names of materials it loads? Also, Video plugin should display that it loaded the movie. Or maybe there is an error there.
Logged

renegadeandy

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 14
    • View Profile
Re: The beginning
« Reply #10 on: July 29, 2008, 12:25:52 AM »

Can you link to me cheers.ogg so I have a file which I know is meant to be playable!?
Logged

dermont

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 23
    • View Profile
Re: The beginning
« Reply #11 on: July 29, 2008, 09:06:31 AM »

Logged

renegadeandy

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 14
    • View Profile
Re: The beginning
« Reply #12 on: July 29, 2008, 01:04:45 PM »

Right, ok the big problem for me still is the following.

I have a material in Media/Materials/myMaterial.material

which has the following :

Code: [Select]
material Examples/TheoraVideoPlayer/Play
{
   technique
   {
      pass
      {
         texture_unit
         {
            texture_source ogg_video
            {
               filename konqi_ad1_nl.ogg
               play_mode play
            }
         }
      }
   }
}

Now - I add this path to the resources.cfg file like this

Code: [Select]
[General]
FileSystem=Media/materials/
FileSystem=Media/movie/

On this line :

TheoraMovieClip *pClip = mVideoControl->getMaterialNameClip("Examples/TheoraVideoPlayer/Play");

It fails.

Why is this.......!

It basically says it cannot find this.
« Last Edit: July 29, 2008, 02:32:45 PM by renegadeandy »
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2652
    • View Profile
    • http://www.wreckedgames.com
Re: The beginning
« Reply #13 on: July 29, 2008, 05:38:32 PM »

As I said, the Ogre.log is your best for finding the issue. Also, even though you do not want a CEGUI example, that demo would be your very best starting point. It will compile out of the box with a Ogre 1.2 (or 1.0 - whichever used CEGUI 0.4.x). Then, you can see how it should be done.

Anyways, your problem is likely some issue that can be seen if you post your Ogre.log.
Logged

renegadeandy

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 14
    • View Profile
Re: The beginning
« Reply #14 on: July 30, 2008, 12:43:49 AM »

yeah the log is :

Code: [Select]

23:27:16: Creating resource group General
23:27:16: Creating resource group Internal
23:27:16: Creating resource group Autodetect
23:27:16: SceneManagerFactory for type 'DefaultSceneManager' registered.
23:27:16: Registering ResourceManager for type Material
23:27:16: Registering ResourceManager for type Mesh
23:27:16: Registering ResourceManager for type Skeleton
23:27:16: MovableObjectFactory for type 'ParticleSystem' registered.
23:27:16: OverlayElementFactory for type Panel registered.
23:27:16: OverlayElementFactory for type BorderPanel registered.
23:27:16: OverlayElementFactory for type TextArea registered.
23:27:16: Registering ResourceManager for type Font
23:27:16: ArchiveFactory for archive type FileSystem registered.
23:27:16: ArchiveFactory for archive type Zip registered.
23:27:16: FreeImage version: 3.9.3
23:27:16: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
23:27:16: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi
23:27:16: DDS codec registering
23:27:16: Registering ResourceManager for type HighLevelGpuProgram
23:27:16: Registering ResourceManager for type Compositor
23:27:16: MovableObjectFactory for type 'Entity' registered.
23:27:16: MovableObjectFactory for type 'Light' registered.
23:27:16: MovableObjectFactory for type 'BillboardSet' registered.
23:27:16: MovableObjectFactory for type 'ManualObject' registered.
23:27:16: MovableObjectFactory for type 'BillboardChain' registered.
23:27:16: MovableObjectFactory for type 'RibbonTrail' registered.
23:27:16: Loading library /usr/lib/OGRE/Plugin_TheoraVideoSystem
23:27:16: Registering Texture Controller: Type = ogg_video Name = TheoraVideoPlugIn
23:27:16: *-*-* OGRE Initialising
23:27:16: *-*-* Version 1.4.5 (Eihort)
23:27:16: Added resource location 'Media/materials/' of type 'FileSystem' to resource group 'General'
23:27:16: Added resource location 'Media/movie/' of type 'FileSystem' to resource group 'General'
23:27:16: **Warning** ::>> TheoraVideoController::getMovieClip Tried to find Movie Texture Examples/TheoraVideoPlayer/Play. Though, Texture was not anywhere to be found :<
23:27:16: *-*-* OGRE Shutdown
23:27:16: Unregistering ResourceManager for type Compositor
23:27:16: Unregistering ResourceManager for type Font
23:27:16: Unregistering ResourceManager for type Skeleton
23:27:16: Unregistering ResourceManager for type Mesh
23:27:16: Unregistering ResourceManager for type HighLevelGpuProgram
23:27:16: Unloading library /usr/lib/OGRE/Plugin_TheoraVideoSystem
23:27:16: Unregistering ResourceManager for type Material

But the material does exist in that directory :@ ahhhh!
Logged
Pages: [1] 2