elliot's blog

Memory of France by Paul Celan

A poem I come back to all the time. Superficially simple, but with such clear, painstaking and vivid imagery; I love the gentle falling rhythm in the lines towards the end of the poem, how each line pivots around its centre. Shame I can't really appreciate it in its original language (German).

Together with me recall: the sky of Paris, that giant autumn crocus...
We went shopping for hearts at the flower girl's booth:
they were blue and they opened up in the water.
It began to rain in our room,
and our neighbour came in, Monsieur Le Songe, a lean little man.
We played cards, I lost the irises of my eyes;
you lent me your hair, I lost it, he struck us down.
He left by the door, the rain followed him out.
We were dead and were able to breathe.

What do you enjoy?

How do you decide what you enjoy? What does "enjoy" mean, anyway?

Which leads me to the related questions: Why do we engage with art? What do we get out of it?

I am quite obsessed with this as an issue. I spend a huge amount of time and money on music. I love music. I can talk about my favourite bands all day. But my engagement with it is shallow, in terms of how well I can talk about it: I don't understand music in a technical way, even though I think it engages me both intellectually and emotionally. What am I getting out of it?

(I love dancing, by the way. You might not think that. I rarely go to clubs. But I absolutely love dancing. I used to go to loads of club nights at university and just immerse myself in the music, especially the beats and basslines. Now it's restricted to the kitchen while I'm washing up. I don't really like dancing at weddings or parties, mind.)

And recently I've got back into reading science fiction books. I love science fiction, too. Again, though, my engagement is shallow: I know about its history, general themes, I can recognise writers and styles, but I don't theorise deeply about its deeper meanings. I'm happy to just chat about it. (Though I did write a dissertation on JG Ballard and William Burroughs once.)

On the non-art side, I enjoy gardening a lot. I can lose myself when I'm out in the garden, pruning, weeding, sowing, just looking and smelling and hearing the garden around me. I think that is one of my purest enjoyments; I particularly enjoy it because I don't feel I have to intellectualise it. Maybe that's my problem with engaging with art, I think too much about it. Isn't that the point?

I've excluded familial relationships and friendships from this monologue: I don't so much enjoy these, as experience joy (and pain) because of them. Is this the same as enjoyment?

I've also excluded computers. As I work with them all the time, I have a love/hate relationship with them. I can't make a blanket statement that I enjoy programming. Often I don't. Sometimes I find it intensely frustrating and limiting. Other times I find it mind numbing. Then other times I get so engrossed that hours pass without me moving to eat or go to the toilet. It's one of those things.

I suppose what I'm getting at is: I don't feel I have a deep love for any hobby or pastime. Perhaps rather than "love" I should say I don't feel consumed by anything, or driven, or ambitious, or even that passionate. Should I be? Does it matter if I'm not? Is it just the time of year? Maybe I watch people on TV culture shows too much and think I should be able to intelligently discuss my experience of the world, the same way the participants on those programmes do. Perhaps I should just relax.

What do you enjoy, by the way?

(Now I've written all this, I'm not even sure why I did it. Perhaps it's because I've spent the whole day listening to Orchestral Manoeuvres in the Dark, a band I love and have done for 20 odd years. It made me wonder what it is about music that I like so much. And why I place so much importance on a person's music taste as a measure of their personality. I probably shouldn't, but I do.)


Quite interesting. Find out about your online presence.

Here's my QDOS.

Poem attributed to Han-shan (c. 9th Century)

My mind is like the autumn moon
Shining clean and clear in the green pool.
No, that is not a good comparison.
Tell me, how shall I explain?

Talis Library Platform News

I'm the featured team member in this month's Talis Library Platform News.

My favourite thing I wrote in 2007

I do a lot of computer programming, watching DVDs and so forth. But I have a lot of passion for writing. I write a lot of poetry. I know it's not fashionable, but I still do it, whenever the mood takes me. Last year I tried to write for at least 5 minutes every day, with varying success: I eventually stopped doing that, but did carry on writing, sometimes poring over a single poem for two or three weeks while travelling to work on the bus. Occasionally I wrote something good.

This is what I consider one of the best things I wrote last year. I did it on holiday in Wales, sitting in a car park while Nicola and Madeleine were going to the toilet or something. They were away for about 20 minutes, and I put together various bits of imagery from the car park and the rest of the holiday. I then wrote it up a few months later. I like the result. I don't think it's too pretentious (you might disagree), though on reflection it is a bit overwritten; though I think it genuinely has a fair few good lines. Here it is.

Welsh car park 2007-10-28

Queen Mab complains to crows about the gulls;
hobgoblins lunge from mossy limbs
with knotted arms, heads like balls of twine

the brow of the landscape frowns;
pleats of forest shake down the crag's skirt,
a mountain's shoulder shrugs above an elbow lake

as secret waterfalls shudder pebbles;
starlings cascade from the oak like gypsy pegs
round caravan steps; a row of recycling bins -

helmets of buried faery kings,
or giants' trepanned skulls; slapping feet
on the caravan roof, the curved loop of the seagull's call

a smell of dust in a vast car park
tumbles into thin scent of dog roses, stroked flat
by rising wind; a fringe of cloud like an anemone mauls

the peaks; crab skeleton, flesh scooped out;
our skeletons, green with algae, in the estuary flats -
we drive away too fast, and leave these things behind

Doing all sorts of burning, ripping and encoding of video and DVDs and audio (on Linux)

Using Linux every day means that I often grapple with how to re-encode proprietary formats so that I can watch them on the computer of my choice. I also do some DVD ripping and creating new DVDs of home movies etc., for which the Linux command line tools work very nicely (more quickly, more consistently and in a more stable fashion than some of the GUIs).

So I've gathered a whole load of tips on encoding, ripping, burning, culled from dozens of forums, websites, manpages etc.. This, then, is the current state of my understanding on this topic, and hopefully distills many hours of pain into an easily-digestible format. It's not very well organised, but hopefully useful. I should mention that this stuff works on Ubuntu, but your mileage may vary. Here goes.

A note on tools

All of the tools I use are easily installable on Ubuntu, either from official repositories or universe/multiverse. You will also need to install the proprietary codecs if you want to work with them. Here's what I tend to use:

  • vlc media player
  • mplayer media player
  • ffmpeg format transformer
  • mencoder
  • dvgrab
  • dvdauthor
  • dvdbackup
  • growisofs
  • mkisofs
  • sox
  • lame
  • cdrecord

Burning an ISO onto a DVD/CD

To work out where your CD/DVD device is:

$ cdrecord -scanbus
        1,0,0   100) 'HL-DT-ST' 'DVD+-RW GSA-T11N' 'A103' Removable CD-ROM
        1,1,0   101) *
        1,2,0   102) *
        1,3,0   103) *
        1,4,0   104) *
        1,5,0   105) *
        1,6,0   106) *
        1,7,0   107) *

