Game Development Community

GuiTheoraCtrl performance issues

by Jules Robichaud Gagnon · in Torque Game Builder · 05/26/2010 (8:44 am) · 6 replies

I am currently working with the evaluation version of Torque Game Builder in order to recreate a prototype we made with another technology. This is a good way for us to test the engine.

Everything is going smoothly except that I am having major performance issues when playing videos with GuiTheoraCtrl.

I looked on the forum and I did not find anything leading me to a way to solve this. I hope someone can help me to find a solution.

Here's the details:

On our previous technology, we were running a 1680x1050 @ 9575kbps video using directshow without any problem.

On Torque2D with GuiTheoraCtrl, we have choppy video with a video at 960x600 @ 1200kbps on my high end computer. On a lower end computer I can barely play a video ingame with 500kbps.

In all cases, the videos will run smoothly in Windows media player, even the 1680x1050 @ 9575kbps video on the lower computer.

I tried to remove the sound but it did not have any noticable impact.

Reducing the kbps to a value so low that it looks terribly ugly is not a good solution in my opinion.

Other things I tried:
- Windowed or full screen mode
- With or without the debugger activated
- Scale or not scale the GuiTheoraCtrl
- I tried with different game resolutions (ranging from 1024x768 to 1920x1200)

I hope someone experienced with Torque has a few leads in order to solve this, I am currently of out of option.

Thanks in advance.

Additional specs:
- Torque Game Builder 1.7.4 evaluation version (could not debug with 1.7.5)
- Higher end computer: 3gb ram, Intel Core 2 Duo T9500 @ 2.6ghz per CPU, Dual NVIDIA 8700GT 512mb, Vista 32bit, Sata Raid 0
- Lower end computer : 2gb ram, AMD 4050e (2X 2.10 Ghz), Vista 32bit, ATI Radeon 2100 (IGP)

#1
05/31/2010 (9:53 pm)
I've upgraded to 1.7.5 source version that has latest Theora source and it did not solve my problem unfortunately.
#2
06/01/2010 (6:39 am)
Hello Jules.

I've not done much with theora but I did drop this example ogg file into TGB and didn't notice any hiccups. The page indicates that the video is: "Ogg multiplexed audio/video file, Theora/Vorbis, length 1m0s, 400×300 pixels, 515kbps overall."

Now that's rather low quality but I thought that it could be a start in troubleshooting. The machine I'm running it on is comparable to your 'Lower end computer' setup but Windows XP.

What are your Aero settings in Vista?
#3
07/26/2011 (11:40 am)
A video like one linked above may be good for first theora tests, but it is doubtfully applicable as an example of the video one would use for a game.

I'm using currently a 1024x576 video, bitrate just above 1000kbps I think, and while it is not really terrible, I've noticed that it is played not nearly as smooth as it should. Target specs are also significantly lower than those of my working machine, so it will easily hit 'terrible' mark for large, if not most, part of our customers.

I've took a look at how TheoraCtrl does its job, and to be honest I can't see a simple way to boost it or even what exactly is causing this. Does looks like while engine _has_ to decode each frame to maintain picture, it _can't do it_ in time for some reason, so nearly each other frame is dropped. Add a fact that frame update is not synchronized to the engine diplay in any way, and here is your choppy video playback.

While I thing I'm going to play around with framerate of my video and try some kind of frame precaching, I would like to hear if anyone have some suggestions or maybe even tested solution to this issue.
#4
07/26/2011 (12:41 pm)
Rpahut,

I'm interested in hearing what you find on this. I have a placeholder video in my current project and I've been holding off on investigating further and considering taking it our all together.

If you'd like a copy of the video I'm using, let me know.

Patrick
#5
08/02/2011 (7:51 am)
Well. I can't say I have clean straightforward fix I could post here, but frame buffering really made playback significantly smoother, and just a bit faster maybe. There seems to be not much room to accelerate decoding itself, so I have my videos at lower resolution (720x408@16fps) now. Looks and plays just fine so far.


Basically, I've used modified FrameBuffer structure from theoraPlayer.h to create a cache for 16 frames, and rebuild playLoop() to run ahead of playback and keep filling it with frames. On rendering TheoraTexture just displays one of cached frames, one closest to current playback position. I've added no delay before playback starts, just playLoop sleep time changes depending on cache state.

I've also had to replace openal32.dll with newer version, the old one were causing some timing issues.
#6
09/07/2011 (8:50 am)
We're just now adding a video to play while teleporting from one place to another and it appears that with all settings on low it just crashes the game. I'll try a lower rez and see if that helps.