I'd suggest BluTac, but that perhaps even more inelegant. Dom was looking in to why the LED config wasn't turning it off correctly. It's just on a GPIO, so the mechanism is already there if you want to dig in.willip5 wrote:Could I please have a control to shut off the very bright LED on the camera module, it is interfering with my timelapse through a window. The current bit of black tape is not very elegant.
Peter
Re: New features for raspistill command
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Re: New features for raspistill command
A line:
disable_camera_led=1
in /boot/config.txt
works for me (it's necessary to reboot, though).
disable_camera_led=1
in /boot/config.txt
works for me (it's necessary to reboot, though).
-
- Posts: 128
- Joined: Sun Dec 23, 2012 9:44 pm
Re: New features for raspistill command
Yes, you've understood my issue. But I was hoping to use the raspistill command to overcome some of the streaming issues on vanilla browsers. Instead of streaming, I wanted to simply post the most recent jpg image in a served webpage. The simplest method would have been to run raspistill with a static output filename which would be posted in /var/www/ and refer to that filename within a HTTP script. Yes, as you allude to, the file is in various states of completion at any given moment. Why not have a internal buffer file created by raspistill, which is used to compose the image through "stripes", and then create a complete output file? Why would anyone wish to see a partially complete output file: it is not technically an "output".jamesh wrote:Sorry. not sure what you mean. But guessing - The JPEG encoder outputs in stripes, but the file stays open for the entire time this takes place (less than 1s usually). You shouldn't be using the file until its closed by raspistill. If you access it whilst its being written, then you will get incomplete images. Not much to do about that - just don't access the file whilst it's open elsewhere I guess.chorlton2080 wrote:Please fix the LED off option (or provide an alternative).
Also, an option to output a fully completed frame in timelapse mode (not sure if the problem exists in normal operation). At present the output file (if we assume a static filename) is formed in a scan-line type way, i.e. can be partially complete at any given moment (i.e. when referred to on a recurring basis by a script). I'm unsure if this relates to filesystem cache write to SD card or a deliberate consequence of the raspistill methodology. It would be useful to refer to a completed static filename in, for instance, an Apache served HTML webpage, rather than the hit-or-miss (usually miss) now. I'm unsure if I've explained this well enough!
I know there could be an ingenious work-around using bash or HTML, but I'm not an expert user; an option within raspistill would be more elegant.
Re: New features for raspistill command
I don't think Linux systems guarantee an entire file write is an atomic process, do they? The process doing a file write can generally be interrupted by the OS task scheduler, and paused while another process starts which is reading that file, regardless of internal buffers. That's why things like .lock files, or checking if the file is open elsewhere, is needed if you want to be sure you have a complete file.
How about if you have two JPEG output files and ping-pong between them. After each fresh file is written, you swap a symlink to the newly updated one, and your static HTML page refers to that symlink, not the file directly. http://en.wikipedia.org/wiki/Symbolic_link
I haven't tried this, so maybe my syntax is wrong, but I am thinking of something like:
At least with some servers and some browsers, even pressing refresh will not update to a new picture of the same name, unless it has a timestamp different by at least 1 minute from the previous one. Maybe there is a workaround for this, I don't know.
How about if you have two JPEG output files and ping-pong between them. After each fresh file is written, you swap a symlink to the newly updated one, and your static HTML page refers to that symlink, not the file directly. http://en.wikipedia.org/wiki/Symbolic_link
I haven't tried this, so maybe my syntax is wrong, but I am thinking of something like:
Code: Select all
<html><head>Current Events</head><body>
Here is what it looks like now! <img src="NOW.jpg"> </body></html>
...and meanwhile, a script is running to write alternate files and then swap the "NOW" link to it:
#!/bin/bash
while [ 1 ] do
raspistill -o file1.jpg
ln -f -s file1.jpg NOW.jpg
raspistill -o file2.jpg
ln -f -s file2.jpg NOW.jpg
done
Re: New features for raspistill command
No, normally for overwriting a file properly you write to a temporary file, fsync, and then rename over the original file. That is atomic.jbeale wrote:I don't think Linux systems guarantee an entire file write is an atomic process, do they?
http://unix.stackexchange.com/a/35289
Re: New features for raspistill command
In that case you have to wait every time for camera initialisation.jbeale wrote: I haven't tried this, so maybe my syntax is wrong, but I am thinking of something like:At least with some servers and some browsers, even pressing refresh will not update to a new picture of the same name, unless it has a timestamp different by at least 1 minute from the previous one. Maybe there is a workaround for this, I don't know.Code: Select all
<html><head>Current Events</head><body> Here is what it looks like now! <img src="NOW.jpg"> </body></html> ...and meanwhile, a script is running to write alternate files and then swap the "NOW" link to it: #!/bin/bash while [ 1 ] do raspistill -o file1.jpg ln -f -s file1.jpg NOW.jpg raspistill -o file2.jpg ln -f -s file2.jpg NOW.jpg done
This would be better
Code: Select all
raspistill -o /tmp/image.jpg -t 9999999 --timelapse 1000 --exec /home/pi/move.sh
Code: Select all
#!/bin/bash
#In $1 is the filename of saved image
chmod 666 "$1"
#this will move image everytime to /var/www/image.jpg even if you name source files image%d.jpg (image1.jpg image2.jpg ...)
mv "$1" "/var/www/image.jpg"
Re: New features for raspistill command
I merged in to my codebase, but that not yet synced up with the userland codebase (I did development using Eclipse on my own git repo), I'm going to have to move to the userland git to make the process more streamlined. So will be a few days.
If you want feedback, you are in the wrong place, I'm too busy to write answers to everything.
EDIT: You can submit commits to the userland repo, they will be checked and can then be merged if appropriate. That might be a better approach.
If you want feedback, you are in the wrong place, I'm too busy to write answers to everything.
EDIT: You can submit commits to the userland repo, they will be checked and can then be merged if appropriate. That might be a better approach.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Re: New features for raspistill command
You are encouraging people to DO something. When I did, you didn't say a word, so how could i be assured that you have include that patch?jamesh wrote:I merged in to my codebase, but that not yet synced up with the userland codebase (I did development using Eclipse on my own git repo), I'm going to have to move to the userland git to make the process more streamlined. So will be a few days.
If you want feedback, you are in the wrong place, I'm too busy to write answers to everything.
Does it take too much to write something like "ok, it's patched, will take another 2 weeks"
Nevermind, forget it. I don't want to argue with you.
Re: New features for raspistill command
A number of people have already written code and submitted it to the userland repo. I think that is probably the best approach.JiriH wrote:You are encouraging people to DO something. When I did, you didn't say a word, so how could i be assured that you have include that patch?jamesh wrote:I merged in to my codebase, but that not yet synced up with the userland codebase (I did development using Eclipse on my own git repo), I'm going to have to move to the userland git to make the process more streamlined. So will be a few days.
If you want feedback, you are in the wrong place, I'm too busy to write answers to everything.
Does it take too much to write something like "ok, it's patched, will take another 2 weeks"
Nevermind, forget it. I don't want to argue with you.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Re: New features for raspistill command
overlapping a bit with previous posts but:
please could we have: camera warms up ONCE, then lets us get a still quickly (50 millisec?, is it possible to get faster?), so most of the time can be used for image processing and other stuff rather than turning the camera on and waiting? (around 0.8 sec per still at the moment). Thanks.
(The idea, mentioned by others, of using timelapse running in the background sending files to alternating files (so that full images are obtained rather than partial images) might be a good solution.).
please could we have: camera warms up ONCE, then lets us get a still quickly (50 millisec?, is it possible to get faster?), so most of the time can be used for image processing and other stuff rather than turning the camera on and waiting? (around 0.8 sec per still at the moment). Thanks.
(The idea, mentioned by others, of using timelapse running in the background sending files to alternating files (so that full images are obtained rather than partial images) might be a good solution.).
Re: New features for raspistill command
It's not possible to do that in separate invocations of raspistill, the camera will always shut down on exiting the program. Not sure of the minimum time between captures, perhaps 3-4 per second at full rez.eckythump wrote:overlapping a bit with previous posts but:
please could we have: camera warms up ONCE, then lets us get a still quickly (50 millisec?, is it possible to get faster?), so most of the time can be used for image processing and other stuff rather than turning the camera on and waiting? (around 0.8 sec per still at the moment). Thanks.
(The idea, mentioned by others, of using timelapse running in the background sending files to alternating files (so that full images are obtained rather than partial images) might be a good solution.).
Please remember that Raspistill is intended as demo software to show how to use the camera- some suggestions, like this one, would be better served by completely new apps. It's not that difficult....
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Re: New features for raspistill command
I did have a look at the .c code for raspistill, but didn't make much headway with it (I'm more python than C). What would be really useful for those of us who think modifying this code would be quite difficult is a tutorial or fully commented script explaining exactly what is going on in the raspistill.c code (and the functions it calls from outside), or at least a pointer in the direction of such. I've written basic c programs in the past, but when it comes to the lower-level stuff, connection to hardware etc. it all gets a bit tricky.jamesh wrote:
It's not possible to do that in separate invocations of raspistill, the camera will always shut down on exiting the program. Not sure of the minimum time between captures, perhaps 3-4 per second at full rez.
Please remember that Raspistill is intended as demo software to show how to use the camera- some suggestions, like this one, would be better served by completely new apps. It's not that difficult....
Re: New features for raspistill command
Hmm, thought I'd done a fair job in making it as simple as possible. The camera code doesn't access the hardware directly, its all abstracted away, so no register bashing involved. If you run doxygen over the code you will get some html pages with lots of function descriptions etc which may help you decipher the code.eckythump wrote:I did have a look at the .c code for raspistill, but didn't make much headway with it (I'm more python than C). What would be really useful for those of us who think modifying this code would be quite difficult is a tutorial or fully commented script explaining exactly what is going on in the raspistill.c code (and the functions it calls from outside), or at least a pointer in the direction of such. I've written basic c programs in the past, but when it comes to the lower-level stuff, connection to hardware etc. it all gets a bit tricky.jamesh wrote:
It's not possible to do that in separate invocations of raspistill, the camera will always shut down on exiting the program. Not sure of the minimum time between captures, perhaps 3-4 per second at full rez.
Please remember that Raspistill is intended as demo software to show how to use the camera- some suggestions, like this one, would be better served by completely new apps. It's not that difficult....
Start in main(), read through, it's fairly well commented and should give a decent idea of what you need to do and the order in which you need to do it.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
- Gert van Loo
- Posts: 2487
- Joined: Tue Aug 02, 2011 7:27 am
- Contact: Website
Re: New features for raspistill command
Start in main(), ......


