History: TheoraVideoPlugin Player
Source of version: 3 (current)
Copy to clipboard
{IMG(src="img/wiki_up/TheoraVideoPlugin_SimpleDemo.jpg",thumb="y",rel="box",width="300",imalign="right",alt="thumb|screenshot from the demo")}{IMG}
This demo plays __media/oggs/clip.ogg__ (be sure to put one there before testing) and prints some benchmarking information.
!!!Legend
* __Frame number__ - the index of the currently displayed frame
* __Frames dropped__ - number of frames that couldn't be displayed to keep the video clip in sync
* __Video time__ - current time in seconds of the playing video
* __Decoding time__ - average time it took to decode the last frame,(in milliseconds)
* __YUV--RGB time__ - average time it took to decode YUV pixels to an RGB buffer
* __TexBlit time__ - average time it took to upload the current frame from RAM to the texture buffer on the display card
* __Time per frame__ - average number of milliseconds it takes to prepare one video frame
* __Max FPS__ - how many frames per second can be prepared (estimated)
* __Precached frames__ - how many frames are prepared in advance
!!!Code
The code is a modified and stripped down version of OGRE's CEGUI demo. It uses OGRE's sample framework headers.
The only demo relevant code is located in the ''ClipListener'' class and ''frameStarted()'' function.
* The demo loads __clip.ogg__ located in one of the resource locations.
!!!Material
* located in __demos/media/materials/scripts/Example.material__
{CODE(wrap="1",colors="cpp",wiki="1")}material SimpleVideo
{
technique
{
pass
{
cull_software none
cull_hardware none
lighting off
texture_unit
{
'''texture_source ogg_video'''
{
'''filename clip.ogg'''
'''precache 50'''
'''play_mode play'''
}
}
}
}
}{CODE}
As you can see, displaying a video in OGRE is as simple as putting a few lines in the material file.
See ((TheoraVideoPlugin Materials|Material documentation)) for explanations of these parameters.