12 Aug
2008

Video Encoding on the Sony Mylo COM 2

Those who know me will know that I have - using the parlance of the modern kids - mad skillz when it comes to video encoding and transcoding. I'll happily admit to wasting far too many hours learning the finer points of ffmpeg, mencoder and vlc, combining them with all manner of shell scripts, web interfaces, cron jobs and the like to set up my own mediacentre, video RSS feeds and shared video chatrooms (currently in maintenance mode).

So imagine my combination of frustration ("it should just work") and elation ("ooh, a challenge") when I discovered that my shiny new Mylo is extremely temperamental when it comes to video. I had assumed PSP-friendly video would have been fine but it turns out I was wrong. Any slight variation in frame-rate, bitrate, frame-size, aspect ratio, codec or container and I'd get a lovely "Sorry, the Mylo doesn't support this format" error (but in Japanese).

Anyway. In case you're interested, here's a shell script:

#!/bin/bash
ffmpeg -i "$1" -y -threads 2 -map 0.0:0.0 -f mp4 -vcodec xvid -b 768 -aspect 4:3 -s 320x240 -r ntsc -g 300 -me epzs -qmin 3 -qmax 9 -acodec aac -ab 64 -ar 24000 -ac 2 -map 0.1:0.1 -benchmark "$1.MP4"

call this from the command-line with the path to the file you want converted and 10 minutes later, your Mylo-ready file will be sitting next to the original.

I'm really only posting this here because in about 6 months, I'll have forgotten all about this and, given my current luck with technology, all my computers and all their backups will have simultaneously formatted themselves.

3 Aug
2008

Kotoba

Kotoba

After some shuffling around of code and some gradient paint-bucket in Photoshop, the translation widget is done. Remember, of course, that you need a Sony Mylo to use it. Unless you just want to download it, unzip it and have a look at the code, that is.

You can also download it from the official widget gallery. I'd be interested to find out how well/badly it functions on a non-Japanese Mylo. I have no idea about the language capabilities of other versions.

17 Jul
2008

Extension building is complicated

With Firefox releasing version 3.0.1 yesterday, I spent a chunk of last night trying to update the noodle extension. I decided it would probably be a good idea to enable automatic updates so keen users would be able to take advantage of the latest features immediately (or some such marketing gubbins).

Basic extension building itself is unnecessarily complicated in my opinion. For a start, XUL is an extremely clever and powerful tool but has abysmal documentation. I've now done two sizeable projects using it and I still don't have a clue how it works. Once you've got that bit sorted, however, you then need to package up your extension in a very particular way taking care not to forget updating all of the required versioning bits.

If you want to enable automatic updating, you now need to digitally sign it. Not a bad idea, really. It just makes the whole process even more complicated.

My process roughly goes as follows:


  • Update Extension

  • Update install.rdf with the new version number

  • On the terminal, run './build.sh' (automatic shell script to package, zip, remove hidden files, copy, paste, resequence, etc)

  • Upload noodle.xpi to this server

  • On the terminal, run 'md5 noodle.xpi' (to calculate one of the application hashes)

  • copy key to noodle extension post for in-browser installation

  • update update.rdf with the new version number

  • run 'openssl sha1 noodle.xpi' to generate another application hash)

  • update update.rdf with new update hash

  • resign update.rdf with McCoy (embeds another application hash)

  • upload update.rdf to server

  • cross fingers

This process is somewhat more complicated the first time you do it as you also have to use McCoy to digitally sign the install.rdf before you build your extension. McCoy itself is also password-protected.

In total, you have 1 password to run McCoy, 1 extension signature, 1 md5 hash to allow in-browser installation, 1 sha1 hash to allow add-ons menu automatic updating and 1 signed update.rdf. I'm sure I've missed one.

13 Jun
2008

Noodle Firefox Extension

You can either download the Noodle Firefox extension from the Mozilla Addons Site (recommended but requires registration) or below.

Noodle Firefox extension [1.0.5].

If you download from the Mozilla site, you can leave a review and increase the chance it'll get accepted into the public area (no registration required).

