Display Video Thumbnails in DigiKam

Digikam is working great for me and I’m diligently tagging all my old photos. I was disappointed that, although DigiKam could play them, it wouldn’t display thumbnails for video files in my albums. Turns out that I just needed to install the mplayerthumbnails package and now I have thumbnails. In Ubuntu Jaunty, ignore instructions which suggest adding libarts1-xine and libxine-extracodecs — neither package is available in Jaunty.

Virtualbox Setup to Run Windows XP Inside Ubuntu Jaunty

I had no trouble with the initial virtualbox-3.0 install from Sun’s repositories. I popped in my old Windows XP Home Edition Service Pack 1a CD and installed the software on a virtual disk — all of this was easy to do and required no special tricks.

I did learn something important, however: I tried to install SP2 of XP and kept getting a blue screen on reboot. I tried every combination of updates and rollbacks I could think of, but could not get SP2 to install. I wouldn’t have bothered, since my Epson scanner software runs fine on SP1a, but I couldn’t install my TV tuner drivers without upgrading.

After a lot of experimenting, I realized that I had to start over and wait to install the VirtualBox Guest Additions until AFTER installing all the XP updates and Service Packs. Everything seems to be fine now.

Hauppauge WinTV-HVR 950Q USB TV Tuner

I purchased a USB TV tuner device hoping to be able to do two things: a) receive (and possibly record) analog NTSC TV broadcasts, and b) accept analog input from a VCR to digitize some old VHS media.

After a lot of red herrings and attempts to install drivers, I finally understood that the device had been detected in Ubuntu Jaunty without any extra effort. Configuring the device was a little more complicated, however. I installed the following packages to help diagnose whether the device was working: dvb-apps, dvb-utils, w-scan. Unfortunately, I’ve discovered that apparently Video4Linux doesn’t support receiving analog signals with this device (my fault for not doing more research, I guess). We don’t have digital signals where I live (and I don’t have digital cable or any other usable sources available).

Potentially helpful info here and here.

Plan B: try to get the device running under Windows XP in VirtualBox.

Installing VirtualBox to Run Windows XP Home Edition on Ubuntu Jaunty

VirtualBox allows you to run a nested operating system on top of Linux. I want to use it with Windows XP (which I have an old copy of) in order to run the imaging software which came with my new Epson Perfection V500 Photo scanner. It may also come in handy if I want to run some of my favourite old games like Age of Empires and Starcraft. The difference between VirtualBox and dual-booted operating systems is that the nested (or guest) OS will be running at the same time as my regular Ubuntu applications — no reboot required. I’m keen to see how it goes.

In Ubuntu Jaunty, the installation was a snap. I followed the instructions in the VirtualBox manual:

First I installed virtualbox with apt-get (you could use aptitude or synaptic, of course), then I added myself to the appropriate group:

sudo usermod -a -G vboxusers kevin

That was it for the initial installation. Next I had to set up the Windows XP virtual machine. After getting a “session3_initialization_failed” blue screen error the first couple of times I tried to install Windows XP Home, I found the instructions here. In particular, the post suggests adding this line

none /proc/bus/usb usbfs devgid=000,devmode=664 0 0

to /etc/fstab where “000″ is replaced by the group id for vboxusers which you can obtain from the /etc/group file. Note that the original post suggests this technique for Ubuntu Intrepid, but it also worked for my Ubuntu Jaunty install.

I now have Windows XP Home Edition running perfectly inside my Ubuntu system.

UPDATE: Turns out to be slightly more complicated than I thought. The virtualbox-ose (open source edition) packages work great unless you want USB support. For that you have to re-install using the virtualbox-3.0 non-free packages available from Sun. I simply added Sun’s repository, installed the other version and everything worked fine from there.

Scanning via USB from a Brother MFC-8500C

I’m still working on digitizing all my old media, including paper. I have an old Brother laser multi-function with an automatic document feeder that I’ve only ever used as a printer and fax. I tried to set it up for scanning years ago, but had no success. Times have changed and I had no problem getting it working this time around so I can scan all my old paper files.

Scanning only works for the root user at the moment, but I don’t care. Discussion here.

Step 1. Download and install the linux drivers which are now available from Brother here. The instructions provided worked flawlessly on Ubuntu Jaunty.

Step 2. As root, Install the sane-utils and libtiff-tools packages.

