Friday, March 20, 2009

Batch transcoding with VLC

I have a bunch of MPG videos from my videocam but neither iPhoto nor iMovie would recognise them. Now VLC has a transcoding wizard that'd do the conversion to MP4 nicely, but to do it interactively through the GUI is just too tedious. Using this tip from the VideoLAN Wiki, I used a script to perform the batch transcoding:

#!/bin/bash
vcodec="mp4v"
acodec="mp4a"
bitrate="3072"
arate="192"
ext="mp4"
mux="mp4"
vlc="/Applications/VLC.app/Contents/MacOS/clivlc"
fmt="MPG"
dst="/Dest/Path/"
for a in *$fmt; do
  $vlc -I dummy -vvv "./$a" --sout "#transcode{vcodec=$vcodec,\
  vb=$bitrate,acodec=$acodec,ab=$arate}:standard{mux=$mux,\
  dst=\"$dst$a.$ext\",access=file}" vlc://quit
  touch -m -r $a $dst$a.$ext
done

If you want to try this on Linux or Windows, you should use vlc instead of clivlc. I included the touch command so that the transcoded videos would still have the original capture date/time as their last modified date.

Thursday, March 12, 2009

ISBN to BibTeX Converter

Kenjutsu posted about an ISBN to BibTeX converter in comp.text.tex. Given an ISBN e.g. 0471976970, it returns:


@book{0471976970,
Author = {D. Grune and H. Bal and C. Jacobs and K. Langendoen},
Title = {Modern Compiler Design},
Publisher = {Wiley},
Year = {2000},
ISBN = {0471976970},
URL = {http://www.amazon.com/Modern-Compiler-Design-D-Grune/dp/0471976970%3FSubscriptionId%3D0JYN1NVW651KCA56C102%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0471976970}
}


The author of the converter stated that he's obliged to include the link to Amazon to comply with the terms and conditions for using Amazon's Web Service API to generate the information.

The converter accepts both 10- and 13-digit ISBNs, but doesn't seem to be able to recognise books with editors instead of authors (you know, a collection of articles). Still, it can be useful.

Friday, March 6, 2009

Episode IV — now in ASCII art!

I first came across this at Random Determinism, where there's an embedded YouTube version as well. But I thought to myself: Is this a geeky blog, or what?[1] And so — open up a terminal and go

telnet towel.blinkenlights.nl

Enjoy!



[1] OMG I can't believe I just admitted that OMG OMG OMG OMG...

Tuesday, March 3, 2009

The Pink Jedi Again


Notice the giant Vader in the background? :)


This would make a nice parody movie poster. One of these days, when I have some precious free time on my hands...