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: Tutorial?  (Read 7555 times)

smudboy

  • Guest
Tutorial?
« on: October 19, 2005, 10:03:55 AM »

I'm looking for a tutorial on how to use Theora.  The dummies step by step process.

Anyone have any pointers/links?
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Tutorial?
« Reply #1 on: October 19, 2005, 12:20:18 PM »

Theora? or the TheoraPlugin for Ogre?

There is currently no tutorial for either that I know of (yet anyway)... I was adding info to the wiki. However, the best info for this plugin is in the demos right now. If you have any specific questions feel free to ask.
Logged

volleystar

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 1
    • View Profile
Tutorial?
« Reply #2 on: April 26, 2006, 01:34:58 AM »

Hello,

one big problem of this demos is, that they are very big  :shock:
For me it is a minimal application interesting where you see all, what do you really need to play a simple video on a texture.

As I know there a two ways. first is to create a material and set it to an overlay or everthing else. the second to use by code.

Please can you write two simple application where just a video is played on a single overlay (or on ogre head :D  ) by using the two ways as described above?

This would be really nice :)
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Tutorial?
« Reply #3 on: April 26, 2006, 09:37:02 AM »

It is pretty simple system. You can look at the other demo (The TheoraVideoGuiDemo) - ir is out of date, but should give you the idea of how to put video's into a material file. Although, then you have to make it paused in the material file, and set the audio system in code, and then play it.

Really, if you don't want any of the features of the CEGUI demo, just strip them out ;) Replace the play function with seting the material onto a Ogre entity or overlay, remove all the seeking stuff.. Pause stuff, remove any feature you are not interested in until you have made it as bare bones as you want.

I likded using CEGUI in that demo mainly for the ability to list the movies in the media directory, and select one for playing. Besides that, you can hardcore the movie name, and completely remove CEGUI.

Sorry though, i do not have the time to create a more simple demo. That demo is basically Movie stuff added onto a CEGUI demo.
Logged

Kurruk

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Tutorial?
« Reply #4 on: August 05, 2006, 09:03:33 AM »

I second that :)

I started to play with plugin, as I'd like to play some movie, at first only on intro state. So I wanted to know is there some simple practical app, that would only show needed parts, and why they are needed.
I fought with it for some time for the past 2 days, and finaly managed to use it, and see working GUIDemo. The first thing I thought was, to make it to my mini app, that I loved so much for my past errors ;)
If you don't have time to strip thing off or write some cool tutorial, then let mi ask you some questions, and maby by that, it will be easier for me to know that system, and other people, to like it ;)

After some in-code views I noticed, that u made some wraper function for stearing movie. That's cool for later work, but for now, is it realy necessary to make my own wraping class? For some example, I'd like to make material, which I made already, and write few lines of code, to app:

    1 load movie material
    2 set to loop, or make only one play
    3 set that material to rectangle
    4 at the end, release movie material


is it possible to make it that simple?
{ tried to load it as an normal material, but only got blac window ;? }

Second question - do I have to make event based application? I really would like to stay with my main loop, and check if something has changed, and if necesary do something with it.
Logged
 darkness in the heart cannot be cured by moving the body to a different place.

Kurruk

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Tutorial?
« Reply #5 on: August 05, 2006, 04:37:45 PM »

Addon:
- on wiki when u listed directory structure, when to put ogreaddons, there was "ogremain", and should be "ogrenew" - it gave me some problems with includes, I had to check number of parent dir signs in path ".." ;)
- I'm using OpenAl 1.1, and there was error in compilation, and I had to change one thig on line "42" in file "OpenALSoundIO.cpp":
 (ALCubyte*) ==> (ALCchar*)
- also project for VS8, had present only Debug, even if I choosed Release, projects had Debug - had to change that (don't know if it was for my VCExpress or not)
Logged
 darkness in the heart cannot be cured by moving the body to a different place.

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Tutorial?
« Reply #6 on: August 07, 2006, 08:06:57 AM »

Thanks for the information, patches are welcome for anything wrong with VC8 demos. I have not really touched this plugin in some time, and only quickly put up some VC8 files. You would likely have good luck importing the VC7 project files ;)

As for a simple app, yes, it can be done. But, due to my lack of time on this, I setup a complete demo :)

1 load movie material - If done in material file, it takes a really short amount of code - all you would have to do, is start it off paused, and pass in a sound wrapper class you are using. Then start playback.Else, just look at the Movie logic class, and ignore the main cpp file.. As that mostly setup's CEGUi & Ogre, and has all the hooks for Gui event handling.

2 set to loop, or make only one play - I never implemented looping. I did, however, implement some rudimentary seeking. However, I suggest, you just listen for the end event, then, destroy the movie, and recreate it if you need looping.

3 set that material to rectangle - You can apply the material to anything (quad, billboard, particle, entity, etc). It is actually simpler then trying to get it on a Cegui widget.

4 at the end, release movie material - This is something you have to listen for (the theora message events). Then you can destroy it.
Logged

Kurruk

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Tutorial?
« Reply #7 on: August 07, 2006, 01:36:44 PM »

As I said, I wanted to make it very simple, as simple, as it gets ;)
Unfortunately I'm doing something wrong, or not doing something, and only see the blac window.

This is my code:
Code: [Select]
TheoraVideoController* mVideoControl = static_cast<TheoraVideoController*>(ExternalTextureSourceManager::getSingleton().getExternalTextureSource("ogg_video"));
TheoraMovieClip *pClip = mVideoControl->getMaterialNameClip("Movie");
rect->setMaterial("Movie");

