Sunday, December 09, 2007

Digitial cameras and openSuse 10.3

I just recently bought my first digital camera. I took advantage of the Black Friday sales a few weeks ago and bought a Nikon Coolpix S51. It's a small point-and-shoot camera, but it worked out really well for me in Madrid. Maybe later I'll buy a big fancy SLR, but this will do just fine for right now.

I was really excited to use F-Spot to manage my pictures. F-Spot is shipped by default with openSuse 10.3. When I plugged my camera in to the USB port, F-Spot popped up immediately and asked if I wanted to import the photos. Once the import was done, browsing the photos in F-Spot is really simple (and quick).

I also used F-Spot's export feature to post my pics on Picasa. I used Picasa's web uploader to post my first nine pictures, before I remembered that F-Spot can do it for you, and their interface is so tedious. You have to browse for each picture by file name (oof) and you can only upload 5 at a time. F-Spot's export allows you to pick as many images as you want, and because you can see all the thumbnails, selecting which ones to upload is super easy.

Videos are another story. I only took one video while in Madrid, and that was more just playing around with my new toy. But now how do I get this video off the camera? (F-Spot actually does this for you, but I didn't know it. I had to ping F-Spot contributor Stephane Delcroix for help) From Google, I learned that USB cameras behave in one of two ways. One is that the camera gets mounted to the file system and you can manually pull files that way. The other is the camera can only be accessed via USB commands (not sure of the proper terminology here).

I determined that the camera had not been mounted, so in searching I came across gphoto2, a library and command line tool that talks to USB cameras. (I also learned later that F-Spot actually uses gphoto2 to do all its work.)

:~> gphoto --auto-detect
This will show you all the digital cameras currently connected to the computer.
:~> gphoto -l 
This command will list all of the directories in your camera's file system
:~> gphoto2 -n
Number of files in folder '/': 0
This command will list all the files in any directory on your camera. Combine this with the -f switch and info from -l switch to get some useful information.
:~> gphoto2 -f '/store_00010001/DCIM/100NIKON' -n
If you want to get straight to the meat, you can just run --list-files.
linux-dlfm:~ # gphoto2 --list-files
There is no file in folder '/'.
There is no file in folder '/store_00010001'.
There is no file in folder '/store_00010001/DCIM'.
There are 200 files in folder '/store_00010001/DCIM/100NIKON'.
...
#61 DSCN0062.JPG 1653 KB 3264x2448 image/jpeg
#62 DSCN0063.AVI 15664 KB video/x-msvideo
#63 DSCN0064.JPG 1648 KB 3264x2448 image/jpeg
There's a lot more output than this, but this shows you that the video that I want is /store_00010001/DCIM/100NIKON/DSCN0063.AVI Now to pull that video from the camera, use -p.
:~> gphoto2 -f "/store_00010001/DCIM/100NIKON/" -p "DSCN0063.AVI"
So that works. But as I said earlier, F-Spot had already pulled that video for me when I imported all the pictures from the camera. :) It's listed in the import window, where you select all the images that you want to import. It's just not listed in F-Spot's main browsing window, or anywhere else for that matter. But it's on the file system.
:~> find ~/Photos | grep -i avi
/home/rhowell/Photos/2007/11/25/dscn0063.avi
And there it is.

No comments:

Post a Comment