Edit: I am running python 2.7.6, on Ubuntu 14.04
Edit: My ultimate goal is to output a single movie file of the output of this script
I've read all the tutorials and stackoverflow question/answers I can find on this topic and can fairly easily play a single movie, or two movies back-to-back, using pygame (using some variation of the script found here. I cannot, however, figure out how to play two at the same time. My intention is to play a movie that I have created with a different script (from this question I asked before), underneath a film clip of the same duration, and to save this product as a new video.
I understand the best way to do this would probably be to both create the movie and play it in the same script, but I am new to Python and am looking for a quick solution until I figure out the better (but more complicated) solutions. So I am just looking to play two movies that are imported into a single script, stacked one above the other.
I have been able to do this with the toolbox psychopy, but the toolbox they use to output movies (pymedia) apparently isn't in use anymore. Here is the code I used for that, which does just what I want it to, but without the ability to output the video file:
from psychopy import visual, core, event
movie01 = '/home/pbwilliams/Documents/movie01.mpg'
movie02 = '/home/pbwilliams/Documents/movie02.mp4'
win = visual.Window([800,600])
mov1 = visual.MovieStim(win, movie01, size=[320,240],pos=[0, 100])
mov2 = visual.MovieStim(win, movie02, size=[320,120],pos=[0, -100],)
globalClock = core.Clock()
while globalClock.getTime()<(mov.duration+0.5):
mov1.draw()
mov2.draw()
win.update()
win.getMovieFrame()
win.saveMovieFrames('testmovie.mpg')
core.quit()
Any help would be greatly appreciated.
Patrick