Game Development Community

All about Video play in TGE

by prisonbreaker · in Torque Game Engine · 04/05/2009 (4:45 am) · 0 replies

Hi All
I have been working on AVI file play issue in TGE 1.3 windows for few days now. It's important that i make it work in 1.3 because most of my game is already in 1.3 and cannot be ported to other versions. I have done quite a research in Theora, AVI ,Direct X issues based on the various resources, forums available here and from google ofcourse. I would like to give it back to the community once I am fully done with this issue, so that this thread would serve as a reference for me and many others who face a similar problem in future.

Briefly I am putting down the various approaches/issues i have faced so far..

//Attempt 1- Theora ogg support- gave up//
1. Successfully ported ogg Theora support in 1.3, which is not available in raw engine. Build it successfully fixing all errors but in the end my ogg theora video could not be played. The result is
a. In window mode, the video plays but i can see only a white screen as long as video is playing. Game doesn't crash though.
b. In full screen mode, the video crashes saying ogg theora could not be rendered. More on it later.


//Attempt 2- AVI support in 1.4- video and sound files to play separately//
2. Shifted my focus on AVI files. Could play it successfully in 1.4 raw engine with minor changes to it. The video and audio files have to be played separately though. But I could apply the same in 1.3 as i had hell lot of work fixing compile issues. From my observation many files from 1.3 have been changed in 1.4 and the basic file structure has also been changed. So it takes quite a while to figure out the file structure, the classes and all. Gave up here to downgrade to 1.3


//Attempt 3- AVI support in 1.3- Currently Working//
3. From the guiAVIBitmapCtrl resources posted here, I could finally find a AVI support code for 1.3. Again i implemented that, fixing all compile/link issues (by this time i figured out all the file structure and libraries). This is the method where all my efforts are pinned on, and i am actively looking for completing this end-to-end, thereby post my observations here in forums. The problems i am facing now, for which i am seeking help/suggestions are

a. In window mode, the AVI file plays successfully with sound sync, but in full screen mode, game crashes. On debugging I found that, the 800*600 extent on which i am playing are not being passed to the destination rectangle on screen. On receiving garbage values, the calculations of Verts[0],Verts[1],Verts[2],Verts[3] are getting absurd values of screen. I am not sure how to go about this problem from here.

b. The AVI play simply hangs once the video is done. The video simply won't close. On further research, I even incorporated WM_GRAPHNOTIFY, EC_COMPLETE notification handlers in WndProc. On putting various break points, my logic of handling the GetEvent from IMediaEvent works but its only that EC_COMPLETE notification is never received and thus the video doesn't close. I suspected if anything is wrong with my AVI's but were not so because i verified those AVI's with a external graph tool which lists out all the events from being to end of AVI. EC_COMPLETE notfication is listed out once AVI is done .
I don't understand why the game simply won't post me the EC_COMPLETE notification while it sends all other events during video play. I am playing only one avi file , so there is no external input streams for the game to wait.

I would appreciate if anyone can direct me to finish my current working method. I just cannot give up on this method coming so close to success.

Thanks and Regards
-N-

About the author

Recent Threads