Monthly Archives: November 2007

WordPress or how I stopped worrying and learned to love the database

I’ve switched my blog over to WordPress.

Quite frankly, it was a breeze. I had to some hassles with importing old posts from an RSS feed, but having so few old posts, I gave up on that and just took about 20 minutes of my time to get them into WordPress.

Proper Flash video posting is still wanting. For now, I just put in the raw HTML, but this generates feeds with <object> tags in them, which is not technically legal, and browser-based feed readers like Bloglines will ignore it. Eventually I’ll get around to writing my own plugin for posting FLV videos. Yes, I tried practically all of the existing WordPress plugins for posting Flash video. The problems with them generally come down to either: they’re entirely oriented around posting videos hosted on well-known sites, or they’re too inflexible to have the FLV and SWF off on another host — they assume it’s all on the same host as the WordPress site.

As far as the optional bits go:

  • I’m using the Livetr Theme, because it is fairly pleasant — two column, easy on the eyes, doesn’t assume that all web browsers are obscenely wide. I’ll replace it when I create something better.
  • I’m using reCaptcha, because it’s a neat idea.
  • I’m using wp-cache, because my server is slow.

Oh, better check again that my MySQL database dump script is working.

Video Hosting with Flowplayer and S3

[Note: this is the last (i.e. most recent) of my posts imported from pyBlosxom, and it makes possibly-confusing) reference to that, not WordPress.]

I’d already figured out how to get it into Flash video format. There are sufficient opensource encoders for this, such as FFmpeg, but since I have the giant box of Adobe fun I used their Flash Video Encoder Of course, I ended up running it one more time today after learning that iMovie didn’t do what I want and scaled my movie to a smaller size because I didn’t pay close attention while using it to edit the original video slightly.

I decided to host the actual video on Amazon S3. I determined that if my videos got really popular and went over my colo server’s bandwidth allocation, I’d be paying five times as much for bandwidth than I am paying for it via S3.

I fought with s3sync for a while. I want to get it working eventually so I can script this process better, but I had bizarre problems, like it creating the object, but it being zero bytes in size. So, I went looking for something relatively easy to use for OS X, and I found

S3 Browser. It works great, though it does need manual input of the correct MIME type sometimes.

Rather than bother with putting together my own player, I just used FlowPlayer, because it’s open source and doesn’t seem very annoying.

I uploaded the player .swf file, the .flv video file, and a .jpg as preview image for the movie to a bucket I’d created in S3. It’s important to have the Flash and the data it loads on the same server if you want to avoid Flash crossdomain security issues.

I grabbed some appropiate HTML for invoking the player and changed some of the configuration variables. Don’t forget that part about the controller height.

Finally I figured out how to put raw HTML into reStructuredText so I could put it in my blog. The documented way works, but I wasn’t taking it literally enough and had no end of trouble before I figured out to leave an empty line between the directive and the indented block

Next time I’ll write a shell script or two to do all of this. :) And I’ll figure out how to make it show up usefully in RSS feeds.