It has been tested with Firefox 2 and 3. Surprisingly, it also works fine with both of them, too.

11 May
2008

Comments

I've removed the comment form from below each post here and replaced it with a Noodle button. I figured there's no sense in making a website devoted to instant commenting if I'm not going to use it myself.

This does coincide with the evil evil spambots cracking my (previously thought to be impregnable) anti-spam system earlier this week but it isn't related. Honest. Darned spam. So it may not have been impregnable but it had a fairly decent run. It lasted seven months and several tens of thousands of attempts to bypass it. Oh well.

At least Noodle uses Google Accounts. If spam starts to come through on it, I'll just remove the ability to post anonymously so everyone will need a google account. I'd rather not do that unless I really have to, though.

18 Apr
2008

Language

My latest pointless programming project is just about finished. There's just one little bit left to figure out and then it's done.

I'm building this using the new Google AppEngine system (mostly because I needed an excuse to learn python) but there seems to be a bit of a problem with the User object. They haven't finished the User nickname bit yet so when you sign into an AppEngine application or site using a standard Google Account, it uses the bit of your e-mail address that comes before the '@' and, although Google accounts can use any e-mail address, the majority of them will be gmail.com or googlemail.com. This means that if you want to make any kind of public forum, you have to do one of the following:


  • Implement your own nickname system (not really in the spirit of a unified User object)

  • Obfuscate the nickname before displaying

  • Display the nickname and open users up to spam or other unwanted e-mail

None of these are particularly great. If it were even possible to access the user's first name, that'd solve the problem but, until the nickname functionality is finished, it's not as useful as it could be.


As an aside, doing a project in python means that I've written code in pretty much every mainstream (i.e. not esoteric) programming language except COBOL.

28 Mar
2008

A bit too social?

A bit too social?

I've been looking at adding some more features to the greatest PHP CMS around and decided that simple social bookmarking doohickeys would be useful. The idea is to have a little panel in the admin area where you can check which ones you want listed on your page. Straightforward enough so far, right? Nothing groundbreaking or difficult or anything.

It got tricky when I started trying to figure out what sites should be included. It turns out that while I wasn't looking, social bookmarking sites became quite popular. Full points go anyone who can name them all.

6 Feb
2008

Too much code...

I've obviously been reading and writing far too much code recently. I find myself mentally adding markup to my normal conversations. When I say something like "Despite having a sore back, I managed to vacuum the flat.", I mentally wrap an href round "Despite having a sore back", linking it to a previous conversation (usually with someone completely different) so that the interested listener can open that conversation in a background tab and check it out later...

As long as I don't start carrying around a small yellow sign saying 'Digg this', I'll probably recover...

20 Jan
2008

Window Sucks.

No real surprises there, I just needed to point out that it's now five past one and I started installing IE7 just under 3 hours ago. Three. Hours.

I needed to test some layouts on IE7, I don't trust IE7 enough to not mess up my parallels install so I decided to put it on my development machine in the office in edinburgh via VNC, ran windows update... wait... security updates... wait... restart... windows update... IE7. Yes, install, please. Installing... wait... restart... run IE7.

"Do you want to run the Phishing filter?"
No.

"Welcome to IE7. Do you want to run the Phishing Filter?"
No.

"Ah, you've opened a new tab. Do you want to run the Phishing Filter?"
No.

I go to the site I wanted to test. True enough, it's gebroken.

Click "Developer toolbar".

Crash... wait... restart... run IE7.

Re-download the Developer Toolbar.

"Do you want to run this?"
Yes.

"Finished downloading. Do you want to run this?"
Yes.

"This program may be unsafe. Do you want run this?"
Dear god, if this computer wasn't in a different hemisphere, I'd lamp it one right now.

Run the installer, fail.

Shut down IE7, run the installer again.

Run IE7.

Go to the site again.

"This site may be unsafe, do you want to run the Phishing Filter?"

Log out of VNC. Step away from the computer, spend 10 minutes ranting to nobody in particular. Feel somewhat better.