What you're looking for is an entry with something other than a * in it; then get the content of the first column, which is the device ID (here, it's 1,0,0).


cdrecord -v -dao dev=1,0,0 image.iso

setting dev= to the ID you found above, and where image.iso is the path to your ISO image file.

Getting the audio out of a YouTube video into an mp3 file

First off, download the FLV version of the video. This is the tricky bit, but here's how to find it:

  1. Go to the YouTube page for the video
  2. Copy the content of the v parameter in the querystring (the video ID)
  3. View the source of the web page
  4. Search for "f": in the source; following this will be a long text string (the t parameter), e.g. "OEgsToPDskLJFcLZay_H2RO2hijVCxkP". This is some kind of secret token you'll need to do the download.
  5. Construct the URL as follows:
http://www.youtube.com/get_video?video_id=<video ID>&t=<t parameter>

Use your favourite browser or downloader to fetch the file (FLV format).

My new technique for getting the mp3:

ffmpeg -vn -i youtubevideo.flv youtubevideo.mp3

You'll need a recent ffmpeg for some YouTube videos, and will also need mp3 support compiled in to do this conversion.

My old technique for getting the mp3:

Once you've downloaded it, play it through mplayer, resampling the audio at 44.1KHz:

mplayer -vo null -vc null -ao pcm:file=out.wav -af resample=44100:0:0 youtubevideo.flv

Then, use lame to encode the wav file to mp3:

