Topic: Help developing a "generic webcam" widget

I am not a flash programmer, but I am a Perl programmer and a Linux sysadmin.
It seems to me that we should be able to create a widget that does 2 things:
1. Accepts a URL to a jpg, then pulls an image from that URL
2. Forces the image size to 320x240.
This way anyone who has a URL of an image can use the "generic webcam widget" to display it.
I have found 3 or 4 webcam feeds out there I would like to use, but they are not the right size and I would not want to create multiple widgets for them. There are 1000s of potential web cams out there (including personal cams) so why not just create a single widget to handle them all?

So to get to my question, is there anyone out there who can help me develop this?
I have flash MX 6 (I know it is a bit old), but I have very little idea what I am doing with it.
I can struggle with it myself, but I have a feeling there is a very knowledgeable person out there that can create this in under an hour.

Please let me know if anyone out there can help.

Re: Help developing a "generic webcam" widget

I second!  In fact, the biggest reason I got my Chumby was for this purpose: to have my desktop server prepare an image every few seconds showing my weather station data, unread email in high-priority folders, and other news worth my attention.

FWIW I'm a Linux/C/Perl programmer too but Flash-ignorant.  If you get this widget working, would you mind sending me a copy?  I'm EdSantiago on chumby.com.

3 (edited by Beastlykings 2007-12-13 12:30:17)

Re: Help developing a "generic webcam" widget

Hey, what if when it gets made, and then uploaded to the site, you make it so when you add it to your channels then the "customize" option would have a big list of approved cams to select from? And then have a special email address for suggesting new cams.
Because I don't think your average person is gonna be able to re-code (even if just a little bit) a flash widget, let alone want to have to do it.

amiright?

Re: Help developing a "generic webcam" widget

There's an example webcam widget with full source on the wiki.  See here for a current list of example widgets.

All you need to do is add the logic to resize the image once it's loaded and the configuration widget to enter the URL (see the Simple Banner example, also on the wiki, for how to do that).

The examples are Flash 6 compatible.

5 (edited by ccolumbu 2007-12-13 12:47:59)

Re: Help developing a "generic webcam" widget

Just to be clear, I don't want people to have to "compile a widget".
So the idea is that you select the "generic webcam" widget (which we are talking about creating here) to play on your Chumby, then click on config and it gives you a param for the URL to the jpg. If you want to get fancy you can add a parm for title too.

The resizing and processing of the URL are in the widget’s flash code already, so the person "using" the widget does not need to know anything about Flash or how to compile a widget.

That is it, a single widget for any web image in the world. If you want to monitor more than 1 you simply load the widget multiple times and set a different URL on each.

Think of it like the weather widgets where you enter your zip code, and if you want to monitor more than one zip code, you add multiple weather widgets and put a differnet zip code in each one.

Re: Help developing a "generic webcam" widget

I don't know if this will help or not, but here is a link to some free webcam software for OS X.

http://www.kellener.com/steve/webcam/VideoWeb.dmg

VideoWeb was originally made by one company and was a free product.  It was later sold to another company and became commercial software.  This is a link to the free software.  I've used it on occasion and it seems to post an image just fine. 

I know it's not Flash based or anything, but it does post an image up on a server.  I thought maybe this might help someone with their webcam project.

Re: Help developing a "generic webcam" widget

Why not cook up some PHP/Perl/whatever (something ubiquitous) that'll spit out the 320x240 images and take that task off of the chumby. It'd be a pretty easy task to munge the webcam example to take a URL in the config screen (that points to the output from your script).

Re: Help developing a "generic webcam" widget

The problem (at the moment) is not getting a jpg image, this widget is for webcams that already output jpgs to the web.
The URL would be something like:
http://www.co.palm-beach.fl.us/webcams/ … /inlet.jpg
I think that you can output the image at any size like HTML simply put a height/width and it will be the right size (this is an assumption about flash)