Re: New features for raspistill command
It was its mothers decision.Gert van Loo wrote:Start in main(), ......Why did you call that function main??
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
-
- Posts: 128
- Joined: Sun Dec 23, 2012 9:44 pm
Re: New features for raspistill command
Thanks for all you comments and advice, folks. I have a few suggestions of possible workarounds. I note how this thread is morphing into something a little different. I do appreciate that raspistill is a demo, but I have not, and do not intend to become, and application developer. I just want to Wash'n'Go: thus the feature request.
Re: New features for raspistill command
Remember, the main Raspi's purpose in life is educational....chorlton2080 wrote:Thanks for all you comments and advice, folks. I have a few suggestions of possible workarounds. I note how this thread is morphing into something a little different. I do appreciate that raspistill is a demo, but I have not, and do not intend to become, and application developer. I just want to Wash'n'Go: thus the feature request.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Re: New features for raspistill command
Is this a suggestion or does this actually work? or is it a suggestion?yves97 wrote:A line:
disable_camera_led=1
in /boot/config.txt
works for me (it's necessary to reboot, though).
Re: New features for raspistill command
Yes, disable_camera_led was already fixed to work again sometime sort of recently. There was an update that broke that feature not long after I got my camera (which I received two days after they were officially available for purchase), but the fix has already been in the updates available with apt-get.
Re: New features for raspistill command
Would it be possible to have an option to trigger the camera (in still or video mode) from a pin of the GPIO ?
I'd like to synchronize several cameras.
Also, is there an C/C++ API in the works, instead of the command line tools ?
Thanks,
Luc
I'd like to synchronize several cameras.
Also, is there an C/C++ API in the works, instead of the command line tools ?
Thanks,
Luc
Re: New features for raspistill command
It doesn't need any changes to raspistill or raspivid for you to do that - you could (for example) use a python script to monitor the GPIO line, then us an os call to send the raspistill command.renambot wrote:Would it be possible to have an option to trigger the camera (in still or video mode) from a pin of the GPIO ?
Luc
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555
Re: New features for raspistill command
I was hoping someone would stand up to the plate and write a C library. I don't have time at the moment. all the required information is already in the demo apps.renambot wrote:Would it be possible to have an option to trigger the camera (in still or video mode) from a pin of the GPIO ?
I'd like to synchronize several cameras.
Also, is there an C/C++ API in the works, instead of the command line tools ?
Thanks,
Luc
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
-
- Posts: 582
- Joined: Sat Feb 02, 2013 3:25 am
Re: New features for raspistill command
According to our USA supplier here, that will be at least 42 days before some of us can assist.jamesh wrote:I was hoping someone would stand up to the plate and write a C library.

Re: New features for raspistill command
We write a lot of SW here before the HW is ready...OtherCrashOverride wrote:According to our USA supplier here, that will be at least 42 days before some of us can assist.jamesh wrote:I was hoping someone would stand up to the plate and write a C library.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
-
- Posts: 14
- Joined: Fri May 17, 2013 1:43 pm
Re: New features for raspistill command
Maybe this is a rather naive proposal : Would it be possible to only invoke raspistill once and keep it running (the same way it keeps running duing a timelapse) and then have it watch a temp file which just contains a number. When that number increases a picture is taken, when the number becomes -1 the process is terminated.jamesh wrote: It's not possible to do that in separate invocations of raspistill, the camera will always shut down on exiting the program. Not sure of the minimum time between captures, perhaps 3-4 per second at full rez.
Please remember that Raspistill is intended as demo software to show how to use the camera- some suggestions, like this one, would be better served by completely new apps. It's not that difficult....