TEDx Montréal Quartier Latin: Lending an (un)helping hand

Check out my TEDx talk done in October 2010 in Montréal, QC! I am always closing my eyes in photographs and this could not be the exception.

Jorge Silva argues that when designing assistive devices biomedical engineers should seek to “scratch where it itches.” By adopting alternative business models such as open source systems, users of assistive devices are revolutionizing design and production processes, creating technologies that fit the needs of a larger population.

J-Doc got Sparked

Pretty cool piece by Nora Young and the rest of the CBC Spark team about some of the work we have been doing over at the Adaptive Technology Resource Centre.

Check out the podcast here:
http://www.cbc.ca/spark/2009/06/episode-82-june-17-20-2009/

and the video clip Nora mentioned here:

Grab video from a DV camera with Kino

First, you need to make sure you have kino installed:

$ sudo apt-get install kino

then, connect your camera with the firewire cable and make sure the
iee1394

module is loaded. Doing:

$ lsmod | grep ieee1394

should give you:

ieee1394              108288  4 dv1394,raw1394,sbp2,ohci1394

Now make sure the device
/dev/raw1394

has been created. Doing:

$ ls -all /dev/raw1394

should give you something like:

crw-rw---- 1 root disk 171, 0 2009-06-10 09:56 /dev/raw1394

Also, make sure
/dev/raw1394

belongs to either the
disk

or
video

groups. You will notice in the output above that my
/dev/raw1394

belongs to the
disk

group, so it’s ok, but if this is not the case for you, then you can fix it by doing:

$ sudo chown root.disk /dev/raw1394

Finally, add yourself to the
disk

or
video

groups (whichever group you added the device to):

$sudo useradd -G [group-name] [user-name]

Now Kino should be able to recognize the camera and you should be able to transfer your videos to your computer!

Hi-Res Duke Nukem 3D on Linux

Screenshot of Duke Nukem 3D with eDuke32

Screenshot of Duke Nukem 3D on Linux with eDuke32

A long, long time ago in a country far, far away, I used to spend hours playing one of the first 3D first person shooter games that allowed me to do just about anything I wanted. It was so cool to be able to turn lights on and off, look at your own reflection in the mirrors (even if the reflection was carrying the wrong gun) and, yes of course, pee, if you felt like it. All of this was possible in the wonderful world of Duke Nukem 3D. So you can imagine my surprise when I discovered I could turn back the clock to my teenage years and enjoy, once again, the full agency of my virtual presence in post-apocalyptic Hollywood, thanks, of course, to the magic of Linux.

The code that will make this happen for you is located on the eDuke32 wiki page. eDuke32 is an open source port of the original engine and it works like a charm. This is how you make it work:

  1. Download and extract the most recent source package. It should be named something like:
    eduke32_src_YYYYMMDD.zip

    , where YYYYMMDD is the release date.

  2. It is also a good idea to download the most recent patch, which will be named
    eduke32_src_YYYYMMDD.diff

    , into the same directory where you extracted the source code.

  3. To apply the patch, do:
    $ patch -p3 < eduke32_src_YYYYMMDD.diff

    from the directory where you extracted the source code.

  4. Make sure you have the required dependencies:
    $ sudo aptitude install libsdl1.2-all libsdl1.2-dev libsdl-mixer1.2-dev libsdl-sound1.2-dev nasm
  5. Now
    cd

    into the
    eduke32_src_YYYYMMDD

    directory and type
    make

    like this:

    $ cd eduke32_src_YYYYMMDD/
    $ make
  6. More detailed information is available on the eDuke32 site, the eDuke32 wiki and the high resolution pack site. Enjoy!

Video editing with Linux

Convert to FLV:

$ ffmpeg -i original_video.avi -qscale [quality] -s [WxH] -ar 22050 converted_video.flv

Join multiple videos:

$ mencoder -oac copy -ovc copy -o joined.avi clip1.avi clip2.avi [...]

Extract a clip from a video:

$ ffmpeg -qscale 1 -acodec mp3 -ab 256k -ss [start time in hh:mm:ss] \
   -t [length in hh:mm:ss] -i video.avi clip.avi 

Dump the audio:

$ mplayer -vc null -vo null -ao pcm -benchmark test.avi 

Grab an image from a video:

$ ffmpeg -i movie.avi -ss [time-in-seconds] -vframes 1 -f image2 frame.jpg

Overlay an image on a video:

$ ffmpeg -i input.avi -vhook '/usr/lib/vhook/imlib2.so -x 0 -y 0 -i overlay.png' output.avi

Encode a Windows-compatible video:

$ mencoder -oac mp3lame -ovc lavc -lavcopts vcodec=msmpeg4v2:vhq:vbitrate=1600
  -o videoout.avi videoin.xxx

with a separate audio file:

$ mencoder -audiofile audiofile.wav -oac mp3lame -ovc lavc
-lavcopts codec=msmpeg4v2:vhq:vbitrate=1600 -o videoout.avi videoin.xxx

There is also a good guide on how use
ffmpeg

to create FLV videos for posting online here:
http://scott.yang.id.au/2006/07/flash-video-ffmpeg-flowplayer/