video texture rendering
Hi, i currently try to do the video texture. From my research i get the code some like below :
video = Video.FromFile(path + "\\Japan.avi");//videoTexPath
video.TextureReadyToRender += new TextureRenderEventHandler(onTextureReadyToRender);
video.RenderToTexture(device);
video.Play();
However i had a error at video.RenderToTexture(device).
May i know what problem on here?
Thank you for reply..thanks...
It would may help if you give us more information. Eg, what is that "video" object? What is that RenderToTexture function?
When we do cube texture mapping. The texture normally is image by using the code
Texture t = TextureLoader.FromFile(device, @path + "\\" + image);
How about to do video texture means the texture is video.
I had try this code below but few to run it.
Video video = Video.FromFile(path + "\\Japan.avi");//videoTexPath
video.TextureReadyToRender += new TextureRenderEventHandler(onTextureReadyToRender);
video.RenderToTexture(device);
video.Play();
when i debug until video.RenderToTexture(device), it return error string VFW_E_CANNOT_CONNECT.
May i know how to solve it?
Texture t = TextureLoader.FromFile(device, @path + "\\" + image);
How about to do video texture means the texture is video.
I had try this code below but few to run it.
Video video = Video.FromFile(path + "\\Japan.avi");//videoTexPath
video.TextureReadyToRender += new TextureRenderEventHandler(onTextureReadyToRender);
video.RenderToTexture(device);
video.Play();
when i debug until video.RenderToTexture(device), it return error string VFW_E_CANNOT_CONNECT.
May i know how to solve it?
It's an old MDX remnant and unfortunately it never did work quite properly, at least I didn't get it working all too well. I recently tried to salvage the Audio part of that library (which was always rumored to leak memory) and found that it does have some security vulnerabilities at least. I'd personally try to avoid the entire AudioVideoPlayback assembly if that's an option.
If you're up for it, it's probably the best idea to extract the AVI data (using this for example) and stick it into a texture yourself. That way you'll have more control over the rendering and can avoid common pitfalls with updating the texture data. If you're working with small AVI files for simple animated textures, it might be worth considering to use a volume texture for it. I also found this movieplayer project that seems to have gotten AudioVideoPlayback working, so if you want to stick with that it might be worth a peek.
Regarding your original error, VFW_E_CANNOT_CONNECT apparently means No combination of intermediate filters could be found to make the connection (according to this), which doesn't help much. Are you sure the path to the file is correct and your program is allowed to read the file?
Thanks for your suggestion. I will go through all the example there. However, how i make the video as texture?
Thanks..
Thanks..
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement