Digiwar - the Yeep-blog

November 28th, 2005

IPC using HTTP

In this weblog post Miguel de Icaza mentions using HTTP for applications on the desktop to communicate with each other. Similair to what COM and its offspring do for your applications on Windows.
When I first read it I was a bit pessimistic. To me it seemed like the XML hype a few years ago, when every application had to do something with XML, even if it was easier and faster not to. The weirdest thing I’ve heard was some announcement of people trying to write a window manager for X on Unix, which would use XML as a communications tool for its components. Just think how much performance it would cost if you received your window messages as XML and you had to parse them everytime!
So the first thing I thought, with the so-called “Web 2.0″-hype in the back of my mind, was that this was a bad idea. Then came the follow-up post where Miguel went a little more in depth. And this time it made a lot more sense and I could see useful applications.
I don’t think you’ll want to use this idea to enable the embedding of functionality, like embedding an Excel table in your Word document. But I do think you can use it to enable desktop-based webservices. You could use it for information transfer. For example, if Outlook has this interface, you could use it to get access to your agenda, or maybe even add a new e-mail account to Outlook.
While the HTTP-IPC interface would be useful to developers, the other thing Miguel proposes is an HTML interface for users. I like that as well. It’s not new. My ADSL router has it, Xbox Media Center has it. But why shouldn’t Outlook have it? Right now Outlook Web Access is part of Exchange Server. Why not make it also part of Outlook? Then I can access my e-mail and agenda from anywhere in the world, right here on my own computer.

I like it. It goes very nice with my idea about what the internet should do for users in the future. It’s what Orb does for me right now.

[Last played: Annihilator - Too far gone]

November 23rd, 2005

Funny URLs

I thought this article is pretty funny.

[Last played: Annihilator - Too Far Gone]

November 11th, 2005

More on Sony PSP video encoding

So, yesterday I wrote about encoding videos for a Sony PSP and I really thought I had figured it out. But like I said at the end of the article, I never watched through an entire video. So when I got to that yesterday night I noticed something really annoying. The audio moved slower than the video. It’s not noticeable for the first 30 seconds or so, but after that it just gets worse and worse. After 5 minutes, the audio is trailing behind on the video for over 2 seconds! This makes it impossible to watch a video longer than 3 minutes. So, today it was back to the big bad internet and see if I could find a solution.

I used Google to search for answers, but found no clear answer, save that one time someone blamed the sound encoding used in the source file. That person said that some encoders had a problem with the MP3 encoding used and that resulted in out of sync audio. Funny thing is, I used MP3 encoding as well. So since I could find no direct solution, I tried to go with that and see if I could change the encoding into something else.

First I tried PCM (basically raw WAV sound), but then the audio got out of sync after the conversion from WMV to AVI (after that it needs to be converted to MP4). Since the audio codecs installed on my system were few, I tried finding a few other codecs. One thing that made sense was an AAC codec. Since that’s the format the PSP wants it in, why not use that the first time (from WMV to AVI)? I searched for it and found some codec collections. I downloaded and installed the K-Lite codec pack.

Unfortunatly it didn’t give me the AAC encoding option in my conversion program. So I was back at square one.
Then I decided to try something different. Up until now I had only used Channel9 videos. I convert the WMV files into XVid AVIs and then convert them into MPEG4 videos. Looking around my download folder I found a couple of Pure pwnage videos I still had to watch. I converted one into MPEG4, put it on my PSP and it worked! The audio never went out of sync. So I started GSpot and looked at what was different between this AVI and the ones I created from the Channel9 videos.
At first glance only the video codec was different. The Pure pwnage videos used Divx 5, while I used Xvid 4. Then I noticed that the audio was 128 Kbps at 48000 KHz which, if you’ve read my previous article, should not work! I tried this many times and each time I got the message “Video cannot be played”. I was confused.
I took another good look and compared the Pure pwnage video characteristics with my Channel9 video and then I saw it! Pure pwnage used MPEG-1 layer 3 encoding and my Channel9 video used MPEG-2 layer 3. A subtle difference, but apparently a major problem for the MPEG4 encoder.

The codec pack I had installed earlier also contained two MP3 encoders. The Fraunhofer IIS encoder and the LAME encoder. So I tried them out and found that the Fraunhofer IIS encoder did the trick. So now I can encode my sound at 128 Kbps at 48000 KHz and it works! With no out of sync audio!
Okay, so I still haven’t watched an entire video, but I fast forwarded a couple of videos and while the erronous ones got out of sync audio after fast forwarding, the new “MPEG-1 layer 3″ ones did not!

Now I also understand the remark at the PSP wiki about the audio encoding at 48000 KHz, it’s not the encoding for the video to be converted to MPEG4, but it’s the frequency of the AAC audio encoded in the MPEG4 itself.

Now if you’ll excuse me, I’m going to watch some Pure pwnage on my PSP.

[Last played: Slayer - Dead skin mask]

November 10th, 2005

Programmatically editting: Outlook 98 and Outlook 2000

Better than ‘97

Now it’s time for Outlook 98 and Outlook 2000 to be covered. Why two at the same time? Because aside from a difference in one registry key, they are exactly the same! Outlook 98/2000 work a lot better than Outlook 97. They have multiple Internet Mail accounts support out of the box and they even allow us to add new POP3 accounts!! So let’s dive right in!

It’s sooooo much simpeler

Where Outlook 97 had all kinds of difficult and obscure registry keys and registry values, Outlook 98/2000 take the Outlook Express model and use a syntax identical to the way Outlook Express stores the accounts.
The location in the registry where the account information is stored is also the only difference between Outlook 98 and Outlook 2000. For Outlook 98 it’s stored at HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Outlook\OMI Account Manager\Accounts and for Outlook 2000 it’s stored at HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\OMI Account Manager\Accounts. That’s it. Aside from this, they’re identical.
Underneath this key are subkeys whose name is an 8 character hexadecimal number. Underneath those subkeys are the accounts Outlook has configured. The value with the name “Account Name” contains the number the next new account should use. So this is useful if you want to add a new account. Read this number, increase it by one and write it back. Remember though, this is important, that it’s a HEXADECIMAL number. I fucked up on that one at first. You won’t notice until you add a new account for the tenth time, then weird shit(™) happens.
The key with the name “Default Mail Account” contains the number for the default mail account. This is the account that will be used for sending e-mail, unless the user specifies that an e-mail should be send from another account.

An Outlook 98/2000 account

Like I said, the syntax is identical to that of Outlook Express. The following entries are possible for a POP3 account:

  • Account Name: Name of the account as it appears in Outlook
  • POP3 Server: Server for receiving e-mail
  • POP3 User Name: Username to log into the receiving e-mail server
  • SMTP Server: Server for outgoing e-mail
  • SMTP Email Address: The e-mail address to use when sending e-mail (this will be the address used when the receiver replies)
  • SMTP Display Name: The nice name people see from whom the mail is

These are all string values (REG_SZ). There are also a few other interesting non-string values:

Connection Type (DWORD)
A value of “1″ means the account uses the same dialer settings as Internet Explorer does. A value of “2″ means the account has it’s own dialer-entry configured (or actually a name to a dialer-entry that’d better exist). Any other value means the account will connect through the LAN.

Connectoid (string)
This is only useful if the “Connection Type” has a value of “2″, because then this key contains the name of the dialer-entry Outlook will dial when sending or receiving e-mail for this account. The key can be present even if the “Connection Type” is set to something else than “2″, it’s just ignored then.

POP3 Prompt for Password (DWORD)
A value of “1″ means Outlook will ask the user for the POP3 password when receiving the e-mail for this account. A value of “0″ means it won’t. Simple.

Adding a new account

Yes! Finally! Wiht Outlook we can now ADD NEW ACCOUNTS!
To do this, just create a new subkey like I said at the start of this article and fill in the blanks! It’s that simple. One important thing to know though, is that Outlook should be closed when you do this. There will not be any problem if you won’t, but Oulook does not automagically detect the newly entered account, so it might seem like it doesn’t work. Close, Outlook, enter the account, start Outlook and it should be there and working!
The only problem is that I don’t know how to enter the password, so set the “POP3 Prompt for Password” key to “1″ and it just asks the user, who can then choose to have Outlook remember the password.

That sums it up for Outlook 98 and Outlook 2000, next up: Outlook XP and Outlook 2003 (they are even more the same).


[Now playing: The Presidents Of The United States Of America - Stranger]

November 10th, 2005

Sony PSP video encoding

I got me a Sony PSP a few weeks back and so far I only used it for games. It is a handheld gaming device after all! But the device can do more. It can show photo’s, it can play music and it can show movies! Not only the insultingly expensive UMD movies, but you can also store MPEG-4 encoded movies on the memory stick and play them! Since I have a load of Channel9 videos I still want to watch, I though it would be a great idea to encode them for on my PSP, so I can watch them in the train. So I found an article on how to encode the videos. I downloaded a free program to convert the Channel9 WMVs to AVIs. Downloaded the program used in the article for encoding the AVIs into an MPEG-4 format the PSP likes and tried a small video. It worked! Great! But it was late, so I went to bed.

