def CreateDumbMovieObjectOnEachTile(filename, pos): # for debugging r = PyFfmpegMovieReader() r.setFile("/home/eolson/blah_mpeg1.mpg") r.loadFile() moviePlayer = GLMoviePlayer(origWidth=r.getSize()[0], origHeight=r.getSize()[1]) moviePlayer.setVideoSource(r) moviePlayer.setPos(pos[0], pos[1]) r.start() return moviePlayer
# Note: Example to encode an mpeg1 file readable by pygame.Movie: # mencoder original.avi -of mpeg -mpegopts format=mpeg1:tsaf:muxrate=2000 -o test.mpg -srate 44100 -af lavcresample=44100 -oac twolame -twolameopts br=160 -ovc lavc -lavcopts vcodec=mpeg1video:vbitrate=1152:keyint=15:mbd=2 # Setup window, etc. windowWidth = 1000 # 320 windowHeight = 700 # 280 app = App(windowWidth, windowHeight) renderer = glRenderer2D() app.setRenderer(renderer) app.initialize() renderer.init(windowWidth, windowHeight) glEnable(GL_TEXTURE_2D) r.loadFile() p = GLMoviePlayer(origWidth=r.getSize()[0], origHeight=r.getSize()[1]) #p.setPos(50, 200) p.setPos(50, 0) #p.setPos(50, -50) p.setVideoSource(r) r.start() app.addDynamicObject(p) #app.addDynamicObject(r, addToRenderer=False) app.drawBounds = 0 app.run()
# mencoder original.avi -of mpeg -mpegopts format=mpeg1:tsaf:muxrate=2000 -o test.mpg -srate 44100 -af lavcresample=44100 -oac twolame -twolameopts br=160 -ovc lavc -lavcopts vcodec=mpeg1video:vbitrate=1152:keyint=15:mbd=2 # Setup window, etc. windowWidth = 1000 # 320 windowHeight = 700 # 280 app = App(windowWidth, windowHeight) renderer = glRenderer2D() app.setRenderer(renderer) app.initialize() renderer.init(windowWidth, windowHeight) glEnable(GL_TEXTURE_2D) r.loadFile() p = GLMoviePlayer(origWidth=r.getSize()[0], origHeight=r.getSize()[1]) #p.setPos(50, 200) p.setPos(50, 0) #p.setPos(50, -50) p.setVideoSource(r) r.start() app.addDynamicObject(p) #app.addDynamicObject(r, addToRenderer=False) # p.setTextureScale((0.5, 0.5)) # would work # p.setDstRectScale((0.5, 0.5)) # also would work app.addDynamicObject(MovieScaler(p), addToRenderer=False) app.drawBounds = 0