Sunday, May 13, 2012

SimpleVideoMixer

I have uploaded my first Processing sketch over at OpenProcessing.org.  It is a 2-channel video mixer with MIDI control, built on lessons learned from Joseph Gray's Processing  / Arduino video mixer tutorial.

-Place your video files in the "data/videos/" folder.

-Create a list of the video file names as a simple text file named "videoFileList.txt" and place it in the same "data/videos/" folder.

-Hold down the spacebar to record your mix.


I would like to build a full-featured VJ mixer for live performances, mixing video and audio-reactive Processing sketches.  The only problem is that Processing's video library does not allow for continuous looping of video clips at anything other than normal speed.  I had to use a convoluted bit of code to pause each frame of the video and re-sequence them at the speed and in the direction I want.  This all runs quite slowly and, at lower playback speeds, there is a "hiccup" that happens on my laptop.  It looks like the video actually plays a few frames before the pause and next jump, causing the sequence to stutter.

The Processing programming language is in the midst of an extensive update and I mentioned this problem to the creator of the GSVideo library that is being integrated into the code's core package.  He says that he has found a fix (something about catching the EOS event (?) from gstreamer and forcing a speed reset) that will be part of the next alpha release of Processing 2.0.   

The MIDI channels are from those found on the Numark DJ2GO USB mixer, but they can be reassigned to fit any hardware controller with both buttons and knobs (note and cc output).

There are still a few bugs that I haven't been able to squash:

-I sometimes get a "NullPointerException" when using the control window record button.  I don't seem to get it when holding down the spacebar to record the mix.  If the first recording in a session is made with the spacebar, the control window button seems to work fine after that.  And, sometimes the record button works fine right from the beginning.  The most frustrating part is I can't consistently recreate the error message.

-There seems to be a problem with the way that Processing exports this sketch as an applet.  I get an "UnsatisfiedLinkError" - something to do with gstreamer 0.10 - so, if you have Processing 1.5.1 already installed, be sure to download the GSVideo, controlP5 and themidibus external libraries (I had to rename the downloaded MIDI library simply "themidibus" for it to work).  Then just delete the "code" folder from the sketch and run "SimpleVideoMixer.pde".