Shard Posted May 29, 2010 Share Posted May 29, 2010 I've been trying to integrate the LETheora library into my project and play the bunny video. It all complies fine and everything until I go to use the manager to create a clip when I get this error: Unhandled exception at 0x6bd8ae7a in Zero Hour.exe: 0xC0000005: Access violation reading location 0xcccccccc. //Media.h Media { TheoraVideoClip *clip; TheoraVideoManager *manager; float w; float h; float tw; float th; TBuffer testbuffer; TTexture testtexture; TMaterial testmaterial; }; //Media Init void Media::Initialize() { manager = new TheoraVideoManager(); } //Play Video void Media::PlayVideo(string &nonAbstractFileName) { nonAbstractFileName = "abstract::" + nonAbstractFileName; nonAbstractFileName = AbstractPath(str(nonAbstractFileName.c_str())); this->clip = manager->createVideoClip(nonAbstractFileName, TH_RGB, 0, 1); //<-----breaks here, note that the file name is perfectly fine and finds the video without a problem. this->clip->setAutoRestart(false); float w=clip->getWidth(),h=clip->getHeight(); float tw=nextPow2(w),th=nextPow2(h); testbuffer = CreateBuffer(tw,th,BUFFER_COLOR); testtexture = CreateTexture(tw,th,TEXTURE_RGB); testmaterial = LoadMaterial("abstract::video.mat"); TextureFilter(testtexture, TEXFILTER_PIXEL); SetMaterialTexture(testmaterial, testtexture); .... } The error seems to occur when I go into the CreateClip function. Can anyone make a guess as to whats going on? Do I need to upload a copy of a simple version of this for you to test out? (It'll take a little bit but it can be done) Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Shard Posted May 29, 2010 Author Share Posted May 29, 2010 Attached is the project file. Please note that this includes my solution files so you may have to relink the engine/leo cpp files depending on your directory structure. Edit: It seems I forgot to include the shader.pak and the video.mat files. Please toss this in. My apologies. (These are included in the project, just forgot to import them into the upload) Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Shard Posted May 31, 2010 Author Share Posted May 31, 2010 T_T Anyone? Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
flachdrache Posted June 1, 2010 Share Posted June 1, 2010 Hmmm, guess i had better luck with it - it only crashed once at me while the lua script couldnt find the surface i was pointing to iirc. I dont have it right here atm and cant test - you do used the TV model to test, right ? here is the content of my video.mat blend=0 depthmask=1 depthtest=1 overlay=0 zsort=0 cullface=1 castshadows=1 specular=1.00000000 bumpscale=1.00000000 gloss=0.500000000 shader="abstract::mesh_diffuse.vert","abstract::mesh_video.frag" shadowshader="abstract::mesh_shadow.vert","" hth Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
Shard Posted June 1, 2010 Author Share Posted June 1, 2010 Hmmm, guess i had better luck with it - it only crashed once at me while the lua script couldnt find the surface i was pointing to iirc. I dont have it right here atm and cant test - you do used the TV model to test, right ? here is the content of my video.mat blend=0 depthmask=1 depthtest=1 overlay=0 zsort=0 cullface=1 castshadows=1 specular=1.00000000 bumpscale=1.00000000 gloss=0.500000000 shader="abstract::mesh_diffuse.vert","abstract::mesh_video.frag" shadowshader="abstract::mesh_shadow.vert","" hth No I'm doing it in C++, so I'm actually drawing the texture to the screen, because I don't paint anything with it. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
flachdrache Posted June 1, 2010 Share Posted June 1, 2010 You need to quote that little bit of a hint. Anyways, thats the point - if you render to a custom buffer why the call ... another thing is that you pass the video file before you init your "TheoraVideoManager" iirc. (is this correct?) Dont have the source here at work but its giving me a badPointer on "customBuffer". Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
paramecij Posted June 1, 2010 Share Posted June 1, 2010 Couple of things that came to mind: - try a release build instead of debug (you linked to non debug libs..) - in main.cpp first call media::initialize() and then media::playvideo("bunny.ogg") - comment out the first two lines in playvideo() method, if you're calling playvideo("bunny.ogg"), and execute from the same dir as the dll and video file (just to be sure it's not a path problem) Quote Link to comment Share on other sites More sharing options...
Shard Posted June 2, 2010 Author Share Posted June 2, 2010 Couple of things that came to mind: - try a release build instead of debug (you linked to non debug libs..) - in main.cpp first call media::initialize() and then media::playvideo("bunny.ogg") - comment out the first two lines in playvideo() method, if you're calling playvideo("bunny.ogg"), and execute from the same dir as the dll and video file (just to be sure it's not a path problem) 1) Didn't work, got this message Windows has triggered a breakpoint in Zero Hour.exe. This may be due to a corruption of the heap, which indicates a bug in Zero Hour.exe or any of the DLLs it has loaded. This may also be due to the user pressing F12 while Zero Hour.exe has focus. The output window may have more diagnostic information. 2) I have been doing that 3) Have been doing that. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
paramecij Posted June 2, 2010 Share Posted June 2, 2010 I've made you a very minimal & basic example of playing ogg video with sound.. just 2 things to keep in mind: - it's meant for 2d fullframe video playback (if you want on 3d surfaces, just create a material and paint the mesh) - video must be pow2 friendly (i see you already have some code to remedy this) Quote Link to comment Share on other sites More sharing options...
Shard Posted June 2, 2010 Author Share Posted June 2, 2010 I've made you a very minimal & basic example of playing ogg video with sound.. just 2 things to keep in mind: - it's meant for 2d fullframe video playback (if you want on 3d surfaces, just create a material and paint the mesh) - video must be pow2 friendly (i see you already have some code to remedy this) You sir are a savior. Thank you very much for this. I'll be able to figure out the missing components from this. I think you should upload this to the downloads section, right next to LETheora so people who have questions in the future can look at this. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Shard Posted June 2, 2010 Author Share Posted June 2, 2010 So it seems that I've found a problem. Your code works perfectly fine in VS2008 but crashes at the same location in VS2010. Do you know what might be causing this? Would this have something to do with some configuration? Can you test it in VS2010? I can't really revert to 2008 as it would be a lot of trouble so if you would know what would solve this, I would be even more grateful. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Laurens Posted June 2, 2010 Share Posted June 2, 2010 You can try compiling your project with VS2008 from VS2010. Open up your project settings and go to "General". Then set the "Platform Toolset" to "vs90". You will need to have VS2008 (express will be fine) installed. Cheers! Quote Link to comment Share on other sites More sharing options...
Shard Posted June 2, 2010 Author Share Posted June 2, 2010 You can try compiling your project with VS2008 from VS2010. Open up your project settings and go to "General". Then set the "Platform Toolset" to "vs90". You will need to have VS2008 (express will be fine) installed. Cheers! You sir have just done magic! Or Science. Take your pick It work marvelously now. Now on to the question of how one converts an avi into ogg. Any idea? How do you guys do it? I have been unable to find a converter that converts an ogg with video. They all do audio. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
paramecij Posted June 2, 2010 Share Posted June 2, 2010 I use erightsoft SUPER and it works great for me (with audio) .. Best of luck with your deadline Quote Link to comment Share on other sites More sharing options...
Shard Posted June 3, 2010 Author Share Posted June 3, 2010 I use erightsoft SUPER and it works great for me (with audio) .. What settings do you use for it? I've included screencaps of my default settings. The second screencap is the video not running in your code and the last screen cap is the video running in VLC player. Best of luck with your deadline Thank you. Please be sure to sign up for the beta if you haven't at http://3rdinitiative.com/system/ Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
flachdrache Posted June 3, 2010 Share Posted June 3, 2010 Its not completely testet but i would stay HD (also for audio) - since my older compressed clips are simply refusing to work. In Niosop´s post is some bit for "preventing spikes" which did it for one of them "samples". However, others are crashing because of sound or strange pixel size "width/height" like 533x387. thx for your openAL addon paramecij. Can we "stream" that to use Le`s audio functions ?! Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
paramecij Posted June 3, 2010 Share Posted June 3, 2010 What settings do you use for it? I've included screencaps of my default settings. The second screencap is the video not running in your code and the last screen cap is the video running in VLC player. I basically use the same settings, .. you'll have to create a power of 2 texture (you already used niosop's code for that in your example) and the code to prevent 'spikes' .. Can we "stream" that to use Le`s audio functions ?! I don't see a way for that Quote Link to comment Share on other sites More sharing options...
Shard Posted June 4, 2010 Author Share Posted June 4, 2010 I basically use the same settings, .. you'll have to create a power of 2 texture (you already used niosop's code for that in your example) and the code to prevent 'spikes' .. Thanks for that. The video is showing now, but there is no sound. What do I do about that? The sound works fine in VLC. Heres the code: // ==================================================================== // This file was generated by Leadwerks C++/LEO/BlitzMax Project Wizard // Written by Rimfrost Software // http://www.rimfrost.com // ==================================================================== #pragma comment(lib,"libtheoraplayer.lib") #pragma comment(lib,"opengl32.lib") #pragma comment(lib,"openal32.lib") #include <windows.h> #include "engine.h" #include <gl/gl.h> #include "TheoraVideoManager.h" #include "TheoraVideoFrame.h" #include "OpenAL_AudioInterface.h" int nextPow2(int x) { int y; for (y=1;y<x;y*=2); return y; } int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) { Initialize() ; SetAppTitle( "hello_video" ) ; Graphics( 1024, 600 ) ; TWorld world; TBuffer gbuffer; TCamera camera; world = CreateWorld() ; gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL); camera=CreateCamera(); // THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP // THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP // THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP // THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP TheoraVideoManager *mgr = new TheoraVideoManager(); OpenAL_AudioInterfaceFactory *iface_factory=new OpenAL_AudioInterfaceFactory(); mgr->setAudioInterfaceFactory(iface_factory); mgr->setDefaultNumPrecachedFrames(32); //TheoraVideoClip *clip = mgr->createVideoClip( "bunny.ogg",TH_RGB,0,1); TheoraVideoClip *clip = mgr->createVideoClip( "bunny.ogg",TH_RGB,0,1); clip->setAutoRestart(1); float w=clip->getWidth(); float h=clip->getHeight(); float tw = nextPow2(w),th=nextPow2(h); TTexture videotexture = CreateTexture( tw, th, TEXTURE_RGB ); // THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP // THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP unsigned long time=GetTickCount(); unsigned long t=time; // Game loop while( !KeyHit() && !AppTerminate() ) { if( !AppSuspended() ) // We are not in focus! { // THEORA CODE UPDATE TEXTURE // THEORA CODE UPDATE TEXTURE TheoraVideoFrame *f = clip->getNextFrame(); if(f) { BindTexture(videotexture); glTexImage2D( GL_TEXTURE_2D,0, GL_RGB, w-1, h-1, 0, GL_RGB, GL_UNSIGNED_BYTE, f->getBuffer() ); clip->popFrame(); } //mgr->update(AppSpeed()); // THEORA CODE UPDATE TEXTURE t=GetTickCount(); float diff=(t-time)/1000.0f; if (diff > 0.25f) diff=0.05f; // prevent spikes (usually happen on app load) mgr->update(diff); time=t; // Update timing and world UpdateAppTime(); UpdateWorld(AppSpeed()) ; // Render SetBuffer(gbuffer); RenderWorld(); SetBuffer(BackBuffer()); RenderLights(gbuffer); // THEORA "PLAYBACK" // THEORA "PLAYBACK" DrawImage(videotexture,0,0,GraphicsWidth(),GraphicsHeight() ); // Send to screen Flip(0) ; } } // Done return Terminate() ; } Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
paramecij Posted June 4, 2010 Share Posted June 4, 2010 Hmm sound works for me - in bunny.ogg and my own transcoded file, don't know if this will help but I attached a screenshot from the settings I used in SUPER Quote Link to comment Share on other sites More sharing options...
Shard Posted June 4, 2010 Author Share Posted June 4, 2010 Hmm sound works for me - in bunny.ogg and my own transcoded file, don't know if this will help but I attached a screenshot from the settings I used in SUPER Thanks, changing the bitrate to 128 fixed the problem but created a new one. (of course >,>) The audio files we have play at 96kbps so when the this->iface_factory = new OpenAL_AudioInterfaceFactory(); is set it plays the audio files faster to compensate for the speed. Is there some way to set the playback speed of video files? The other options for me would be to increase the audio files to 128 or set and unset the iface every time I play and finish a video. Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
flachdrache Posted June 4, 2010 Share Posted June 4, 2010 hmmm, i just use "ffmpeg2theora-0.25.exe" since super comes with a "non-commericial" license (just for the gui) with following settings, no issues so far ffmpeg2theora-0.25.exe --noaudio trailer.ogg ffmpeg2theora-0.25.exe -v9 -x960 -y720 -a2 -A80 -H44100 trailer.ogg ffmpeg2theora-0.25.exe -x960 -y720 -A80 -H44100 HountedHill.flv resampling audio seams to be very expensive, so if one has to -a1 (the default) should be better. -A80 is for Kbps but calling the exe under "cmd" shows the possible switches - there is also a "sync" switch. Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
Shard Posted June 5, 2010 Author Share Posted June 5, 2010 So it seems that something is wrong with my Media class because I can play the video when I put your code into my main and run it but when I try to run it through my media class, it always crashes at the same location, the CreateClip function T_T Please take a look at my media class and tell me what I'm doing wrong with it. // Header File #pragma once #pragma comment(lib,"libtheoraplayer.lib") #pragma comment(lib,"opengl32.lib") #pragma comment(lib,"openal32.lib") #include "Include.h" #include <windows.h> #include "engine.h" #include <gl/gl.h> #include "TheoraVideoManager.h" #include "TheoraVideoFrame.h" #include "OpenAL_AudioInterface.h" class Media { private: int nextPow2(int x); TheoraVideoClip *clip; TheoraVideoManager *manager; OpenAL_AudioInterfaceFactory *iface_factory; float w; float h; float tw; float th; TBuffer testbuffer; TTexture testtexture; TMaterial testmaterial; public: bool eax; Framework *frameWork; Media(); void PlaySoundFile(string &nonAbstractFileName, bool loop = false, float volume = 10); void PlaySoundFile(TSound &sound, float volume = 10, bool loop = false); void PlaySoundSource(TSource &source, float volume = 10, bool loop = false); TSource LoadSoundFile(string fileName); void PlayVideo(string &nonAbstractFileName, bool autoRestart = false, bool skippable = true); void PlayVideo(TheoraVideoClip *clip, bool skippable = true); TheoraVideoClip* LoadVideo(string &fileName, bool autoRestart = false); void Update(); void Initialize(); }; //CPP #include "Media.h" Media::Media() { clip = NULL; manager = NULL; } void Media::PlaySoundFile(string &nonAbstractFileName, bool loop, float volume) { nonAbstractFileName = "abstract::" + nonAbstractFileName; TSound sound = LoadSound(str(nonAbstractFileName.c_str())); PlaySoundFile(sound,loop,volume); } void Media::PlayVideo(string &nonAbstractFileName, bool autoRestart, bool skippable) { nonAbstractFileName = "abstract::" + nonAbstractFileName; nonAbstractFileName = AbstractPath(str(nonAbstractFileName.c_str())); this->clip = LoadVideo(nonAbstractFileName,autoRestart); PlayVideo(this->clip,skippable); } TheoraVideoClip* Media::LoadVideo(string &fileName, bool autoRestart) { TheoraVideoClip *clip = manager->createVideoClip(fileName, TH_RGB, 0, 1); clip->setAutoRestart(autoRestart); return clip; } void Media::PlayVideo(TheoraVideoClip *clip, bool skippable) { float w = clip->getWidth(); float h = clip->getHeight(); float tw = nextPow2(w); float th = nextPow2(h); TTexture videotexture = CreateTexture( tw, th, TEXTURE_RGB ); TheoraVideoFrame* f = clip->getNextFrame(); unsigned long time = GetTickCount(); unsigned long t = time; bool exitVideo = true; while(f || exitVideo == true) { TheoraVideoFrame *f = clip->getNextFrame(); if(f) { BindTexture(videotexture); glTexImage2D( GL_TEXTURE_2D,0, GL_RGB, w-1, h-1, 0, GL_RGB, GL_UNSIGNED_BYTE, f->getBuffer() ); clip->popFrame(); } t=GetTickCount(); float diff=(t-time)/1000.0f; if (diff > 0.25f) diff=0.05f; // prevent spikes (usually happen on app load) manager->update(diff); time=t; // Update timing and world UpdateAppTime(); UpdateWorld(AppSpeed()) ; // Render frameWork->Update(); frameWork->Render(); DrawImage(videotexture,0,0,GraphicsWidth(),GraphicsHeight() ); // Send to screen Flip(0) ; } } void Media::PlaySoundFile(TSound &sound, float volume, bool loop) { TSource source; if(!loop) source = CreateSource(sound); else source = CreateSource(sound,SOURCE_LOOP); PlaySoundSource(source); } void Media::PlaySoundSource(TSource &source, float volume, bool loop) { volume = Clamp(volume,0,10); PlaySource(source); SetSourceVolume(source,volume); FreeSource(source); } TSource Media::LoadSoundFile(string fileName) { fileName = "abstract::" + fileName; TSound sound = LoadSound(str(fileName.c_str())); TSource source = CreateSource(sound); return source; } void Media::Update() { } int Media::nextPow2(int x) { int y; for (y=1;y<x;y*=2); return y; } void Media::Initialize() { manager = new TheoraVideoManager(); this->iface_factory = new OpenAL_AudioInterfaceFactory(); manager->setAudioInterfaceFactory(iface_factory); manager->setDefaultNumPrecachedFrames(32); } //Usage Media *media = new Media; media->Initialize(); media->frameWork = [frameWork Reference]; string vid = "bunny.ogg"; media->PlayVideo(vid); //This Works Fine // ==================================================================== // This file was generated by Leadwerks C++/LEO/BlitzMax Project Wizard // Written by Rimfrost Software // http://www.rimfrost.com // ==================================================================== #pragma comment(lib,"libtheoraplayer.lib") #pragma comment(lib,"opengl32.lib") #pragma comment(lib,"openal32.lib") #include <windows.h> #include "engine.h" #include <gl/gl.h> #include "TheoraVideoManager.h" #include "TheoraVideoFrame.h" #include "OpenAL_AudioInterface.h" int nextPow2(int x) { int y; for (y=1;y<x;y*=2); return y; } int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) { Initialize() ; SetAppTitle( "hello_video" ) ; Graphics( 1024, 600 ) ; TWorld world; TBuffer gbuffer; TCamera camera; world = CreateWorld() ; gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL); camera=CreateCamera(); // THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP // THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP // THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP // THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP TheoraVideoManager *mgr = new TheoraVideoManager(); OpenAL_AudioInterfaceFactory *iface_factory=new OpenAL_AudioInterfaceFactory(); mgr->setAudioInterfaceFactory(iface_factory); mgr->setDefaultNumPrecachedFrames(32); //TheoraVideoClip *clip = mgr->createVideoClip( "bunny.ogg",TH_RGB,0,1); TheoraVideoClip *clip = mgr->createVideoClip( "bunny.ogg",TH_RGB,0,1); clip->setAutoRestart(1); float w = clip->getWidth(); float h = clip->getHeight(); float tw = nextPow2(w); float th = nextPow2(h); TTexture videotexture = CreateTexture( tw, th, TEXTURE_RGB ); // THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP // THEORA SETUP THEORA SETUP THEORA SETUP THEORA SETUP unsigned long time=GetTickCount(); unsigned long t=time; // Game loop while( !KeyHit() && !AppTerminate() ) { if( !AppSuspended() ) // We are not in focus! { // THEORA CODE UPDATE TEXTURE // THEORA CODE UPDATE TEXTURE TheoraVideoFrame *f = clip->getNextFrame(); if(f) { BindTexture(videotexture); glTexImage2D( GL_TEXTURE_2D,0, GL_RGB, w-1, h-1, 0, GL_RGB, GL_UNSIGNED_BYTE, f->getBuffer() ); clip->popFrame(); } //mgr->update(AppSpeed()); // THEORA CODE UPDATE TEXTURE t=GetTickCount(); float diff=(t-time)/1000.0f; if (diff > 0.25f) diff=0.05f; // prevent spikes (usually happen on app load) mgr->update(diff); time=t; // Update timing and world UpdateAppTime(); UpdateWorld(AppSpeed()) ; // Render SetBuffer(gbuffer); RenderWorld(); SetBuffer(BackBuffer()); RenderLights(gbuffer); // THEORA "PLAYBACK" // THEORA "PLAYBACK" DrawImage(videotexture,0,0,GraphicsWidth(),GraphicsHeight() ); // Send to screen Flip(0) ; } } // Done return Terminate() ; } Why isn't it working D:< Edit: The release version doesn't run at all if the Initialize function is allowed to happen. But I think this occurs in VS2010 and works fine in 2008 but the results are not consistent. Anyone know how to remedy this? Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Gilmer Posted January 26, 2012 Share Posted January 26, 2012 Shard, did you figured out how to make it work? I'm having the same problem that you had. My application crashes at the createVideoClip too Does anyone else can help me with this? EDIT: Does anyone have the hello_video.rar saved? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.