The real problem is that I am not a flash developer and have never worked with flash, I just need someone who can write the code per my specs.
If you are out there, contact me, maybe there is some $ in it for you smile

If I don't find someone to write it I will learn flash and do it myself next year.

Re: Help developing a "generic webcam" widget

ih8gates wrote:

It'd be a pretty easy task to munge the webcam example to take a URL in the config screen

That's the thing: it's not.  First, FlashDevelop seems to be Windows-only and some of us are Linux-only (as in: no MS products in our home).  OpenLaszlo should work, but if I understand correctly it's a completely different language (not .fla).

The point is, if there are two options:

  a) Download and install some new flash-building software; learn a new language; write and debug a custom tool that views ONE and only one webcam; test it; upload to chumby.com; or

  b) Click to install a generic webcam widget; click configure; enter a URL

...it seems to me that (b) is an option worth pursuing.

Re: Help developing a "generic webcam" widget

I am so glad Ed is following this thread, he must be a linux guy, we think alike.

Re: Help developing a "generic webcam" widget

I would also welcome this. In another thread I was hoping someone could create a weather radar widget. If this widget could accept jpg and maybe gif images I would be all set. You can find links to radar images on NOAA such as..

http://radar.weather.gov/Conus/Loop/NatLoop_Small.gif

http://www.srh.noaa.gov/ridge/lite/NCR/LOT_loop.gif

-HuckFinn

12

Re: Help developing a "generic webcam" widget

I just created a widget and made it public. It simply loads an image from a given url. Look for it in widget labs soon. I called it "load image from url"

Here's the code if anyone is interested, no library items needed. Feel free to hang the chumby by loading a huge image as it doesn't do any checking:

var imageHolder:MovieClip = this.createEmptyMovieClip("mcImageHolder", this.getNextHighestDepth());
var mcl:MovieClipLoader = new MovieClipLoader();
mcl.addListener(this);

function onLoadError (target_mc : MovieClip, errorCode : String, httpStatus : Number)
{
    trace("onLoadError "+arguments); 
}
function onLoadStart (target_mc : MovieClip)
{
    trace("onLoadStart "+arguments); 
}
function onLoadProgress (target_mc : MovieClip, loadedBytes : Number, totalBytes : Number)
{
    trace("onLoadProgress "+arguments); 
}
function onLoadComplete (target_mc : MovieClip, httpStatus : Number)
{
    trace("onLoadComplete "+arguments); 

}
function onLoadInit (target_mc : MovieClip)
{
        var pctToScale:Number;
        var orientation:String;
        if(target_mc._width>=target_mc._height)
        {
            //is Portrait
            orientation="Portrait";
            pctToScale = NIPO(320, target_mc._width);
        
        }else
        {
            orientation="landscape";    
            pctToScale = NIPO(240, target_mc._height);
        }
        trace("pctToScale");
        target_mc._xscale=target_mc._yscale=pctToScale;
        target_mc._x = (320-target_mc._width)/2;
        target_mc._y = (240-target_mc._height)/2;
}

function NIPO (N:Number, V:Number):Number
{
    var a:Number = N / V;
    var P:Number = a * 100;
    return P;
}
this.stop();
var imagePath:String;
if(_root.IMAGE_URL != undefined)
{
    imagePath = _root.IMAGE_URL;
}
else
{
    imagePath = "http://mindlessabstraction.com/NoImage.jpg";
}
mcl.loadClip(imagePath, imageHolder);

Re: Help developing a "generic webcam" widget

jvc wrote:

I just created a widget and made it public.

Thank you!  I haven't tried your widget yet (and it's not for lack of checking Widget Lab since 5AM today), but I want to acknowledge your post and say many, many thanks.  I'm checking Widget Lab every half-hour or so today, and as soon as I see your widget I will eagerly try it.

Re: Help developing a "generic webcam" widget

