Using Cheese as a Photobooth



Hi all,

I have had some success in the idea of a photobooth, thanks to a vibrant OpenSource Community.  I inquired on Linux Questions about a script to watch the Webcam folder and when an image arrived in it (from Cheese) it would send the file to my printer and then move it into a subdir called "printed" and wait for the next shot to be saved.

A Contributor called Neonsignal (also an Aussie)  in Linux Questions contributed this using inotify-tools: 

"You could do it this way:
Code:
inotifywait -m -e close_write ~/Pictures/webcam --format "%w%f" | \
while read filename; do lpr -P Photosmart-C5200-Series "$filename"; mv "$filename" ~/Pictures/webcam/printed; done

The inotifywait (part of the inotifytools package) waits for writes to the folder. The '-m' flag makes it run indefinitely (instead of running it in a script loop which could mean it might miss an event). The '--format' outputs only the file names that were written.

The output of the inotify is piped to a while loop (alternatively xargs could be used to run a command for each filename input). The while loop reads the filename from standard input, prints it to the printer, and then moves it to the destination directory.

If you are using CUPS for your printing, then there are some image processing options that can be specified if the default is not what you want."

The great thing is it worked straightaway, no problems with sending it to print and the files end up in the "printed" directory as requested.

I am not a developer, I am a very grateful user.  A couple of things remain to be worked out

At this stage the printout is not full frame on a 6x4 photo, it resembles a Polaroid of old.  The webcam I am using is a Logitech C525 which is auto focus and 8Mp.  Is there any way that the options for resolution in Cheese could be offered in this 6:4ratio at the higher sizes? At present 1280x960 is the best I can get - the higher resolutions giving more of a widescreen ratio, obviously for Skype type usage.  So 1920 x 1440 would be great.  This would leave the photos less "grainy".

With this "instant print " capacity Cheese becomes a great party tool, with guests having only to pose and hit the space bar.

Many thanks for your program, and I hope that this idea may get some attention in a future release.

Yours faithfully 
Andrew Greig
Melbourne, Australia



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]