Playing movie in texture

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
thespecial1
Posts: 135
Joined: Thu Oct 30, 2008 11:56 am
Location: UK
Contact:

Post by thespecial1 »

hi all

have continued the development of the ffmpeg version of the video player, will post a new version of the class once more features are sorted.

could anyone give me a pointer/hint on how to play the sound from the movie file,

and what the best method of outputting it in irrlicht would be as there seem to be a few choices thou cAudio seems to be pretty decent from my reading

thanx
Rob


** UPDATED
for anyone else playing with this and cursing the lack of docs on ffmpeg, check out http://dranger.com, very helpful, will do some research and post back what to do with the audio
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Hmm ... i don't think that using a specific audio lib for the sound output would be good, because there are so many out there and I prefer Irrklang. Maybe you could do something where the user has to derive a subclass that implements sound handling and the standard version does not play any sound (like a "NullOutputDevice ;) ).
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
thespecial1
Posts: 135
Joined: Thu Oct 30, 2008 11:56 am
Location: UK
Contact:

Post by thespecial1 »

Hmm also, my investigation continues, just getting into sound and will look into irrKlang next, is really pushing my knowledge digging into this but half the fun is the steep learning curve.

so far i have looked into SDL, there is a really good example that am pretty sure is partly how the ffmpeg wrapper was coded but whilst I have managed to re compile irrilicht with SDL support (before realising that the wrapper was for the video window) I cant do the same with my own program as am getting a conflict between SDL/mySQL which are both using a slightly different version of config_win.h.

ffmpeg sdl sound example here
http://dranger.com/ffmpeg/tutorial03.html

i have then looked into openAL (RAW, not the cAudio wrapper) which quite alot of people seem to be using and found a ffmpeg/openal example which looks pretty good here
http://kcat.strangesoft.net/alffmpeg.c

looking at irrKlang, which is actually using ffmpeg, as with the other two examples, seems to be based on a similar idea (only so many ways to do sound i guess), hmmmm indeed much as I like a choice

Hmm ... i don't think that using a specific audio lib for the sound output would be good, because there are so many out there and I prefer Irrklang. Maybe you could do something where the user has to derive a subclass that implements sound handling and the standard version does not play any sound (like a "NullOutputDevice Wink ).
one question thou, how is irrKlang any less of a specific audio lib than openAL, both are cross platform and have a similar (ish) feature set?? or are you suggesting that the videoplayer class should be independant of any specific sound library (which agreed would be nice but even more of a mind job)?

Since I am currently leaning towards openAL, if I coded the class for this with #define exclusions for the specific openAL code would you be willing to modify it to support irrKlang once I have the openAL version working?
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

I though about keeping it lib-independent, i.e. no binding to a particular audio lib. I don't know if it is an easy way to go to do so with your project, but I think it would open your code for a larger user base.

Or try to keep the bindings as small as possible (and good documented), so that it would be (relatively) easy to swap that lib.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
thespecial1
Posts: 135
Joined: Thu Oct 30, 2008 11:56 am
Location: UK
Contact:

Post by thespecial1 »

see what I can do, let me get a working version together and then we can see about using different bindings, will try to keep the bindings blocked together, and properly commented.
Eigen
Competition winner
Posts: 375
Joined: Fri Jan 27, 2006 2:01 pm
Location: Estonia
Contact:

Post by Eigen »

Thanks for working on this. I need this, and I know a lot of people who do as well. Keep it up!
thespecial1
Posts: 135
Joined: Thu Oct 30, 2008 11:56 am
Location: UK
Contact:

Post by thespecial1 »

a working version with sound can be found @ http://irrlicht.sourceforge.net/phpBB2/ ... 610#203610

;0)
briaj
Posts: 7
Joined: Mon Feb 22, 2010 3:33 pm
Location: ES

Post by briaj »

Hi all, I cannot compile because I don't have the include headers:

#include <dshow.h>
#include <mmstream.h>
#include <amstream.h>
#include <ddstream.h>

I have installed DX9SDK and I cannot find them. I am using Irrlicht 1.7. Is there any native way to play movies?

Thank you very much in advance.
dehseth
Posts: 130
Joined: Wed Dec 09, 2009 11:05 am
Contact:

Post by dehseth »

I have tried this code but I do not see video? Anybody knows why?
stlseven
Posts: 1
Joined: Mon May 31, 2010 2:43 am

Post by stlseven »

briaj wrote:Hi all, I cannot compile because I don't have the include headers:

#include <dshow.h>
#include <mmstream.h>
#include <amstream.h>
#include <ddstream.h>

I have installed DX9SDK and I cannot find them. I am using Irrlicht 1.7. Is there any native way to play movies?

Thank you very much in advance.
OK , the full path of the file in my os C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\mmstream.h,yeah ,certainly it's from windows sdk ,i think you may find it by that message.
my english is very pool ,sorry.
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Playing movie in texture

Post by robmar »

This worked really well, but now Microsoft have decided this interface is obsolete, and in Windows 7 there are problems playing mpeg2 movies now, possibly because of the codecs/win 7 issues. Back to square 1 thanks to MS! How to get fast mpeg2 video playback with hardware support for linux and windows??
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Playing movie in texture

Post by hendu »

A single lib for both? That'd be ffmpeg probably.
AndreaJens
Posts: 4
Joined: Mon May 23, 2016 10:48 pm

Re: Playing movie in texture

Post by AndreaJens »

Okay, I know this post is very old, but does the original version (page 1) still works with the latest irrlicht build?
I have tried to render a .wmv video to texture, but I always get a blank texture. I've used both the original method and the "rotating mesh with texture example". In both cases, the texture remains unpainted.
The video seems to be properly loaded, as I can see the stream being non-NULL and I can hear the audio play.
Any suggestions on how to fix this?

EDIT: It appears I have solved it. When i was drawing the texture, I was asking Irrlicht to use the alpha channel. Setting it NOT to use it solved my issue - now I can render the video properly. Thanks a lot for this amazing tool!
"Thorns are the rose's sweetest essence"
robmar
Posts: 1125
Joined: Sun Aug 14, 2011 11:30 pm

Re: Playing movie in texture

Post by robmar »

Yes, it should do as it just renders the video to a texture each frame. Make sure your texture resolution matches the video as depending on the video driver, that may stop it working.
Post Reply