I would also like to thank you for your widget.
Can I ask why there is no size checking? Maybe at least a timeout?
It does not really matter I know what I am doing so I am not likely to trigger the size problem.
If anyone does they can always remove the widget through the web and reboot their chumby smile

15

Re: Help developing a "generic webcam" widget

I actually think the chumby is smart enough to stop the widget from hanging it. It was more of a comment of "be reasonable with your image sizes"

Re: Help developing a "generic webcam" widget

Hi jvc,

Still no sign of your widget in Widget Lab.  If you have it installed in your Chumby, would you be willing to use the Send mechanism to give me a copy?  I'm EdSantiago on the www.chumby.com site.  I have no idea how Send works, or if it'll allow sending unblessed binaries, but I'm willing to try if you are...

Re: Help developing a "generic webcam" widget

Ed, you could just ask him to send you the falsh file and you could load it as a "private" widget for now, I thought private widgets were not subject to "the approval process" the way public ones are.
I am not in a hurry, so I don't need a copy until it is released to the public.
Thank you again jvc, it was really nice of you to create the widget for us.

BTW: Ed, I am always looking for skilled developers if you are loking for side work, let me know and we can talk off-forum.

18 (edited by huckfinn 2007-12-14 15:03:12)

Re: Help developing a "generic webcam" widget

Will this only work with jpg files or will it also load gif files?

Thanks for this! I will try it out once it is available.

There are a couple images that come to mind with this.

http://www.ssec.wisc.edu/data/sst/latest_sst.gif

http://www.ssec.wisc.edu/localweather/r … adar_5.gif

As you can tell by this and my previous post I am a weather junkie.

-HuckFinn

19

Re: Help developing a "generic webcam" widget

kinda works the opposite - you have to add me to your chums list so I can send to you

my name is jvcleave. add me and i will send it over

20 (edited by jvc 2007-12-14 17:36:33)

Re: Help developing a "generic webcam" widget

it works with gifs, pngs, and jpgs

Re: Help developing a "generic webcam" widget

jvc -

Thanks for this. I have my chumby, but the wife won't let me open it until Christmas. Hopefully by then your widget will be in the public domain.

-HuckFinn

Re: Help developing a "generic webcam" widget

huckfinn wrote:

jvc -

Thanks for this. I have my chumby, but the wife won't let me open it until Christmas. Hopefully by then your widget will be in the public domain.

OooOoo I think I would be sneaking around and testing it, you my friend have more patience than  Tom Sawyer.

Re: Help developing a "generic webcam" widget

Well GoodDoctor you caught me. The wife went out tonight so I went ahead and unboxed and activated my Chumby. So now on Christmas morning I can just unwrap it and turn it on. I played with it for about 30 minutes and am excited to add this to my nightstand. My first observation is that it is smaller than I thought - which is a good thing. I loaded the Beta control panel and love the streaming music. This is a really cool device.

jvc - as I have not seen your widget in the labs section I added you as a chum. If you would not mind sending me this widget I would love to try it out. Now I am going to have to wait until XMAS to do much more playing but I want to have it set up just right.

Thanks again.

-HuckFinn

Re: Help developing a "generic webcam" widget

Hi again guys, jvc did you ever get approval for the widget?
Did they rename it or something, I still don't see it in the lab.
I am not in a hurry, just checking in smile

Re: Help developing a "generic webcam" widget

Reply to ccolumbu: no, the widget isn't posted yet...

Quick feedback to jvc: the widget isn't usable in its current form, because it doesn't append ?<timestamp> to the URL.  Chumby caches by URL for five minutes, so without a unique identifier the webcam will only fetch once every five minutes.  The convention I've seen, and which works for me, is:

date = new Date();
now = date.getTime();
...
blahblah.loadMovie(url + '?' + now);

Another thing that would be useful is a configurable refresh rate, probably in seconds.  Aren't I demanding? :-)

BTW I've found a way to use Ming (on Linux) to generate swf files and hence do my own webcam.  I intend to Wiki my findings this weekend.