Wednesday, September 30, 2009

Eye-Fi and workflows

What is your digital photography workflow? Most amateur photographers like me probably don't think about it very often. It's the theme of this post because I bought an Eye-Fi Explorer card for my new camera and it's whole purpose is to change how you handle digital photos.

The story of the new camera is pretty standard. My old Canon S230 broke (note to self: don't let a 2 year old use the new camera). To replace it I got a Canon SD980 which records HD video (720p h264) and has a 24MM wide angle lens (the extra wide angle is nice). Like most new cameras it uses SDHC flash cards and that research lead me to the Eye-Fi.

The Eye-Fi card is an SHDC card that can connect WiFi networks and upload pictures to your computer. The software that receives the pictures can then use the log of WiFi networks to Geotag each picture. Okay, that really glosses over this amazing miniature technology but it's enough for this post. At $100 it's significantly more expensive than a standard 4GB SHDC that are around $15 now, but I imagined all the cool things it could do and it seemed worth the premium.

This is my workflow:
  1. After I take the photos, I put the SD card in a card reader and plug it into my computer.
  2. Then I run a script which copies all the files on the card to a folder on my web server. I just tell it the name of the folder to put the files in.
  3. Last I view the folder in my web browser on my picture gallery site to add descriptions and delete any pictures that are not worth saving.
I expected the Eye-Fi card would let me skip the first 2 steps, but quickly discovered a few of its limitations. First the Eye-Fi card won't delete files after it has transferred them to the server. This puts a big kink in my plan, as I either have to manually delete each photo on the camera after verifying that it has been uploaded to the server or keep doing the first 2 steps. The other issue I discovered was that the video recordings on my nice new SD980 had audio static noise caused by interference generated by the radio transmitter in the Eye-Fi card. This meant I couldn't use the Eye-Fi card in my new camera, and while the company was aware of the problem they couldn't provide any assurance that it would ever be fixed.

There's no doubt the Eye-Fi card is an amazing device. The company seems to be friendly to the small group of Linux users who have made a few versions of the receiving software. I even added geotagging to one for my own use. If the issues I found are ever fixed will definitely try Eye-Fi card again.

Friday, July 24, 2009

Hosting your own photo gallery

If you're a serious shutterbug you probably know about Flickr, Picassa, and SmugMug. Here's another option: you can host your gallery on your own server for free! There are numerous programs you can use to accomplish this and I've tried a lot of them (oh yes there are a lot!), but I never found one that was quite right for me. I wanted something simple with an easy interface that would automatically process my pictures and store any descriptions I added inside the original jpeg file, so I wouldn't lose them if I switch to another program later.

Being a software pro I decided to write my own program. Late in 2006 I began working on my program and soon published my "Ben's Picture Gallery" project on Sourceforge (later moved to GitHub). I realize the name isn't very creative but it's hard to choose a good one. I worked on it through 2007 and then moved on to other projects. This year I finally came back to this project and gave it a modern web standards-compliant upgrade. Thanks to jQuery it got a lot of cool interface features. It also plays much higher quality videos with h.264/mp4.

I have over 16,000 photos that occupy 46 Gigabytes of hard disk space. My collection is growing at a rate of about 10 Gigabytes per year, and I expect this rate will more than double if I buy a video camera. That's a lot of photos! At this rate I'm likely to stay well over the free quota limits of the popular sites like Flikr so I'll probably keep hosting my own pictures for a while.

It's actually not that difficult to host this on your own stay at home server so your friends and family can view them anytime. You need to run a web server and install your photo gallery software (on a Mac it is as easy as turning on "Web Sharing" in the System Preferences). You also need to get a dynamic DNS name from a service like DynDNS. Finally you'll need to open up port 80 on your router to let visitors access your web site. That's it!

Thursday, March 19, 2009

Homemade USB multi-charging

USB is quickly becoming the worldwide standard for battery charging. Most new small electronic devices come with a USB cable that will charge it. This is a great feature to look for when buying a new device. It's more convenient for you and better for the environment when you use a single cable and power adapter to charge multiple devices. Unfortunately due to myopic designers and legacy devices, many of us own devices that don't have USB connections. Luckily it's not hard to fix many of these devices.

I wanted to travel with a minimal charging equipment, and have convenient charging for multiple devices at home. I had 2 mobile phones, an iPod, a GPS, 2 digital cameras, and a number of other devices that used AA and AAA batteries. Except for the cameras I can now charge everything from a single USB hub. I plan to make this a high priority next time I buy a camera.

This is what I used:
  1. USB power adapter (search ebay for "usb charger"). They are cheap and small and you can get one for your home and car.
  2. a USB hub (also cheap and small on ebay)
  3. USB AA battery charger (ebay again, also charges AAA bateries)
  4. a few old USB cables
  5. a soldering iron, solder and heat shrink tubing

For small devices (like mobile phones) check the markings on the chargers. The ones that output 5VDC (that's 5 Volts of DC power) can be converted to USB. All you need to do is cut off the cable and replace the wall brick with a USB plug. When you solder the USB plug just make sure the pins 1 and 4 match the polarity of the power adapter for your device. A basic multimeter and the USB pinout will help.

For my phones I cut the plugs from the original charger and an old USB cable then soldered them together. The GPS was new enought to charge with USB, but the iPod was more involved.

You'll probably find out that iPods, and many other devices that use Mini USB charging cables only charge from the original cable. This is because they have added extra resistors and designed the device to only charge when it detect them in the original "charger" cable. The iPods have the resistors in the power brick so you need to make a special USB cable for it and add some resistors to convince the iPod to charge (four 47K resistors work well). Motorola put the resistors in the end of the mini-USB plug, so you can just cut the original cable and use the original plug.

Have fun and don't forget good ventilation when you are soldering.

Monday, March 9, 2009

iCal reads Exchange calendars with Exchangeling

Recently my workplace decided to require everyone to use Exchange 2007. If you are a Mac or Linux user and work in an organization that uses Microsoft Exchange you know it's not much fun. The email isn't reasonable cross platform since it supports IMAP (even if it has a few bugs), but the calendar virtually requires using Windows.

If you have a Mac you can try to use Entourage but it's a resource hog and not well supported. You might try to use the web version (Outlook Web Access) but unless you use Internet Explorer it's almost worthless. You could also use Windows with Remote Desktop or a virtual machine but that's not very convenient.

Luckily one of my co-workers found the Exchange web service reference and we used it to build a Java application that converts calendars to the iCalendar format. If you find any of this interesting you'll want to take a closer look at our Exchangeling project. It's the missing iCalendar feature for Microsoft Exchange.

Monday, January 5, 2009

Making an AppleTV into a MythTV Frontend

The AppleTV makes an excellent MythTV frontend that can play 1080i HDTV. Buying a used one on Ebay is probably the cheapest way to get a HD capable frontend for MythTV.

I was curious about the stock AppleTV software, so I tried it for a few days but found it too restrictive. The picture browsing was only usable for a small number of pictures and the video player could only play a few video formats. The YouTube and Flickr features seemed nice but were not essential features to me. If you like the iTunes store then you might want to keep using the AppleTV software as that's what it was designed for.

But this is about MythTV and it's time to move on to the good stuff.
As this is a followup to my earlier MythTV post you'd already need the MythTV backend setup.

What you need:
  1. an AppleTV
  2. a USB flash drive 1GB or larger
  3. a USB hub, keyboard, and mouse
  4. a programmable universal remote control
    (my Harmony 550 from Newegg is great)
These are the steps:
  1. Connect the AppleTV to your TV/projector with the HDMI cable and whatever audio cables you want to connect.
    I got my cables from MonoPrice (they have HDMI to DVI cables if you need one)

  2. Create a bootable USB flash disk

  3. Backup the AppleTV software

  4. Reformat the internal drive for Linux

  5. Install MythBuntu 8.10 (I have upgraded to 9.04 without any problems)
    you'll need the keyboard and mouse for this
    choose the latest Nvida driver (I used version 177)
    enable VNC during the installation so you won't need the keyboard and mouse later

  6. After installation remember to do the "Post Boot Fixes"
    The ones for "Mythbuntu Hardy" also work for 8.10 (Intrepid)

    In the /usr/sbin/ file I had to use 200,720 for GPU2DClockFreqs instead of the recommended 200,800 (the 177 driver won't allow overclocking above 720).
    This fixes 1080i playback stability (no more green distortion and freezing).

  7. Setup the remote control (follow the instructions from this link)
    These are most of the files and commands you'll need to use.
    sudo /etc/init.d/lirc stop
    sudo irrecord -H macmini -d /dev/usb/hiddev0 /etc/lirc/lircd-new
    irw /dev/lircd
    sudo /etc/init.d/lirc start

    The Apple remote has only 6 buttons, so have your programmable remote "learn" those 6 and then hold the menu and play button for 5 seconds and then the Apple remote will have 6 new codes for your programmable remote to learn.

    If the remote repeats buttons too quickly increase the repeat value in ~/.lirc/mythtv (mine is set to 5 and and the delay is 0)

  8. Edit /etc/X11/xorg.conf and remove all the extra screen resolutions
    (my projector is 1280x720 so I left that one and removed the rest)

  9. Autostart irexec
    Applications -> Settings -> Settings Manager -> Autostarted Apps
    add command "irexec -d"

  10. The AppleTV CPU is not very powerful so you'll want to disable CPU intensive MythTV theme options
    • Setup -> Appearance
      "Use Transparent Boxes" unchecked
      "Popup Background Shading Method" None
    • Setup -> TV Settings -> Program Guide
      "Guide Shading Method" Eco
    • Setup -> TV Settings -> Playback
      "Current Video Playback Profile" CPU--
      "Display thumbnail preview images of recordings" unchecked
      "Display live preview of recordings" unchecked

  11. I setup a rsync cron job to sync my pictures to the AppleTV hard drive
    rsync -rl --delete --size-only --stats -h -e 'ssh -c blowfish' ~/photos/ appletv:/var/lib/mythtv/pictures/

  12. I keep all my video files on my backend with the big hard drive and use NFS to mount them on the AppleTV.
    edit /etc/exports on the backend to share the NFS directory
    edit /etc/fstab on the frontend to automatically mount the NFS shared directory

One caveat is that the TV/projector needs to be turned on when the AppleTV is booted or Xorg won't detect/enable the display and won't startup. If you know how to solve this please let me know.
UPDATE: This is resolved thanks to Will's comments. The forum with the solution is here, and the concise version is:
  • run xvidtune -show
    edit the /etc/X11/xorg.conf file
    add the output from xvidtune to the "Monitor" section as a "modeline"
    add Option "ExactModeTimingsDVI" "True" to the "Screen" section
    add Option "ConnectedMonitor" "DFP" to the "Screen" section