{main_loop}

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


and this is my material:
Code: [Select]
material Intro
{
technique
{
pass
{
lighting off
depth_check off
depth_write off

texture_unit
{
texture intro.png
}
}
}
}

material Movie
{
technique
{
pass
{
texture_unit
{
texture_source ogg_video
{
filename cheer.ogg
play_mode play
sound_mode off
}
}
}
}
}


If setMaterial is Intro, I can see picture, but with Movie, all I see is black screen :/
Some hint?

File seems to be loaded correctly
Code: [Select]
23:21:34: Parsing script Backgrounds.material
23:21:34: Vorbis Headers: 0 Theora Headers : 3
23:21:34: Texture: cheer.ogg: Loading 1 faces(PF_B8G8R8,352x240x1) with 0 generated mipmaps from Image. Internal format is PF_X8R8G8B8,352x240x1.
23:21:34: Finished parsing scripts for resource group General
23:21:34: Parsing scripts for resource group Internal
23:21:34: Finished parsing scripts for resource group Internal
Logged
 darkness in the heart cannot be cured by moving the body to a different place.

Kurruk

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Tutorial?
« Reply #8 on: August 08, 2006, 12:33:03 AM »

I played with it, a little bit, and wanted to make, the material in the code first, but that didn't help a bit. Also I noticed, that I didn't set the input name for movie file, so here's the code:
Code: [Select]
TheoraVideoController* mVideoControl = static_cast<TheoraVideoController*>(ExternalTextureSourceManager::getSingleton().getExternalTextureSource("ogg_video"));
MaterialPtr material = MaterialManager::getSingleton().create("Background", "General");
material->getTechnique(0)->getPass(0)->createTextureUnitState();
mVideoControl->setInputName("cheer2.ogg");
mVideoControl->createDefinedTexture("Background", "General");
TheoraMovieClip *pClip = mVideoControl->getMaterialNameClip("Background");
pClip->changePlayMode(TextureEffectPlay_ASAP);
rect->setMaterial("Background");


And this code return proper name, for video, so it seams, that everything is correct.
Code: [Select]
pClip->getVideoDriver()->getTexture()->getName()
Logged
 darkness in the heart cannot be cured by moving the body to a different place.

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Tutorial?
« Reply #9 on: August 08, 2006, 04:18:00 PM »

You setup code looks fine at first glance. Are you calling clip->blitFrameCheck every frame? This is how the clip gets updated. It used to be automatic, via framelisteners, but changes to Ogre listener delegation and removal caused a bug when removing the clip, so I was forced to implement this via a user update every loop. One could go back and change it so that all clips get updated via the same framelistener every loop.
Logged

Kurruk

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Tutorial?
« Reply #10 on: August 08, 2006, 10:51:02 PM »

Hooray :)
I was actualy missing that part ;)
But now it's working  8)
Time to make it work on ogre material, ewentualy will post the code, for those in need ;)
Logged
 darkness in the heart cannot be cured by moving the body to a different place.

Kurruk

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Tutorial?
« Reply #11 on: August 08, 2006, 11:07:26 PM »

Heh it was easier, than I thought. Just had to delete few lines. Below is the code - as for the material look up ;)

Code: [Select]
TheoraVideoController* mVideoControl = static_cast<TheoraVideoController*>(ExternalTextureSourceManager::getSingleton().getExternalTextureSource("ogg_video"));
TheoraMovieClip *pClip = mVideoControl->getMaterialNameClip("Movie");
pClip->changePlayMode(TextureEffectPlay_ASAP);
rect->setMaterial("Movie");


important things are to remember about using blitFrameCheck, and cleaning after the movie ;)
Also this little code, even stopped in middle, or after it stopped on it's own, didn't cause any leaks or errors.

Now I must add audio capabiblity to the code ;)
Logged
 darkness in the heart cannot be cured by moving the body to a different place.

Jake

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 15
    • View Profile
Tutorial?
« Reply #12 on: September 18, 2006, 01:41:54 PM »

If you get the looping  worked out, please post it here. All the options I've tried loop work fine, but include a blank frame while the movie is being restarted. Tomorrow I'll investigate changing the actual plugin to incorporate looping, but if anyone has an easy workaround, I'd appreciate it. I'm putting together a demo package of Ogre/CEGUI/OIS/Theora/OpenAL to develop interactive 3D content  for my company. Looping video is a requirement, and if I can avoid messing with the plugin until after the package is approved, I'd like to.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Tutorial?
« Reply #13 on: September 18, 2006, 01:57:45 PM »

Sorry, I don't expect I will have any time to work on the plugin. In fact, I have almost laid the project to rest due to my lack of time.

I suggest, if you are targeting windows only, check out the DirectShow video plugin on the Ogre forums. Since it is DirectShow based, you can literally use any codec that Windows supports.
Logged

Jake

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 15
    • View Profile
Tutorial?
« Reply #14 on: September 19, 2006, 06:12:11 AM »

No worries, your work gets me 95% of the way home. No complaints from this end. I think I'll mess with the plugin for a while to implement looping. We provide interactive content to a number of clients. The software I need to write is a rapid-prototype demo app with which our art teams can mock up their wares. The requirements from the clients include many points (must play .ogg included) that lead me to believe that they are using Ogre/Theora/etc. etc. in their end product. If I have any success, I'll post the finds here. Thanks for your help.
Logged
Pages: [1] 2