Hi-Res webcam part #248

October 3rd, 2008

Yesterday, Oli woke my sleeping awareness of my weblog by commenting on this one and a half year old post about getting a high resultion picture out of a webcam in Flash. His comment (in short): “it doesn’t work!”.

Unfortunately, he’s correct. I’ve run into this myself, once CS3 came out. It did work in the Flash 9 Bèta, but it is broken in the release version. The problem lies in these lines:

my_video._width = my_cam.width;
my_video._height = my_cam.height;

Where this also adjusted the what is now Video.videoWith and Video.videoHeight properties, it is now impossible to change those after the creation of your instance of the Video object. No need to worry, though, because if you’d just supply the size you want when creating the instance, everything works fine. Here’s the whole working thing:

var my_cam:Camera = Camera.getCamera();
my_cam.setMode(640,480,10);

var my_video:Video = new Video(my_cam.width, my_cam.height);
my_video.attachCamera(my_cam);
addChild(my_video);

var bmd_video:BitmapData = new BitmapData(my_cam.width,my_cam.height);
var bm:Bitmap = new Bitmap(bmd_video);
bm.x = my_cam.width;
bm.y = 0;
addChild(bm);

var updateInterval:uint = setInterval(update,100);

function update() {
	bmd_video.draw(my_video);
}

Of course, putting everything in nice class files would be better, but I find timeline code easier for these simple demonstrations. This doesn’t require you to create and save all the files, it’s just paste and run. But if you prefer that, you can use this:

package
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.MovieClip;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.events.TimerEvent;
	import flash.media.Camera;
	import flash.media.Video;
	import flash.utils.Timer;

	[SWF(width="1280", height="480", frameRate="10", backgroundColor="#FFFFFF")]
	public class WebcamHiRes extends MovieClip
	{
		private var _camera:Camera;
		private var _video:Video;
		private var _bmd:BitmapData;
		private var _bm:Bitmap;

		private var _updateTimer:Timer;

		public function WebcamHiRes():void
		{
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.align = StageAlign.TOP_LEFT;

			_camera = Camera.getCamera();
			_camera.setMode(640, 480, 10);

			_video = new Video(_camera.width, _camera.height);
			_video.attachCamera(_camera);
			addChild(_video);

			_bmd = new BitmapData(_camera.width, _camera.height);
			_bm = new Bitmap(_bmd);
			_bm.x = _camera.width;
			addChild(_bm);

			_updateTimer = new Timer(100);
			_updateTimer.addEventListener(TimerEvent.TIMER, update);
			_updateTimer.start();
		}

		private function update(e:Event = null):void
		{
			_bmd.draw(_video);
		}
	}
}

Graduated!

October 3rd, 2008

Hello there! Things have been quite busy here, with graduating and all, but finally I’ve got my Master of Arts! My calling card is starting to look rather impressive. Unfortunately, I haven’t been paying much attention to my weblog. For my graduation project, I’ve started a new weblog, though, but I’m a bit late in telling you. My graduation weblog doubled as my thesis which is quite unordinary but worked quite well.

Graduation project

If you are interested, you can read it all on niels.keetlaer.net/emma.

Fez!

February 20th, 2008

Just yet, a friend told me about a nice oldskool looking game with a very nice twist (apart from the fez). I won’t tell, you just have to see for yourself!

Get the Flash Player to see this player.

(via).

Meatspace

February 5th, 2008

Recently, some friends and I had a discussion about the difference betweeen knowing people ‘online’ and in ‘real life’. Being me, almost living online, I do not consider ‘online’ to be unreal - it’s just a different ’space’ in which you live.

In 1982, William Gibson already invented a term to describe the online world in his story Burning Chrome. As you might now, the name he gave it was cyberspace. Well, his online world isn’t what it is now, but the term is widely used to describe ‘the internet’ in its widest meanings.

As I wanted to make a distinction between cyberspace and the ‘real world’ without implying cyberspace to be unreal, I coined a new term: meatspace. As it appears, I’m not the only one coming up with such a plastic description, given that there’s already a Wikipedia article about it which I certainly didn’t write myself.

It might feel a bit fleshy, but you’ll get over it.

Eyedentity

November 30th, 2007

eyedentity logo

Eyedentity is a project of a few fellow students, in cooperation with the TV Show Holland Doc. Unfortunately for non-Dutch-speaking people, it’s all in Dutch… But here’s what this is all about.

Eyedentity is an experiment about survival in the virtual world. After several rounds of casting, a participant has been chosen to be locked up in a room with only a computer hooked up to the internet to communicate with the outside world - even phonecalls are out of the question. Jennifer, that’s her, must even order her own food from the ‘net. Parcels will be deliverd to the researchers, who will then hand them over to Jennifer, as to limit physical contact with the outside world as much as possible. Also, she can be followed with a webcam 24/7 from the project webpage. How will she survive this modernist trail?

I’m really curious as to how much damage this abstinence from the outside world (even during ‘Sinterklaas’ and Christmas!) will do to her (not to worry, there’s a shrink on stand-by). Even though I am more of a ‘net person than most, after a few days of no (physical) contact I get rather bored, irritated and generally craving for human contact. And then I’m not even speaking of having a webcam following me all day…

Update: As you might have gathered (I am a little late in reporting), the whole thing was a fake. The creators wanted to create an experience about online privacy, about what it means. According to them, it comes down to:

You are what you pretend to be

I don’t really know about outsiders, but being in on this project (I helped out with a bit of the programming) was quite an experience as well. There were quite a few dubious happenings (for example: there were obviously repeating clips, or a large (plastic) gull flying through the room), and still people kept believing. For example, she (or, at any rate, the person behind the chat) was asked if she noticed the gull flying trough the room. She could deny it, and people believed her instead of their own eyes.

Wonderful.