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)

Jake

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

So far so good. I've got the TextureEffectPlay_Looping state enabled. When mPlayMode is set to TextureEffectPlay_Looping, the end of the video is detected and the video is restarted within the TheoraMovieClip class . However, I still have to figure out how to properly reset m_oggFile to play from the beginning. Right now iterations 2 and up of the looped video are jumpy.
Logged

Jake

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

Looping is now functional. There is still the tiniest little hitch when the video restarts. I'd like to get that hitch smoothed out before I post the solution. Should be coming soon.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Tutorial?
« Reply #17 on: September 19, 2006, 11:36:48 AM »

Sounds sweet :)

If you create a patch for it, I would happily apply it to cvs ;)
Logged

Jake

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

Sure thing. I still need to address the hitch. I need to figure out what's going on with the m_theoraStreamState variable and what needs to be reset in order to smooth out the loop. Overall the looping looks much better than the destroy and restart method I tried first, and the hitch is difficult to detect if you're not paying attention, but I'd like it to be perfect if I can get it there.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Tutorial?
« Reply #19 on: September 19, 2006, 11:51:15 AM »

Documentation in that regards is severely lacking in theora. The seeking code was my attempt at figuring it out :)

You could try stopping by: #theora on irc.freenode.net (IRC). They used to hang out there, though been a year since I stepped in there.
Logged

Jake

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 15
    • View Profile
Tutorial?
« Reply #20 on: September 19, 2006, 02:09:33 PM »

Quote


 Documentation in that regards is severely lacking in theora



You're not kidding. I've still got the problem, but I'm closing in on it's source. On the restart of the video, the m_theoraState.granulepos is failing to get updated over the first few frames. This causes the videobuf_time to stall, which in turn screws up the delay. Once I get that figured out I should be able to fix it. We'll see if that's easier said than done. The bear of it is, I can't debug in debug mode. The reduced frame rate in debug mode properly trips the frame dropping that is improperly tripped with this error. So I'm back to using the undergrad style output-to-file debugging that I so fondly forgot even existed.   :roll:
Logged

Jake

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 15
    • View Profile
Tutorial?
« Reply #21 on: September 20, 2006, 06:35:33 AM »

Essentially it comes down to this line of code.

Code: [Select]


if( ogg_stream_packetout( &m_theoraStreamState, &opTheora) > 0 )



in TheoraMovieClip.cpp

the m_theoraStreamState struct is used to determine which ogg packet to get from the stream. On the reset of the loop, this struct has to be somehow filled with the correct values.

At the end of the TheoraMovieClip::execute() function, I capture the end of the stream event and set the following

Code: [Select]


            m_oggFile->seek(0);
bytesRead = 1;

m_Timer->reset();

// need to do some stuff to m_theoraState, m_theoraStreamState
m_theoraState.granulepos = -1;
m_theoraStreamState.packetno = -1;
m_theoraStreamState.pageno = -1;
m_lastFrameTime = 0;
m_FrameNum = 0;
m_FramesDropped = 0;





which allows for looping but has the hitch. I'm dumping the values of the struct all over the code, but still can't discern the pattern. Onwards and upwards.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Tutorial?
« Reply #22 on: September 20, 2006, 10:34:12 AM »

Hmm, one little suggestion, you should make the seek method reset those values. This way, seek works when called from the middle of the movie playback to :)
Logged

Jake

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 15
    • View Profile
Tutorial?
« Reply #23 on: September 20, 2006, 10:41:20 AM »

I've pretty much hit a brick wall. The ogg stream structs have almost no documentation, so I've mostly been hacking away at them trying to hit on the right set of values. I'll send the patch in case anyone is interested in looking it over.
Logged

Jake

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 15
    • View Profile
Tutorial?
« Reply #24 on: September 20, 2006, 10:43:21 AM »

Quote from: "pjcast"
Hmm, one little suggestion, you should make the seek method reset those values. This way, seek works when called from the middle of the movie playback to :)


I intend to clean it all up and integrate it into the seek method if and when I ever get it working properly. Right now I'm just trying to hammer my way to the right combination of values to get a smooth transition.

On a side note I imagine that creating actual seek will be much more difficult than simply looping. The granule positions seem to have a lot to do with proper data streaming, and the documentation on them is nearly nonexistent. Looping I'm hoping will be simpler as I assume you just need to reset the right combination of variable to a start state and you're done. Hopefully.  :roll:
Logged

Jake

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 15
    • View Profile
Tutorial?
« Reply #25 on: September 21, 2006, 08:32:20 AM »

I've been looking for the DirectShow plugin mentioned in the Ogre forums to see if it could provide any clues as the what's going on. But I can't find the actual plugin. Anyone have any idea what/where it is?
Logged

Jake

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 15
    • View Profile
Tutorial?
« Reply #26 on: September 29, 2006, 12:21:48 PM »

I wound up bailing on Theora. Direct Show integrates nicely with both CEGUI and Ogre, and the looping is a piece of cake. Thank you for you help, though, pj. I learned a lot about video rendering from your plugin. I can see why looping is not already present in the videoplugin. What a nightmare.  :shock:
Logged

Sodoshi

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 1
    • View Profile
Late to the party...
« Reply #27 on: October 17, 2006, 03:03:17 AM »

Hi... I'm trying to compile Theora so that I can use a video plugin with vb.net/OgreDotNet (C is alien to me, I'm afraid :<)

Do you know if there's a DirectShow plugin that will work with OgreDotNet, or am I better off trying to work out the fix for the 'hitch' as there's sample code for DotNet and this plugin?
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Tutorial?
« Reply #28 on: October 17, 2006, 05:48:56 AM »

There is another video plugin written using directshow. I suggest you search the Ogre forum's. Also, there is a version of my plugin that I wrote entirely in C#. http://www.wreckedgames.com/files/csTheora.zip

Here is a ODN thread on it: http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=1626&highlight=
Logged
Pages: 1 [2]