sudo apt-get install sane-utils libtiff-tools

Step 3. Scan. XSane worked fine for basic scans, but I want to be able to do double-sided scanning on a simplex scanner, so I decided to use the command line for this. There are other tools available if you prefer a gui.

To scan letter-size single sided:

scanimage -y 279 –format=tiff –batch –progress

The “-y 279″ is the page length in mm — without it, scanimage seemed to create legal size scans by default. To scan a pile of pages on both sides, start with side one:

scanimage -y 279 –format=tiff –batch –progress –batch-double

Then, flip over the pile and substitute the last page number (which the previous command will tell you) minus one for “[last page - 1]” below:

scanimage -y 279 –format=tiff –batch –batch-double –progress –batch-increment=-2 –batch-start [last page - 1]

Finally, put the whole thing together in one big tiff and convert to pdf:

tiffcp out*.tif out_all.tif;tiff2pdf out_all.tif -o filename.pdf;rm -f out*.tif

The final rm is added to the previous command so that you can continue scanning jobs without either getting your tiff files mixed up or inadvertently trying to include a finished multipage tiff in the next pdf conversion.

I have written a script which prompts the user for single or double-sided printing and an output filename, then scans and converts documents:

#kk a script to scan a batch of pages on both sides, then combine and convert them to pdf

DATESTAMP=$(date ‘+%Y%m%d%H%M%S’)

#clean up
rm -f $WORKDIR/out*

#prompt for single or double-sided scanning
read -n 1 -p “How many sides ([1]/2)? ” SIDES
if [ "$SIDES" == "2" ]

#scan the first sides
#the end of this command sends progress output to both stdout and to a file
scanimage –format=tiff –batch=”$WORKDIR/out%d.tif” –progress –batch-double -y 279 3>&1 >&2 2>&3 3>&- | tee $WORKDIR/out_count.txt

#figure out what page to start the flip side scan on
LASTPAGE=`grep “Scanning page ” $WORKDIR/out_count.txt | tail -n 1 | sed ‘s/Scanning page //g’`
BATCHSTART=`echo $LASTPAGE – 1 | bc -l`

#give user a chance to flip and refeed the pages
read -n 1 -p “Flip over the pages (counting down from $BATCHSTART) and press any key to continue…”

#scan the second sides
scanimage –format=tiff –batch=”$WORKDIR/out%d.tif” –progress –batch-increment=-2 –batch-start $BATCHSTART -y 279


#scan the pages
scanimage –format=tiff –batch=”$WORKDIR/out%d.tif” –progress -y 279


#combine all the tiff files into one document
tiffcp $WORKDIR/out*.tif $WORKDIR/out_all.tif

#prompt for a filename
read -p “What should I name the document (extension will be added automatically)? ” NAMER
if [ "$NAMER" == "" ]

#convert to pdf
tiff2pdf $WORKDIR/out_all.tif -o $OUTPUTDIR/$NAMER.pdf

The script is pretty basic, but should be easily adaptable for your own purposes. You can save it as, make it executable, and run it with “./”

Creating a Shared Photo Directory

In order to allow my wife and myself to both have access to our common photo directory, I created a folder called /home/photos and set permissions as follows:

As root, create a new group and add users to it:

addgroup photos
adduser user1
adduser user2

Create the folder:

mkdir /home/photos

Set the group:

chown root:photos /home/photos

Set the permissions:

chmod g+rwx /home/photos
chmod a+s /home/photos

The last command sets the setgid bit so that all subfolders and files will inherit the photos group.

And the Winner Is: digikam

I’ve decided to proceed using the KDE application digikam. It seems to do everything I want (plus lots more) and is open source and easy to use. It looks like it integrates with various web services, including facebook and flickr, without difficulty. The only disadvantage I can find is that the image editor doesn’t automatically save new versions non-destructively. I think I can live with that.

F-Spot looks like a good basic photo manager, but it lacks some of the advanced features of digiKam and Picasa and my web research seems to suggest that it chokes on large collections of files.

Picasa looks great and includes all the features I expect I could want. Unfortunately, it isn’t open source and that is a deal-breaker for me.

I’m going to give digikam a try for a while and report back what I find out.

Managing Photos

We have too many photographs! I’d like to get them under control so that we can enjoy them now and preserve them for the future.