lame -h -V0 out.wav out.mp3

This does a reasonable quality, variable bit-rate mp3.

There are a couple of services which do this (e.g. YouTubeHack) and a command line script, but I couldn't get the services to work, and couldn't be bothered with the command line script.

mp4 or mov to mpg

Use mencoder for this. mp4 version:

mencoder in.mp4 -ovc lavc -oac lavc -o out.mpg

mov version is practically the same:

mencoder in.mov -ovc lavc -oac lavc -o out.mpg

Ripping from a dv camera with dvgrab

dvgrab --autosplit --timestamp --format jpeg

(The camera should be detected automatically, and I think this waits until it detects some input before the capture starts. I use a firewire cable to connect from the camera to the computer.) The files get named after timestamps coming from the film.

Encoding from .avi to .mpg


ffmpeg -i infile.avi outfile.mpg

(though this produces quite low quality output)

This produces better quality (bitrate = 800):

ffmpeg -i infile.avi -vcodec mpeg2video -acodec mp2 -b 800 outfile.mpeg

Encoding from .avi to .mpg suitable for DVD burning

ffmpeg -i finalmovie.avi -y -target pal-dvd -sameq -aspect 16:9 finalmovie.mpg

If you're in the US, changed pal-dvd to ntsc-dvd.

Ripping DVDs to hard disk

