Active Topics

 


Reply
Thread Tools
Posts: 224 | Thanked: 107 times | Joined on Aug 2009
#1
For the first time in 22 years, I'm spending the holidays away from my family. My Mom put together an amazing gift package for me with with cards, candy, gifts, and a build-it-yourself Christmas Tree! I took some pictures of the whole set-up, but I want to get one with me in the picture too. I didn't see a shutter delay in the camera functions, so I was hoping someone could give me a terminal command to take a picture, and I could set it off via SSH.

Thanks in advance - this is a wonderful community.
 
Posts: 377 | Thanked: 97 times | Joined on Dec 2009 @ US
#2
Make a little video of you in front of the tree and then just capture one of more frames off the video on your computer?
 
eiffel's Avatar
Posts: 600 | Thanked: 742 times | Joined on Sep 2008 @ England
#3
Just hold the phone at arm's length, with the lens pointing towards you, and take the photo. For further inspiration see What is self-photography?

Regards,
Roger
 
Posts: 589 | Thanked: 54 times | Joined on Dec 2009 @ london
#4
ok what about asking a mate or just a random human to take the pic for you
 
Posts: 65 | Thanked: 21 times | Joined on Feb 2008
#5
I'm also interested in the question in the title (for other purposes). How would we go about controlling the camera from the command line or (better) from a python script?

Certainly there must be docs somewhere for this but all my Googling can find is tons of pages on using the default camera app, not scripting for the camera hardware or any reference to a camera API..
__________________
Just another perl hacker coding python in a bottle.
 
schettj's Avatar
Posts: 501 | Thanked: 292 times | Joined on Nov 2009
#6
Originally Posted by eiffel View Post
Just hold the phone at arm's length, with the lens pointing towards you, and take the photo.
AKA "The Facebook Effect"

Everyone has one arm trailing out of frame now

There is a gstreamer command string you can put together to take a snapshot, but you probably need to enable the dev repository to install gstreamer? I don't recall what I've installed on mine and what is stock.

ah... so as root

apt-get install gstreamer-tools

and then...

gst-launch v4l2camsrc device=/dev/video0 num-buffers=1 ! dspjpegenc ! filesink location=test.jpg

Grabs a 640x480 shot from the back camera. Or /dev/video1 for the front cam

(if it complains about dspjpegenc, try omx_jpegenc)
 

The Following 3 Users Say Thank You to schettj For This Useful Post:
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#7
Just a follow-up. To get the focus and white balance right, take a picture of the scene with the camera app first, then run your gstreamer script.

You also won't be able to use the flash, so make sure there's lots of light.

Instead of using ssh, I would suggest just adding a "sleep 10 s" to wait 10 seconds before taking the picture...
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!
 
Posts: 65 | Thanked: 21 times | Joined on Feb 2008
#8
Originally Posted by schettj View Post
...you probably need to enable the dev repository to install gstreamer?...
Actually, it's now in Extras. :-) So apt-get should find it without the need to enable Devel or Testing.

Thanks for the command line help.
__________________
Just another perl hacker coding python in a bottle.
 

The Following User Says Thank You to dvergin For This Useful Post:
schettj's Avatar
Posts: 501 | Thanked: 292 times | Joined on Nov 2009
#9
Ah... this works a LOT better, too:

gst-launch v4l2src ! ffmpegcolorspace ! pngenc ! filesink location=test.png

That'll get you the full-sized image in png format. Note that there is a delay after issuing the command of several seconds, which I can't seem to track down.

Indeed autofocus and flash are a bit tricky... you should be able to use the camerabin device, but its expecting to behave like the camera itself, so it doesn't play too well with gst-launch
 

The Following 3 Users Say Thank You to schettj For This Useful Post:
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#10
So: first rig up some kind of a tripod system. Then take a picture of the scene with the camera app, with the flash disabled. Finally, run a little script that waits 5 or 10 seconds then takes a picture, something like

Code:
sleep 5 
gst-launch v4l2src ! ffmpegcolorspace ! pngenc ! filesink location=$1.png
Ideally, you should add a gstreamer command line at the end to play the shutter sound, so you know the photo has been taken...
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!

Last edited by qole; 2009-12-31 at 23:15. Reason: removed the contentious "s" after "sleep 5"
 

The Following User Says Thank You to qole For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 08:59.