Theora playback problem

okasugandi

20-03-2010 15:59:45

Hi Kreso, I would like to ask a view question, thank you before for your help :)

I have succeeded playing Theora movie to Ogre Texture and then painted to CEGUI window, but I confused a view point: Can the size of texture is same as size of movie?
I saw your implementation of Theora plugin, it makes Ogre Texture's size of the stride (next power 2) of movie's size. The movie is playing well but there is a thick white border at the right of movie.
I have tried to get rid of the border but until now, I have not yet succeeded. I have tried to not using stride in creating the movie, but failed (the movie is blurred). I have tried to not memcpy a whole data, but I iterate it in height and just copy the size of destination's width, it also failed. I also confused about the output type of theora. the theora output is: TH_BGRA, but how come the texture input is XRGB? I have tried to change the theora output into TH_ARGB but the movie is become blue.

I also have a problem playing the audio. I am using OgreOgg to play all the sound in my application, can both library interact so the OgreOgg can play movie's sound? I have posted this question also in OgreOgg forum, this is the link viewtopic.php?f=19&t=12299. Am I explaining the right thing at that post?

Thank you very much Kreso for your help.

Kreso

21-03-2010 13:54:28

1) No, most graphics hardware require that the texture sizes be a power of two. some hardware allows any sizes but we can't rely on that as most software will run on a wide variety of graphics card.
This has been solved in OgreVideo plugin by blitting the video frame to the upper left area of the texture and then adjusting the texture matrix of the given material to trim to the frame area.
I'm not sure why you're seeing a border, which svn revision are you using?

2) yeah, I'm confused about that as well, but it seems that the only way I get proper colors is if I use a XRGB texture and BGRA theora format. it could be a byte order thing in Ogre, I can't tell.

3) the audio interface was designed to be abstract, meaning you can use any sound engine you want. in libtheoraplayer there is a demo that outputs audio via OpenAL (I havent ported it to OgreVideo yet). If OgreOggSound uses OpenAL, you could use that. If not, all you need is to suplly the sound engin with PCM data that the library gives you and play it;

okasugandi

23-03-2010 02:32:04

Thanks for your help Kreso,

1) I saw your adjustment of texture size is in Material. But as far as I know, CEGUI cannot accept a material to be rendered onto its GUI. The input must be an OgreTexture. So, I'm discarding the adjustment code, I only have the Texture, and the Texture sent to CEGUI. And now I'm having the white border in CEGUI. Do you have any idea how to solve this?
2) Yeah I suppose its about the byte order too...
3) Thanks for your response in OgreOgg's Thread, I will implement the sample (OpenAL_AudioInterface) side by side with OgreOgg then.

A new question:
4) Is there a quick way that my program will know when the Movie has ended? A listener perhaps that be called when a Movie has ended? My implementation right now is every frame I checked the isDone().

Kreso

23-03-2010 07:53:22

1) oh yeah, i forgot about cegui. You can simply create a Cegui Image object that trims to the frame size and use that.
3) cool, let me know how it works out :)
4) you can use clip->isDone(). but yeah, a listener would be a good idea. can you please add a feature request on libtheoraplayer's sourceforge tracker;

okasugandi

25-03-2010 15:07:20

1) Cool I forgot that CEGUI is capable to trim the image, and it was very easy to do! My problem's solved!
3) It worked out very well, I just use the OpenAL_AudioInterface, deleting some AL initiation and de-initiantion in the Factory, and voila! everything's great!
4) Well, I can't find a way to post to the tracker. Could you show me the link? Should I have a user id first at Sourceforge?

Thank you very much Kreso, you have done a very good job.

Kreso

25-03-2010 15:57:49

thanks, glad you like it :)

i'm not sure if you need a sourceforge account to post to the tracker, the link is here: http://sourceforge.net/tracker/?group_i ... id=1217326

I'll release RC2 soon, and work more on the ogrevideo integration as soon as I find some free time, can't wait! :)

okasugandi

16-04-2010 08:16:20

Hi again Kreso,
I have a bit problem again regarding Theora,
My final executable which plays Theora Movie at the beginning, runs very well on Vista/Windows 7, but it won't run on Windows XP. The problem comes from the video and audio, the video is totally blank, and the audio (implemented the audio interface) is seg fault in this line of code:

// process played buffers
alGetSourcei(mSource,AL_BUFFERS_PROCESSED,&nProcessed);
for (i=0;i<nProcessed;i++)
{
buff=mBufferQueue.front(); //// <----- seg fault, because the mBufferQueue.size() == 0.
mBufferQueue.pop();
mNumPlayedSamples+=buff.nSamples;
alSourceUnqueueBuffers(mSource,1,&buff.id);
alDeleteBuffers(1,&buff.id);
}


It's weird, I have tried to install a fresh genuine Windows XP SP3 and OpenAL, and the problem persists. Does Theora need to install a codec maybe? Thanks for the help Kreso.

Kreso

18-04-2010 11:36:41

whoah, weird. I had that bug before but couldn't figure it out :/ can you send me the video file you're using at kreso<! ET !>cateia<_dot__>com

btw, what happens when you disable audio? does the video play fine?

okasugandi

18-04-2010 15:27:17

I think the error is not in the video file, because all the video from the bundle (like the KDE's Konqi video) resulted the same error.

The video is blank regardless the audio is enabled or disabled :? ... I thought the Theora has it's own codec (hard coded) so it does not depend on some external codec installed - although I have tried to install the all the codec available in the internet :? ...

Kreso

18-04-2010 15:41:27

I see, that's weird. it all seems to work fine on my XP :/ can you give me some more details?

as for theora codec, it's located in libtheora.dll, so noope, you don't need to install any additional codecs ;)