Shaping Internet Traffic

When you are downloading/uploading full-bore using BitTorrent, often your connection is completely flooded.
Anything you try to do is dog slow, and conections are often lost in any internet games you play.

It turns out that there is a way to make your BitTorrent traffic have a lower priority than other traffic.
It’s called “traffic shaping”, and I’ve got it working on tnir thanks to
Wonder Shaper.

It’s just a shell script — it’s not even very long or fancy.
It makes use of the “tc” command, which is relatively new to Linux.
“tc” stands for “traffic control”.
Personally, I would have preferred “ts” for “traffic shaping”, but perhaps the tool predates the new (to me) terminology.

After installing it last night, I set BitTorrent to my highest usable level of upload speed (65 k/s), which usually kills any games or web browsing that is done.
Reports from Ronnie upstairs indicate that it’s as if there was no BitTorrent running at all.
Meanwhile, Azureus is reporting a full 65 k/s upload and often over 100 k/s download speeds.


Now, this is really a Linux-only script, so you can’t use it on your (eek) Windows firewall, or your Linksys or D-Link routers.
Well, maybe the LinkSys, since it apparently runs some version of Linux, but doing that is a definite exercise for the reader.
Otherwise, if you don’t have a Linux firewall, this won’t really help you very much.
But, at least you have another buzzphrase to look for in router advertising: “traffic shaping”.
Oh, you might also see the term “QoS” used in conjunction, which stands for “Quality of Service”, which shaping generally increases.

Other links:
an article
about traffic shaping;
Linux Advanced Routing & Traffic Control site;
traffic shaping

SVGA connectors going away?

Well, that’s how I read
this article
X-bit labs.
The VESA organization has a new thing called “DisplayPort”.
Here’s a quote:

the [Displayport] specification will accelerate the adoption of protected digital outputs on PCs to broadly support viewing of high definition and other types of protected content through an optional content protection capability, while enabling higher levels of display performance

Hm, “content protection”.
That sounds ominous.

I predict “protection-free” monitors on the grey market,
just like “region-free” DVD players are now.

Change screenshot image format for OS X

The default file format for screenshots in OS X (created via cmd-shift-4 usually) has changed over time.
At first it was TIFF.
Then someone figured out how to set it to whatever you wanted.
Most people set it to JPEG.
Then version 10.2 of OS X came out and the format changed to PDF, and there was no way to change it.


With version 10.4, Apple moved from PDF to PNG, which was way more sensible, but still there was no way to set it to another format.
Well actually, that’s not true as it turns out, and there is a new app that lets you do it.
It’s called SCIT which stands for “Screen Capture Image Type”.
Go get it.


Google Talk

I think it was “smash’s world“, the blog of Ben Guild, that was first to report on details of how to log into Google’s new Jabber server.

The instructions are pretty easy, and you can connect using Apple’s iChat (as you can see).
Surprising to me was the availability of video chat.
Even more surprising, multi-video-chat!
I spent a while video chatting with Iain last night, and it worked exactly the same as iChat in terms of experience and quality.

Jabber uses XML at its base, and is almost obscenely expandable w.r.t. functionality.
I hope we see some of that promise shine through in future iterations of iChat.

Blade Runner-like Image Enhancement

Enhance nighttime camcorder image
While playing with some astronomical programs like
a rather buggy piece of free-ware (there are commercial programs that do this too),
I was surprised to find how easy it was to do some image-enhancement magic.
The image above (seen in full here:
TFS on Bloor viaduct)
was shot at night with an older NTSC camcorder that was presenting a lot of CCD noise in the image and there were cars driving back and forth through the frame and there was a bit of camera shake because I zoomed in a bit.

I captured the DV stream on my PC, then used Virtual Dub to select out about 40 or 50 frames that didn’t have much motion,
deinterlaced it and then fed that to registax, and after a few seconds, all of the CCD noise, darkness, moving cars and camera shake disappeared just like magic.
Well, okay, its surprising the first time you do it anyway.

[edited a bit by rae; hope that’s okay, Jeff]

Highlander Hybrid Update

Hybrid Synergy Drive
Just this past weekend and here:
“Highlander Test Drive”
people have said that it will take a long time for a hybrid to pay for itself.
Well in May, when gas was 30% cheaper, the math was different, but as I told the salesman then, gas prices were not flat, they were rising.
The current math for the hybrid is, assuming that the $5000 in hybrid equipment keeps about $2500 in value (and why wouldn’t it be more now?), is:
break-even in 2.5 years at 20,000km/year assuming you’re going from a 13L/100km SUV to 8L/100km for your driving.
It’s amazing what a few *days* of gas price hikes can do to this equation.
It seems to be big news — National Post even mentioned the Highlander Hybrid in the continuation (p5?) of a front-page story today.
Anyway, a hybrid won’t help you on an open highway, so your mileage may vary.

PC HDV Frame-grab How-To

We poor schmucks without strobe lights, trained birds or 3000 feet of 35mm film might like to try some experimental photography with 1.4 Megapixel images (suitable for 4×6 and the Web, anyway) that freeze a moment in time or capture a decent picture with an uncooperative subject, or even just provide a decent web-quality photo from a video stream.

With a SONY HDR-HC1 you can get HDV @ 1440x1080i.
What you’ll need is a fast PC running Windows XP SP2 or XP64.
I’m running XP64 and some things are still a bit troublesome with Media Player 10 and HDV .wmv’s and .mpeg’s, but those issues go away if I boot into XP.
I’m sure whoever is responsible will fix it soon (either Microsoft or the video card driver folks, not sure who).

First off, plug your firewire connector (IEEE-1394) into the camera and into the PC port for it.
You may have to buy this cable, then start with CaptureDVHS and capture an HDV stream to a .mpeg file.
Then fire up Virtual Dub Mpeg-2 and slice the sequence down to just 50 or so frames (maybe less, in theory you need only 3) surrouding your image of interest.
Use an “area” de-interlace filter for Virtual Dub (you’ll need to download it — it’s a plugin) and run it on this stream, producing an uncompressed .avi output.
Then load that uncompressed .avi back into Virtual Dub, moving over to the frame you want to capture.
Then select video/copy to clipboard.
Now fire up Photoshop and do a file/new from clipboard.
Then go into Image/Resize and turn off the proportional lock.
Then change the 1440 to 1920 and you should have a 1920×1080 de-interlaced image that is 2 megapixels in size, but only contains 1.5 megapixels worth of detail.

Alternatively, the camera itself can produce 1.1 megapixel images (1440×810) de-interlaced from the tape by pressing the Photo button when you’ve paused the tape at a frame you want. In practice, this is quite hard on moving images.

A 3rd alternative is to use Pinnacle or Sony Vegas for HDV, but both are still a bit pricy for amateur photo buffs.

The images are obviously not going to compete with a D-SLR, but they’re better than NTSC frame grabs, camera-phones and web-cams.

To get images to work with, you’ll want to override the shutter and exposure control on the camera.
For birds, you need to brighten the image a little and select about 1/500th to 1/750s shutter speed or thereabouts.
This helps cut down on dark shadows and motion blur.
A tripod with a fluid head will also help, but is not essential.
Depending on your tastes, this should also work for Roller-coasters, airshows and stock-car tracks.

Win XP64

For a gas, I installed Windows XP64. Some things actually work! Whoa. Firefox is okay, Drivers from nVidia, always on top of their game work fine. CNN videos are okay, but both Media Player 10 and Winamp can’t seem to grok DV or .mpeg codecs. Oh well, I knew I would need dual boot for a while.

Update: I made an error by installing XP64 before XP home. Now I’m busy installing XP64 for the 3rd time.