Playing Quicktime Files in Pd

12 04 2007

I’m doing a bit of video work for J.C. Combs’ final percussion ensemble concert. He’s created a tribute to Harry Partch, one of the most prominent microtonal composers. Partch was a renegade free-thinker who broke the bonds of Western tonality and equal temperament (the common tuning practice of the West) by creating a unique 43-note scale and an array of original instruments. My task is to play some video clips from a Harry Partch documentary along with editing and a few other tasks. All the clips were preprocessed so by the time Pd is involved, it doesn’t have to do any stressful video work.

I’m used to using PDP and PiDiP, two Pd externals that are fairly decent at image-based processing of live video. They’re not so great with pre-recorded video. I may have just mentioned this in a previous blog post, but allow me to repeat how annoying it is that the software designers decided to only support some obscure Quicktime codec that is now long gone. PDP supports .avi, if I remember correctly. Huh. That’s funny. .avi is a Windows format, but PDP isn’t even ported to Windows. Who came up with that great idea?

Fortunately, GEM (Graphics Environment for Multimedia) is a much better Pd external complete with a little documentation and some tutorials. Building a video player was mostly a matter of looking through the help files, reading a couple tutorials, and putting it all together.

The first step is to download Pd-Extended. It’s got all the major Pd externals included. I’ve included my patch below, although you might as well just go through some of the help files to make your own.

As you can see from the Pd code below, everything is straightforward. The [gemwin] object creates the window and accepts a number of messages including dimensions, border on/off, cursor on/off, and rendering on/off. Make sure you send dimension and border messages before creating the window. It’s easiest to stop rendering while you’re not actively watching a video. I didn’t run into CPU problems, but you never know.

picture-2.png

The [pix_film] object played my QT files without and problems. Just send it a message with the file name and path. You can go frame-by-frame, auto-play, and see the total number of frames in the movie. I added a gain control [pix_gain] so that I can do nice smooth fades. Finally, you supply the dimensions of the video output. It’s a little confusing because you create the GEM window, but then you also have to specify the size of the video output within the GEM window. It would be nice if GEM automatically scaled the window so that you could use an object like [rectangle 4 3] and it would keep the same aspect ratio without you having to figure out a size that’s close.

There are a few objects left over, so just ignore those. I should have just deleted them. I found GEM video playback to be very high quality, but easy on the processor. I recommend it for anyone wanting to play video in Pd.


Actions

Informations

Leave a comment

You can use these tags : <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>