![]() |
Terminal Command to take picture?
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. |
Re: Terminal Command to take picture?
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?
|
Re: Terminal Command to take picture?
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 |
Re: Terminal Command to take picture?
ok what about asking a mate or just a random human to take the pic for you
|
Re: Terminal Command to take picture?
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.. |
Re: Terminal Command to take picture?
Quote:
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) |
Re: Terminal Command to take picture?
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... |
Re: Terminal Command to take picture?
Quote:
Thanks for the command line help. |
Re: Terminal Command to take picture?
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 :( |
Re: Terminal Command to take picture?
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 |
All times are GMT. The time now is 16:56. |
vBulletin® Version 3.8.8