(See http://www.bunkus.org/dvdripping4linux/single/index.html for lots of good tips)

May need dvdcss decoder to be installed:

sudo /usr/share/doc/libdvdread3/examples/install-css.sh

Use dvdbackup to rip a DVD to hard disk.
See http://dvd-create.sourceforge.net/dvdbackup-readme.html for full instructions

# Get info. about DVD
dvdbackup -i /dev/cdrom -I

# Rip whole DVD
dvdbackup -M -i/dev/cdrom -o /media/usbdisk/dvdripping

# Rip main feature
dvdbackup -F -i /dev/cdrom -o /media/usbdisk/dvdripping

# Rip title set (in this case, title set 2)
dvdbackup -T 2 -i /dev/cdrom -o /media/usbdisk/dvdripping

# Rip title (here, rip title 1)
dvdbackup -t 1 -i /dev/cdrom -o /media/usbdisk/dvdripping

Direct DVD copying

This effectively copies the DVD's iso image to hard disk:

dd if=/dev/cdrom of=file.iso bs=2048

If the disk is encrypted, this might fail. In this case, it might be worth running this first:

dvdbackup -I -i /dev/cdrom

Then try dd again.

See http://gentoo-wiki.com/HOWTO_Backup_a_DVD#dd for more details

Note that this produces a mountable DVD image. However, it does not remove encryption, so you would still need to rip to individual VOBs using dvdbackup to get rid of that. However, it is possible to mount the iso and play it as if it were a DVD (see later): vlc is good for this.

Playing a partially ripped DVD

If you've ripped some of the content of a DVD (e.g. using dvdauthor -i /dev/cdrom -F), you can play the partial rip with:

mplayer dvd:// -dvd-device <ripped_dvd_directory>

(vlc might also be able to do this)

Encoding audio out of a VOB file (note that this drops the video altogether)

mplayer -vo null -vc null -ao pcm:file=outfile.wav infile.VOB

You could probably use ffmpeg for this, too.

Creating a DVD using dvdauthor when you don't want the whole disc

If you just have the main feature (a set of .VOB files) and you want to create a playable DVD from them.

Create a dvd.xml file in the top level directory of the ripped DVD (e.g. in VIDEO_TS)

  <vmgm />
          <vob file="VTS_01_1.VOB" />
          <vob file="VTS_01_2.VOB" />
          <vob file="VTS_01_3.VOB" />
          <vob file="VTS_01_4.VOB" />
          <vob file="VTS_01_5.VOB" />

(Adding another element for each VOB which you want included in your "movie". Note that these can equally well be your own mpg files.) You can also add titles etc.: see the man page for dvdauthor for more details. This works fine for me, though.

Then run it with:

dvdauthor -o <output directory for DVD structure> -x dvd.xml

Burning complete DVD structure to a new DVD

See http://www.linux.com/articles/53702

(I think you might need to have used dvdbackup -M (complete rip) for this to work, or have a DVD structure created using dvdauthor (see above))

growisofs -dvd-compat -Z /dev/cdrom -dvd-video <ripped dvd structure>

Creating an iso from a ripped DVD structure

If you've ripped the structure of a DVD (e.g. using dvdbackup) or created your own DVD structure (e.g. using dvdauthor), you can turn it into a single iso file with:

mkisofs -dvd-video <ripped dvd directory> | dd of=file.iso obs=32k seek=0

Mounting an iso filesystem so you can read it

mkdir mountpoint
sudo mount -o loop file.iso mountpoint

Once mounted, you can play the mounted iso (including its menu system) using vlc. For example, if we mounted it on the directory "mountpoint" we could do:

vlc dvd:///path/to/mountpoint

Encode VOB to mpg

If you ripped a VOB off a DVD but you want a smaller mpg:

ffmpeg -i VTS_01_1.VOB -vcodec mpeg2video -acodec mp2 -b 1000 sleeper1.mpg

Ripping RealPlayer streams

See https://help.ubuntu.com/community/HowToRipRealaudioStreamsToMp3 for full instructions

Short version:

vsound --timing --dspout --file=myfilename.wav realplay http://url.to.rip

Ruby script for converting from m4a (iTunes format?) to mp3

This is a shell script for converting files from m4a to mp3. It uses mplayer and lame behind the scenes. sox is supposed to do this, but I can never work out how to install proprietary codecs for it. This doesn't retain tags, unfortunately. Sneetchalizer will probably also work.

# only works if the script is in the directory with the m4a files
prefix = "new_file_prefix"
Dir['*.m4a'].each do |f|
  new_filename = prefix + File.basename(f).gsub(' ', '_').slice(3..-5).downcase
  wav = new_filename + ".wav"
  mp3 = new_filename + ".mp3"
  `mplayer -ao pcm:file='#{wav}' '#{f}'`
  `lame -h -b192 #{wav} #{mp3}`
  `rm #{wav}`

Ruby script for converting from ogg to mp3

Uses ogg123. This script loses all the tags, though. Sneetchalizer would do this, too.


filename = ARGV[0]

if filename.nil? or !(/\.ogg$/ =~ filename)
  puts "I don't think that's an ogg file, mister"

base_filename = filename.chomp(".ogg")
mp3_filename = base_filename + ".mp3"

`ogg123 -d au -f - #{filename} | lame - #{mp3_filename}`

mp3 to ogg

Bit basic, this, but you get the idea:

mpg321 -s input.mp3 | oggenc -r -a "artist" -t "title" -b 100 -M 140 -o output.ogg -

ogg to wav

sox is OK for this, as neither codec is proprietary:

sox input.ogg output.wav

BBC iPlayer Ruby code

I threw together some code for querying and parsing the BBC iPlayer search pages and emailing the results to you. You configure it by putting the names of the programmes you want to look out for into config.yaml, along with your email details, e.g.

  - mighty boosh
  - lead balloon
  - never better

  email_to: email@example.com
  email_from: email@example.com
  server: mail.example.com
  user: email@example.com
  pass: password
  auth_type: login

Copy the sample config.yaml.dist to config.yaml in the same directory and edit.

I run the command line script via cron once a day by calling the cli.rb script with an --email switch, e.g. with the following line in crontab:

0 21 * * * /usr/bin/ruby /home/ell/dev/iplayer/cli.rb --email

You could as easily run it from a Windows scheduled task.

Dependencies are:

  • hpricot
  • rack

What it does is request the iPlayer search page with each search term, one after the other. If there are multiple pages of results, it fetches each of those too, aggregating the results. It will then email you a list of links to the programmes on the iPlayer site. One thing it does which the iPlayer search page doesn't do is sort the matching results by how long is left for you to watch them: the ones with the least amount of time left are at the top.

You can also run it as a local web server on port 3334 with:

ruby server.rb

Which then becomes accessible at:


Nothing fancy: just an HTML page with the search results in it, using the same config. as the command-line client. You can also call the page with extra search parameters to perform custom one-off searches, e.g.


It's not a serious project, just a convenience for me. GPL licence.

Syndicate content