We have a dozen albums and a couple of big boxes of old negatives and prints, including some that I developed myself and a few old family photographs that go back to the 1940s. We’ve been taking digital photos for nearly a decade and my photo directory holds over 12,000 items already. On top of all of this, I also have hours and hours of digital video which I’d like to eventually fold into the same management scheme as the rest.

In order to get these in order, I would like to digitize everything. Eventually, I’ll buy or use a scanner for negatives and prints. In the meantime, I want to organize the photos that are already in digital form. That means using a photo manager. I’ve done a little research and there appear to be several options worth considering.

Right now I store everything in a carefully-designed folder hierarchy. All the image files are in folders by batch — each group I upload from a camera is placed in raw form in a folder named by the date I uploaded and a tag for subject matter when the pictures are all similar (e.g. 2007-01-13_kevin_birthday). I avoid spaces in the names and always use YYYY-MM-DD for the date format to ensure that the folders sort correctly. This works well to organize and store the photos, but it isn’t easy to browse or manipulate them. When I want a cropped or renamed version of an image, I save it under a new name and new location to ensure that the raw images are preserved. Over the years, I’ve ended up with some duplicate image folders which I’d like to purge, but I need some tools to help do so. I group the image folders in higher level folders by year (YYYY). This way I can archive each year and back it up without having to worry that the folder contents will ever change. This method meets my basic needs, but I really want something that will allow me to add metadata, manage versions of each image as required, and browse easily.

In fact, what I want is a system very much like what rhythmbox and other tools give me for managing my audio collection. I’d like to keep my directory system for raw photos, store tag data inside the image files themselves, and use a front-end application to browse images using the metadata. I don’t want to be locked into anything so that I can change front-end application at any time in the future. It would also be great to be able to sync some or all of my photo collection with a data store on the web such as flickr, picasa, or other. Oh, and I should be able to do non-destructive editing of the images using the Gimp (or at least in a way that is compatible with the Gimp).

What else do I want? It would be nice to have simple one-click options to correct basic image errors like red-eye and bad contrast. The application should be open source unless I have no other choice.

The options I’ve discovered so far include the default f-spot photo manager which is installed with Ubuntu, the KDE application digicam, and Google’s picasa. There are certainly others out there, but these three seem to be the most popular and robust. I will try them out and report back.

Ripping My CD Collection

Years ago, I ripped all of the CDs in my collection. I’m now considering finally packing away all of the physical CDs or getting rid of them. Naturally, I figured I should sort through all of them to make sure I have digitized them properly. I ended up with a box full of a few dozen CDs that I still need to rip.

I have used the “Audio CD Extractor” program (package sound-juicer) and it works pretty well. I prefer to use grip, however, which provides more control of the file tags and other settings.

For cleaning up my existing files, I’m still using easytag and sound-converter along with the “bulk rename” utility provided when you install thunar.

Multiple Instances of Dropbox on Ubuntu Jaunty

I used this technique to run two dropbox daemons at the same time. I have one dropbox for data and a separate one for portable applications I use on a USB stick when I’m forced to use Windows. I run two instances of dropbox on the USB stick already, but wanted to keep a copy of the portableapps dropbox on my Ubuntu machine as well. Keeping the two dropboxen separate means I have more control over when the two data stores are updated.

Run the following command in a terminal:

HOME=$HOME/.dropbox-alt /usr/bin/dropbox start -i

This should start the dropbox installer. In the wizard, you can create a new account or link to an existing one. “.dropbox-alt” is the directory where I want the installer to download the new instance — you can choose a different location for the actual dropbox sync folder during the installation. Note that the .dropbox and .dropbox-dist folders will still be created inside the .dropbox-alt folder, so don’t panic if it looks empty.

I haven’t tried it, but I presume this method should work for as many instances as necessary.

I don’t want my second dropbox to run automatically, so I can start it up when I want it with the same command without the “-i” (which runs the installer):

HOME=$HOME/.dropbox-alt /usr/bin/dropbox start

The dropbox wiki suggests adding this line to /etc/rc.local in order to run the dropbox daemon at startup (replace “username” with the actual user):

su username -c “/home/username/.dropbox-alt/.dropbox-dist/dropboxd &”

UPDATE: I tried the previous command and it doesn’t seem to work. I’m trying this instead:

su username -c “HOME=$HOME/.dropbox-alt /usr/bin/dropbox start”