Next day, at work, I decide to download the programs to my workstation there (faster machine than I have at home) and do some encoding while I work on other stuff. I get some of the WMVs, convert them to AVIs, convert them to MPEG-4s and at the end of the day, store them on my PSP and go home.
Then I try to play a video, but all I get is an error saying: “This video cannot be played”. WTF!!!!
Then I spend most of the evening at my girlfriend, with my laptop trying to get a video encoded and working on my PSP. All to no avail. I google a lot, even find a Wiki on the subject. I use the encoding specifications from the Wiki, but still no go.
I go home for the night and decide to try some more before I go to sleep. Lot’s of trial-and-error later and I have it working, perfectly.

Here’s the deal:
Your input video (the video you will convert to MPEG-4) MUST have sound at 22050 Hz. It cannot have no sound and it cannot have sound at another frequency. The PSP wiki claims that only 24000 is supported, maybe in an older firmware, but on my PSP it’s 22050 ONLY! Bitrate of the sound doesn’t seem to matter much. I tried at 40 Kbps, 48 Kbps and 56 Kbps, all worked perfectly.

Your input video also MUST have one of the following resolutions:

  • 320×240
  • 352×240
  • 352×288
  • 360×240
  • 260×288
  • 384×288
  • 640×480
  • 704×480
  • 720×480

I haven’t tried resolutions higher then the last one. It’s no use, the resolution of the PSP display is 480×272, so it’s not really useful.
All these tests were with videos running at 29.97 fps. I have not tried other framerates, although the first test video I encoded was at 15 fps, so I think others will work as well.

Then for the output video. I got it working succesfully with the QVGA profile at the following video-/sound-rates:

  • 1500 Kbps/128 Kbps stereo
  • 768 Kbps/128 Kbps stereo
  • QB4/96 Kbps stereo
  • QB7jA/96 Kbps stereo
  • QB10/96 Kbps stereo

And with the 368×208 profile at the following video-/sound-rates:

  • 1500 Kbps/128 Kbps stereo
  • 768 Kbps/128 Kbps stereo
  • QB4/96 Kbps stereo
  • QB7/96 Kbps stereo
  • QB10/96 Kbps stereo

Videos encoded this way work without a problem on my PSP, although I must admit I haven’t watched a full hour of video yet. I read stories about videos giving errors halfway through, but so far, so good!

Update:
I ran into another problem converning out of sync audio. Read the solution in this article.
[Now playing: Testament - Reign Of Terror]

November 5th, 2005

Sony is still at it

Earlier this week I pointed to a blog entry by Mark Russinovich at SysInternals about his discovery of the Sony DRM on their new CDs. This DRM installs a rootkit and poses a security threat to your computer. Or can enable cheating in popular online games.
During this week, Sony provided an uninstaller for their DRM rootkit, or so they claim. According to Mark this isn’t exactly the case. The uninstaller simply unloads the DRM driver. However, because of the way the DRM rootkit works, unloading the driver at runtime can cause a crash (blue screen), which can result in data loss. Sony still hasn’t fixed that and the files for the rootkit are still on your system. To make matters even worse a commenter on Mark’s original blog post noted that the Sony software even calls home (makes contact with Sony’s servers and send some information about you or your computer) whenever you play a Sony copy protected CD. The use of which seems intended harmless, but the data obtained can be used fo evil.
Ohyeah, did I mention that to get the ‘patch’ to Sony’s bugged and undocumented rootkit, you need to provide an e-mail address which Sony adds to their marketing files?

[Now playing: Nine Inch Nails - Terrible lie]

November 2nd, 2005

Using an Instant Messenger for syndication

This is an idea I had myself for quite some time now and, frankly, it’s not even my original idea. The people working on XMPP (Jabber) are way ahead of the curve here with their PubSub extension for XMPP. But this week I read about a dutch newspaper which launched a new service where you can add a specific MSN account to your MSN contacts list and when you sign into MSN that account will send you the latest headlines per MSN messenger within 10 minutes after you signed in. And if you send a message to that account it will interpet it as a search request, searching the news with the words you specified.
I like this and I’m really excited that companies are starting to see the power of this. As Peter Saint-Andre already stated: E-mail must be destroyed! Yes, I still use e-mail a lot, but the young kids these days use IM (MSN, or Yahoo, or whatever) and hardly touch e-mail. With the ability to block people and block messages from people not on your contactlist spam or other unwanted messages are not an issue. Instant Messaging and Peer-to-Peer communication is the future. You better be ready for it!

[Now playing: Fear Factory - Crash test]

November 1st, 2005

Watch out when buying CDs from Sony BMG

I know I’m going to be very careful when buying a new CD next time. Mark Russinovich from the excellent Sys Internals website has a “great” story about the DRM that is present on some Sony CDs. If there is anyone who has the CD, do all of us a favor and sue Sony for damages and invasion of property and privacy.

[Last played: Annihilator - Maximum Satan]

|