movie texture.

Hello everyone.

I follow a manual names " Playing MPG and AVI files ".
And I tried a code, showing a movie on the screen.

def createMovieScreen(movieName, screenWidth, loop=1):
    print 'MOVIE :',movieName
    movieTex=loader.loadTexture(movieName)
    if not loop:
       movieTex.play()
    movScale=movieTex.getTexScale()
    actualSize=(movieTex.getXSize()*movScale[0], movieTex.getYSize()*movScale[1])
    texRatio=actualSize[0]/actualSize[1]
    screenWidth*=.5
    screenHeight=screenWidth/texRatio
    print '  -> Actual size : %i x %i' %(actualSize[0],actualSize[1])

    CM=CardMaker('movie screen')
    CM.setFrame(-screenWidth, screenWidth, -screenHeight, screenHeight)
    card=NodePath(CM.generate())
    ts = TextureStage.getDefault()
    card.setTexture(ts,movieTex)
    card.setTexScale(ts,movScale)

    return card

I used .avi file , size = 1024 * 1024
And the result of the movie was bad.
(It wasn’t good as played in media player program.)

Is it has another limit of loading avi file in Panda3d I am missing?
Any idea?

1024x1024 is quite huge. last time i tried video textures i put a note on myslef not to use high-res videos due to slow playback. nice that time it looks like some things related to movieplayback in panda where changed. but i dont know if it fixed the performance as well.

Is there another way to play .avi
on the screen instead of map it to texture?

Thank you.

no map to texture is the best solution. It just need to be optimized better i guess.

There is an alternative way using OpenAL. Not exactly sure if thats already implemented in a milestone release (aka x.y.z)

Forum Thread is here: discourse.panda3d.org/viewtopic.php?t=3022

Regards, Bigfoot29

OpenAL has been there since Panda3D 1.4.1, though on windows only.

it worked on linux i know but the openAL support on linux is messed up. And you cant ply movie with open AL just the sound. You will need free ogg library for that.