View Full Version : Movie2serial newbie troubles

09-02-2013, 01:31 AM
Hi All, I'm a newbie and am having some trouble with movie2serial. I keep getting an "Unexpected character" error regardless of path i put in for my movie. In this case the unexpected character is "U".
Do I need to put my movie somewhere specific?
Any ideas?

Movie myMovie = new Movie(this, "C:\Users\Owner\Videos\GS_open_loop.wmv");


09-02-2013, 09:25 PM
I do not believe I ever saw this error. Could you post the complete error (with any java exception stuff if present), or a screenshot?

Maybe try playing a .avi file instead of .wmv? I'm not sure if that makes any difference, but when I tested on Windows I only ever tried playing .avi files.

09-02-2013, 11:11 PM
You're using backslashes, wouldn't you need to escape them ("\\"))? I think this is why you're getting this error -- There's no valid escape sequence "\U".

Alternatively, I think Processing is smart enough to use '/'s as valid in Windows file paths.

09-03-2013, 12:45 AM
Yup, good catch potatotron.

When I tested on Windows, I'm pretty sure I used forward slashes. :)

09-03-2013, 06:09 AM
Thanks for the feedback, I switched to forward slashes and that got rid of the error yet I still don't have it going. If you have a moment to kill then please take a look at what I have here.

- My layout is 8 strips tall and 30 leds wide all driven by one teensy per the instructions for Octows2811. I have succesfully run Rainbow and the other couple of test sketches so the hardware does work.
Currently I have Video Display loaded on the teensy and have configured it as follows:

#define LED_WIDTH 30 // number of LEDs horizontally
#define LED_HEIGHT 8 // number of LEDs vertically (must be multiple of 8)
#define LED_LAYOUT 0 // 0 = even rows left->right, 1 = even rows right->left

// The portion of the video image to show on this set of LEDs. All 4 numbers
// are percentages, from 0 to 100. For a large LED installation with many
// Teensy 3.0 boards driving groups of LEDs, these parameters allow you to
// program each Teensy to tell the video application which portion of the
// video it displays. By reading these numbers, the video application can
// automatically configure itself, regardless of which serial port COM number
// or device names are assigned to each Teensy 3.0 by your operating system.
#define VIDEO_YOFFSET 0 // display entire image
#define VIDEO_WIDTH 100
#define VIDEO_HEIGHT 100

//#define VIDEO_XOFFSET 0
//#define VIDEO_YOFFSET 0 // display upper half
//#define VIDEO_WIDTH 100
//#define VIDEO_HEIGHT 50

//#define VIDEO_XOFFSET 0
//#define VIDEO_YOFFSET 50 // display lower half
//#define VIDEO_WIDTH 100
//#define VIDEO_HEIGHT 50

const int ledsPerStrip = LED_WIDTH * LED_HEIGHT / 8;

DMAMEM int displayMemory[ledsPerStrip*6];
int drawingMemory[ledsPerStrip*6];
elapsedMicros elapsedUsecSinceLastFrameSync = 0;

const int config = WS2811_800kHz; // color config is on the PC side

OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);

void setup() {
pinMode(12, INPUT_PULLUP); // Frame Sync

In processing I have Movie2Serial serial configured to for "COM5" and have deleted the second serial configure line since I'm only using one teensy. The setup portion of the sketch is as follows:

import processing.video.*;
import processing.serial.*;
import java.awt.Rectangle;

Movie myMovie = new Movie(this, "C:/Users/Owner/Videos/GOPR2386.avi");

int numPorts=1; // the number of serial ports in use
int maxPorts=24; // maximum number of serial ports

Serial[] ledSerial = new Serial[maxPorts]; // each port's actual Serial port
Rectangle[] ledArea = new Rectangle[maxPorts]; // the area of the movie each port gets, in % (0-100)
boolean[] ledLayout = new boolean[maxPorts]; // layout of rows, true = even is left->right
PImage[] ledImage = new PImage[maxPorts]; // image sent to each port
int errorCount=0;
float framerate=0;

void setup() {
String[] list = Serial.list();
println("Serial Ports List:");
serialConfigure("COM5"); // change these to your port names
if (errorCount > 0) exit();
size(480, 400); // create the window
myMovie.loop(); // start the movie :-)

Thanks for any Help you can offer.

04-28-2014, 02:08 PM
You have to change
int numPorts=1; // the number of serial ports in use
int numPorts=0; // the number of serial ports in use
as this gets increased automatically by the initialisation code.

I set up a 8x8 test-setup too now and the 8x8 leds are all on one stripe that zig-zags over the display area. But only the first row gets updated all other rows remain black.
All the other samples work. Maybe someone can help me here.

My Video Display settings:

#define LED_WIDTH 8 // number of LEDs horizontally
#define LED_HEIGHT 8 // number of LEDs vertically (must be multiple of 8)
#define LED_LAYOUT 1 // 0 = even rows left->right, 1 = even rows right->left