Topic: No-Interface video

Hey folks-
I have an interesting challenge that I think some of the folks around here might be able to help me out with.  It's a slightly lengthy post, but please bear with me.  I’ve been struggling with a particularly technical challenge for awhile, and I recently picked up a Chumby guts because I thought it might be able to do what I need it to do. 

I have been trying to make a series of video sculptures in which LCD screens are installed inside old, used wooden boxes, which are wired to play back a video upon opening the lid. To get some idea of what this might eventually look like, you can see a semi-functional prototype of the project here: http://www.aphasiac.org/video/Demonstration.mov.

Seems pretty simple, right? The problem has been with the video playback - it is essential that video plays directly upon opening the lid, from the beginning, with no intermediary interface. You can see in the prototype version (which runs on a hacked Nokia 770) about 2-3 seconds of the handheld's desktop before the video kicks in - seemingly small, but enough to kill the effect for me. It's not so much the speed of the video load that I find so problematic (I don't mind a couple of seconds of waiting), but the fact that you can see the interface - it changes the viewing experience from "this is a memory in a box" to "this is a computer in a box."

So, it’s been suggested that a Chumby might be the way to go.  But my questions are this – first off, is there a way to have a reed switch directly input into the Chumby, or would I have to have the input go through an aurduino (or something like that) and be converted into a USB signal.  Second, given that I’d prefer the boxes not to have any wires running in and out, does the Chumby have a sleep mode which it could into while the lid is closed to save battery live?

Once the hardware issues are sorted out, I assume I could just make a custom widget that would respond to the “open lid” signal by playing the video (in .flv form), and the “close lid” signal by going to the beginning and pausing/sleeping.  Thoughts?

Thanks.

Re: No-Interface video

The chumby has a switch inside the top, typically used to access the Control Panel, however, it's accessible to Flash.  Currently, it's a simply SPST (ie. "on" while pressed) switch and could be replaced easily - all the switch has to do is cross two wires.

As far as power is concerned, one could probably write some code to extend the life of any battery by shutting down wifi, the screen and the audio, but my guess is that the current chumby might still be a bit heavy for a battery.  It seems to me that given your description, you probably wouldn't even include the wifi.

The software's pretty easy - launching/pausing etc a local FLV is probably less than 100 lines of Actionscript code.

I don't see any real barriers to the use of chumby for what you're doing - the "chumby guts" have been made available for precisely this sort of thing.

Re: No-Interface video

Thanks for the feedback, Duane.  If I want to shut down the screen and the speakers while the lid of the box is closed (as a power-saving measure), can I do it from within Flash/Actionscript?

Re: No-Interface video

If you've got a 2009 model, you can use _getLCDBrightness() and _setLCDBrightness(), and if you have an earlier model you can use _getLCDMute() and _setLCDMute().

I don't know that you'll need to do anything with the speakers, other than just not using them.

Documentation on these calls are available at: http://wiki.chumby.com/mediawiki/index.php/ChumbyNative

Re: No-Interface video

Thanks to everyone for all the help thus far.  I've almost got it working, except for one bizarre bug that I can't figure out.  If I stop the video in the middle (by closing the bend switch connection, which is supposed to clear the video stream), the video is supposed to start again from the beginning when I reopen the switch.  Bizarrely, when I do so, the video does start at the beginning, but the audio picks up from where the video cut off before.  This only lasts for a couple seconds, and then it the audio reverts to its position in the current playback.  Do you have any idea how I can fix this lag time on the audio?  The Actionscript code I'm using is:

var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
my_video.attachVideo(stream_ns);

_bent = ASnative(5,25);
var getbend:Number;
var lastbend:Number;
var changestate:Boolean = true;

this.onEnterFrame = function() {

    getbend = _bent();
    
    if (getbend != lastbend) {
        changestate = true;
    }
        
    if ((getbend == 0) && changestate) {
        stream_ns.play("Susannah_1.flv");
        changestate = false;
    }

    if ((getbend == 1) && changestate) {
        stream_ns.close();
        my_video.clear();
        changestate = false;
    }
    
    lastbend = _bent();
}

Before I started working with the bend sensor, I put together a prototype using the touchscreen instead (with the onMouseDown and onMouseUp functions) - just to make sure I could actually get the video working.  Oddly enough, I didn't have the same problem.  Even if I cut off the video in the middle, when I started it again both the audio and the video would automatically start from the beginning.  The code for that prototype was:

var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
my_video.attachVideo(stream_ns);


this.onMouseDown = function () {
        stream_ns.play("Susannah_1.flv");
}

this.onMouseUp = function () {
        stream_ns.close();
        my_video.clear();
}

Any ideas as to what's going on, and how I can fix it?