blog.kfish.org

My name is Conrad Parker, and I live in Kyoto, Japan. I work with Renesas in Tokyo, designing the Linux multimedia architecture for a new line of mobile processors; and for Wikimedia Foundation, working on Ogg integration for Mozilla Firefox. I am also working towards a PhD in Computer Science at Kyoto University. Free software projects include the Sweep sound editor and the Annodex media system, and various smaller ones that you can read about here.

Tuesday, 27 September 2005

Transcoding through fifos

When converting media files from one format to another (transcoding), a lot of intermediate data is generated: you plug a decoder into an encoder, and many megabytes of raw, uncompressed media data are shovelled between the two. Ideally you don't want to write this data to a disk file. The old-school Unix way to handle this is to use a named pipe:
#!/bin/sh

INPUT=$1
BASE=`basename $INPUT`
OUTPUT=`echo $BASE|sed -e "s/\\.[^.]*$/.spx/g"`

FIFO="${TMPDIR-/tmp}/$BASE.$$"
mkfifo $FIFO

mpg123 -w $FIFO $INPUT &
speexenc $FIFO $OUTPUT

rm -f $FIFO

m2anx is a much longer script using this technique to transcode (and optionally annodex) from any format supported by mplayer to Ogg Theora, Ogg Vorbis or Ogg Speex. It uses multiple named pipes to handle the audio, video, and muxing in parallel, and uses a shell trap to clean up the named pipes on exit.

The new-school Unix way to handle this problem is to build media pipelines using GStreamer. If you're just after a simple and reliable command-line theora encoder try ffmpeg2theora.

Labels:

Thursday, 22 September 2005

Creative Commons licenses to be DFSG-free

Licenses for Free Media and Free Software must be compatible for people to be able to develop and distribute hybrid works. Increasingly, software contains media components like video splash screens and photo interfaces. Similarly, new media works have interactive components with increasingly complex scripts, and artists are benefiting from sharing source code.

According to this debian-legal article, Debian is working with Creative Commons on drafting DFSG-free licenses. This will allow Debian to distribute CC licensed works, but will also allow more interplay between the Free Software and Free Media communities.

Some of the social and business models that have developed around the Free Software community will be adapted to Free Media. For that to happen, it needs to be legally possible to put both Free Software and Free Media on the same CD and ship it, and currently that is not possible.

This issue was discussed at Sydney DebSIG in July, What can Free Software teach Free Media?.

Labels:

Friday, 16 September 2005

Killer boids, flocking in circles!

In 1996 I wrote a boids applet in Java, and it was shown in art galleries and stuff. Those were wild and crazy times.

O'Reilly recently released Killer Game Programming in Java by Andrew Davison. A sample chapter about Flocking Boids [PDF] is available online, and it's a very interesting read. The design of the Java code in that chapter references an article I wrote describing the boids algorithms in pseudocode, which in turn was based on my old Java code. The book brings that code full-circle, and adds some cool predator/prey behaviour and obstacle avoidance. And real trigonometry -- luxury!

Apparently my idea of pseudocode at the time was an over-processed mash of Pascal and Basic, spooned out so as not to offend anyone's language preferences (or in order to offend everybody's equally). If you'd like to be offended in the language of your choice, there are also versions in C, Python and Javascript/DHTML linked on my boids page.

Labels:

Friday, 2 September 2005

New Free Media about Free Software

James Purser has been producing Linux Australia podcasts, including an interview with Silvia Pfeiffer [35MB Ogg Vorbis] about annodex.

Earlier this week I took the opportunity to interview Pia Waugh [29MB Ogg Theora] about Software Freedom Day, which is happening on September 10th and promises to be a lot of fun. Thanks to Andrea Pedersen for producing the video.

New Free Software for Free Media

RhythmBox is very close to having podcasting support: Mike Urbanski has been working on it for a while, and Renato Araujo (who works with Flavio Oliveira at INDT) has recently been working full time on it [PATCH]. It'll be great to have such an easy, integrated way to subscribe to free music and news feeds.

Nathan Yergler at Creative Commons has released version 1.5 of their web service for license selection, for use by websites providing hosting and distribution of free media. It uses a very well-defined REST interface and sample code is provided for Python and Java clients. Please join the cc-devel community to help bring the ideals of free software to free media, and to help build the technology to make it happen.

Labels: ,