Code: Select all
wget https://github.com/JamesH65/userland/archive/new_capture_loop.zip
Code: Select all
raspistill -k -o test%02d.jpg
Code: Select all
git clone https://github.com/JamesH65/userland
cd userland
git fetch origin
git checkout -b new_capture_loop origin/new_capture_loop
Thanks ethanol100, that works too (and it's a lot faster just recompiling the code that changed!). The new code works for me and the -tl 0 looks good and is very useful, thanks for that! The option to trigger from a GPIO input or Unix signal will be great as well.ethanol100 wrote:Code: Select all
git clone https://github.com/JamesH65/userland cd userland git fetch origin git checkout -b new_capture_loop origin/new_capture_loop
Code: Select all
raspistill -tl 0 -t 60000 -o tl%d.jpg
Code: Select all
raspistill -tl 1000 -t 60000 -o tl%d.jpg
Code: Select all
mmal: Unable to write buffer to file - aborting
That a bit weird. Not sure that's anything to do with the changes to raspistill.PiGraham wrote:Thanks ethanol100.
I have compiled it and it seemed to run on a quick test. -k option, functioned as described below.
Mindful of James' remark about latest firmware I updated.
I did a rpi-update, built it again.
The -k option works, but cycles twice. With %d in the output filename I get two different image files, one for each press of Enter.Gives me a black preview.Code: Select all
raspistill -tl 0 -t 60000 -o tl%d.jpg
After a minute I have 89 black jpg files.
Running a similar command again:I get an error:Code: Select all
raspistill -tl 1000 -t 60000 -o tl%d.jpg
df shows rootfs fullCode: Select all
mmal: Unable to write buffer to file - aborting
There are only 9 jpg files in the directory (I deleted the 89).
Hmm. Did I cock-up with the upgrade?
Code: Select all
raspistill -tl 0 -t 60000 -o tl%d.jpg
Code: Select all
[email protected]:~/pics/test6$ time raspistill -t 5000 -tl 0 -w 1024 -h 768 -o L%d.jpg
real 0m6.757s
user 0m0.010s
sys 0m0.160s
[email protected]:~/pics/test6$ ll
total 3728
-rw-r--r-- 1 pi pi 370327 Oct 11 13:18 L10.jpg
-rw-r--r-- 1 pi pi 403359 Oct 11 13:18 L1.jpg
-rw-r--r-- 1 pi pi 398392 Oct 11 13:18 L2.jpg
-rw-r--r-- 1 pi pi 399354 Oct 11 13:18 L3.jpg
-rw-r--r-- 1 pi pi 373962 Oct 11 13:18 L4.jpg
-rw-r--r-- 1 pi pi 372893 Oct 11 13:18 L5.jpg
-rw-r--r-- 1 pi pi 368350 Oct 11 13:18 L6.jpg
-rw-r--r-- 1 pi pi 371502 Oct 11 13:18 L7.jpg
-rw-r--r-- 1 pi pi 364685 Oct 11 13:18 L8.jpg
-rw-r--r-- 1 pi pi 371636 Oct 11 13:18 L9.jpg
Code: Select all
case FRAME_NEXT_IMMEDIATELY :
{
// No wait, just go to next frame.
// Actually, we do need a slight delay here otherwise exposure goes
// badly wrong since we never allow it frames to work it out
// Make the very first delay quite log to give the camera plenty of time to settle.
// This could probably be tuned down.
if (*frame == 0)
vcos_sleep(1000);
else
vcos_sleep(30);
*frame+=1;
return keep_running;
}
Thanks for testing. May still be problems if there are dramatic changes in scene brightness I think. The extra delay at the start gives the system plenty of time to sort out exposure, which I presume the current 30ms didn't do.jbeale wrote:@JamesH: I just put in that minor change to RaspiStill.c and it seems to be working OK so far, no black frames after a few tries.
I'm not sure there is, because exposure changes all the time even just in small increments. But I will check on Monday if I remember.gregeric wrote:Hi James & thanks for your continued efforts to refine the camera apps.
Is there no way of knowing when the camera module has stabilised wrt exposure eg polling some agc value or such?
Good news on the update! I don't know about signals either, but the example of raspiFastCamD.c looks pretty straightforward, of course other code is needed but here is the signal handler:jamesh wrote:This change has now been merged, but it doesn't include the minor fix for the first frame. I'll push that tomorrow. I might have time to add signal based capture as well. Just trying to figure out how signals work!
Code: Select all
/**
* Handler for sigusr1 signals
* @param signal_number ID of incoming signal.
*/
static void sigusr1_handler(int signal_number)
{
vcos_semaphore_post(&signal_semaphore);
}
...
// Register our application with the logging system
vcos_log_register("RaspiStill", VCOS_LOG_CATEGORY);
signal(SIGINT, sigint_handler);
signal(SIGKILL, sigint_handler);
signal(SIGUSR1, sigusr1_handler);
Code: Select all
raspistill -t 200000 -s -o signaltest%d.jpg -v
Code: Select all
kill -USR1 <process ID of raspistill>
Unfortunately git is a PITA, but I am forced to use it. You need to clone the repository to your machine (Pi, or PC if cross compiling) using the command that you will find on githibgordon77 wrote:Any chance of someone giving instructions how to use stuff from github, or where to find some ?
I click on Jamesh link but I'm afraid I don't know what to do next
Thanks
Gordon77
A brief aside. What is your preferred VCS?jamesh wrote:Unfortunately git is a PITA, but I am forced to use it.
I've always got on OK with Perforce. But you have to pay for it. Now we are moving to GIT (enforced due to Android and kernel using GIT). It's like watching a slo-mo train wreck.PiGraham wrote:A brief aside. What is your preferred VCS?jamesh wrote:Unfortunately git is a PITA, but I am forced to use it.
So as not to derail the topic I opened a new one here:
http://www.raspberrypi.org/phpBB3/viewt ... 59#p437459
Code: Select all
kill -USR1 `pgrep raspistill`
Code: Select all
raspistill -s -tl 1000 -t 100000 -o test%04d.jpg
Code: Select all
git fetch origin
git checkout -b signal_mode origin/signal_mode
Thanks James for trying but most of this means nothing to me, pita? correct brand? l'll leave it to you experts and wait until its in the raspbian buildsjamesh wrote:Unfortunately git is a PITA, but I am forced to use it. You need to clone the repository to your machine (Pi, or PC if cross compiling) using the command that you will find on githibgordon77 wrote:Any chance of someone giving instructions how to use stuff from github, or where to find some ?
I click on Jamesh link but I'm afraid I don't know what to do next
Thanks
Gordon77
Something like this..in a folder of your choice. (Note, I may have made mistakes in these instructions - I am not a git fan)
git clone https://github.com/JamesH65/userland.git
Then you will need to select the correct brand, somehow. Move in to the userland folder...
git checkout signal_mode
Then you need to build - again from userland root.
./buildme
Code: Select all
$ cd
$ sudo apt-get install build-essential git cmake
$ git clone https://github.com/JamesH65/userland.git
$ cd userland
$ git checkout signal_mode
$ ./buildme
Thanks - I really must learn to type.waveform80 wrote:PITA = pain in the ass - evidently James is not a fan of the current open-source version control system du jour (personally I've gone from cvs->subversion->mercurial->git and the latter is growing on me, albeit in rather mouldy fashion...). Also, I suspect "correct brand" was meant to be "correct branch" (most versioning systems permit multiple "branches" of the same software to be developed simultaneously; this can allow multiple developers to work simultaneously on fixing a variety of separate bugs).
As for the rest, I'll try and make a terminal session out of it; I've included a few extra lines here to make sure you've got the stuff necessary for building the tools. Don't enter the "$" at the start of the lines - that's just representing the shell prompt:
At this point, go make tea/coffee/your-choice-of-cocktail as the build takes a fair old while (assuming you're running it on the Pi). Once the build has finished, run raspistill et al as usual and see what happens: the ./buildme script installs the newly built items to the system root - personally I'm not a fan of this, and I tend to comment the "sudo make install" bit out and run them from the build directory, but I suspect you'll want to keep things simple; you can always re-install them without much difficulty anyway.Code: Select all
$ cd $ sudo apt-get install build-essential git cmake $ git clone https://github.com/JamesH65/userland.git $ cd userland $ git checkout signal_mode $ ./buildme
Good luck!
Dave.