ethanol100
Posts: 641
Joined: Wed Oct 02, 2013 12:28 pm

Re: New version of Raspistill

Sun Oct 20, 2013 4:51 pm

I got really nice pictures using 0.3s and ISO 80:

raspistill -ss 300000 -ISO 80 -o test.jpg

Your values of 0.0003 s is very small, I think. And -ex night does not make sense in manual mode, you set your exposure manual and it overwrites your settings.

poing have you updated your firmware? rpi-update should fix that error, I guess.

poing
Posts: 1132
Joined: Thu Mar 08, 2012 3:32 pm

Re: New version of Raspistill

Sun Oct 20, 2013 4:59 pm

I'm not sure 300ms = 0.0003s. Also, ISO 80 doesn't seem to work.

When I do
raspistill -ss 300000 -ISO 80 -ex night -o test10.jpg
I get a (black, because of the light level) image with the parameters 1/15 sec, ISO 100. So the -ex night seems broken now (used to go to 1/3 or even 1/2) while ISO 80 is never reached.

How did you compile raspistill and do you see differences between shots when using a different value for -ss?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26672
Joined: Sat Jul 30, 2011 7:41 pm

Re: New version of Raspistill

Sun Oct 20, 2013 5:02 pm

You will need the very latest firmware. Previous versions don't have the appropriate mmal parameter.

There were two userlands in use here -the official Raspi one and my development one. If you are using a clone of mine (JamesH65) then you need the shutter_speed branch, if your are using the official raspi one, master.

I'll probably update my master to match the raspi one today, and get rid of my old branches as soon as I am sure its all on Raspi Master.

Don't use exposure mode when setting speed - they don't coexist peacefully. Don't think you should need ISO either, but not sure about that. Trying to remember how I tested it....thought I just set the exposure time, but maybe I did ISO as well.....
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.

ethanol100
Posts: 641
Joined: Wed Oct 02, 2013 12:28 pm

Re: New version of Raspistill

Sun Oct 20, 2013 5:03 pm

It is micro and not milliseconds, therefore 1s=1000ms=1000000us. And please try without -ex night.

And without specified ISO the camera works great, but you will not see a big difference in the pictures, because the ISO will do a good job and give always a nice picture. With fixed ISO you can play very nice with the shutter speed. Have tried a series from 100 to 300000 and it should be really useful.
Last edited by ethanol100 on Sun Oct 20, 2013 5:08 pm, edited 1 time in total.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26672
Joined: Sat Jul 30, 2011 7:41 pm

Re: New version of Raspistill

Sun Oct 20, 2013 5:07 pm

ethanol100 wrote:It is micro and not milliseconds, therefore 1s=1000ms=1000000us. And please try without -ex night.
What he said - DONT USE -ex when setting ISO or shutter speed. It simple confuses the system as you are giving it conflicting commands. In effect setting an exposure mode tells the system to make sensible choices of ISO and SS (depending on the mode). If you then start messing with those values on top, the sensible choice calculation doesn't work.
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.

gordon77
Posts: 5036
Joined: Sun Aug 05, 2012 3:12 pm

Re: New version of Raspistill

Sun Oct 20, 2013 5:33 pm

poing wrote:I'm not sure 300ms = 0.0003s. Also, ISO 80 doesn't seem to work.

When I do
raspistill -ss 300000 -ISO 80 -ex night -o test10.jpg
I get a (black, because of the light level) image with the parameters 1/15 sec, ISO 100. So the -ex night seems broken now (used to go to 1/3 or even 1/2) while ISO 80 is never reached.

How did you compile raspistill and do you see differences between shots when using a different value for -ss?
I used

Code: Select all

$ cd
$ sudo apt-get install build-essential git cmake
$ git clone https://github.com/JamesH65/userland.git
$ cd userland
$ git checkout shutter_speed
$ ./buildme
I hope this is correct.

300mS =0.3S=300000microS

ethanol100
Posts: 641
Joined: Wed Oct 02, 2013 12:28 pm

Re: New version of Raspistill

Sun Oct 20, 2013 5:54 pm

Yes, the way you have compiled it should be fine. If it would have been the wrong version, it would not have accepted your arguments.

And the values for the microseconds are ok, too.

You can try for example ISO 800 if you have a really dark scene.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26672
Joined: Sat Jul 30, 2011 7:41 pm

Re: New version of Raspistill

Sun Oct 20, 2013 6:18 pm

Note that my shutter_branch only has the shutter stuff on, not any recent changes. You need raspi userland for the most up to date code.
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.

gordon77
Posts: 5036
Joined: Sun Aug 05, 2012 3:12 pm

Re: New version of Raspistill

Sun Oct 20, 2013 6:20 pm

ethanol100 wrote:Yes, the way you have compiled it should be fine. If it would have been the wrong version, it would not have accepted your arguments.

And the values for the microseconds are ok, too.

You can try for example ISO 800 if you have a really dark scene.
Thanks, sounds like l need a rpi-update and a rpi-upgrade.

Gordon77

poing
Posts: 1132
Joined: Thu Mar 08, 2012 3:32 pm

Re: New version of Raspistill

Sun Oct 20, 2013 7:04 pm

OK,
so I did
sudo apt-get update
sudo apt-get upgrade
rm -rf userland
git clone https://github.com/JamesH65/userland
cd userland
./buildme
But it doesn't work...

Could any of your gentlemen (ethanol100?) please correct the lines above so that I can actually make this work? I mean, I'm just trying to get what jamesh made working on my system to test it for about 6 hours now but I just don't know what to do because I don't know what to type into the damn black rectangle. How hard can it be to just tell us what to do? About to completely give up on the Pi.

gordon77
Posts: 5036
Joined: Sun Aug 05, 2012 3:12 pm

Re: New version of Raspistill

Sun Oct 20, 2013 7:14 pm

poing wrote:OK,
so I did
sudo apt-get update
sudo apt-get upgrade
rm -rf userland
git clone https://github.com/JamesH65/userland.git
cd userland
git checkout shutter_speed
./buildme
But it doesn't work...

Could any of your gentlemen (ethanol100?) please correct the lines above so that I can actually make this work? I mean, I'm just trying to get what jamesh made working on my system to test it for about 6 hours now but I just don't know what to do because I don't know what to type into the damn black rectangle. How hard can it be to just tell us what to do? About to completely give up on the Pi.
Try adding the git checkout line and the. git

poing
Posts: 1132
Joined: Thu Mar 08, 2012 3:32 pm

Re: New version of Raspistill

Sun Oct 20, 2013 7:28 pm

gordon77 wrote:
poing wrote:OK,
so I did
sudo apt-get update
sudo apt-get upgrade
rm -rf userland
git clone https://github.com/JamesH65/userland.git
cd userland
git checkout shutter_speed
./buildme
But it doesn't work...

Could any of your gentlemen (ethanol100?) please correct the lines above so that I can actually make this work? I mean, I'm just trying to get what jamesh made working on my system to test it for about 6 hours now but I just don't know what to do because I don't know what to type into the damn black rectangle. How hard can it be to just tell us what to do? About to completely give up on the Pi.
Try adding the git checkout line and the. git
OK, I'm trying that, but jamesh just said that when you use the shutter_branch you do away with the other stuff. Oh well... :roll:

gordon77
Posts: 5036
Joined: Sun Aug 05, 2012 3:12 pm

Re: New version of Raspistill

Sun Oct 20, 2013 7:30 pm

poing wrote:
gordon77 wrote:
But it doesn't work...

Could any of your gentlemen (ethanol100?) please correct the lines above so that I can actually make this work? I mean, I'm just trying to get what jamesh made working on my system to test it for about 6 hours now but I just don't know what to do because I don't know what to type into the damn black rectangle. How hard can it be to just tell us what to do? About to completely give up on the Pi.
Try adding the git checkout line and the. git
OK, I'm trying that, but jamesh just said that when you use the shutter_branch you do away with the other stuff. Oh well... :roll:[/quote]

Sorry l don't know then :roll:

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26672
Joined: Sat Jul 30, 2011 7:41 pm

Re: New version of Raspistill

Sun Oct 20, 2013 7:36 pm

Instead of cloning my repo, clone the raspberry pi one, then checkout the master branch.

Code: Select all

git clone https://github.com/raspberrypi/userland.git
cd userland
git checkout master
./buildme


For those that want to know, when I add a new feature, I create a branch with just that feature in it, and send a pull request to the Raspi userland repo. Because it just has one change in it, it's an easy merge. But that means when a branch isn't accepted straight away, it may be overtaken by other changes that are accepted. Hence the shutter branch, because its release was delayed as we had to wait for a firmware change, was a couple of weeks old and other changes were accepted later.
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.

gordon77
Posts: 5036
Joined: Sun Aug 05, 2012 3:12 pm

Re: New version of Raspistill

Sun Oct 20, 2013 7:43 pm

Thanks James

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26672
Joined: Sat Jul 30, 2011 7:41 pm

Re: New version of Raspistill

Sun Oct 20, 2013 7:56 pm

poing wrote:OK,
so I did
sudo apt-get update
sudo apt-get upgrade
rm -rf userland
git clone https://github.com/JamesH65/userland
cd userland
./buildme
But it doesn't work...

Could any of your gentlemen (ethanol100?) please correct the lines above so that I can actually make this work? I mean, I'm just trying to get what jamesh made working on my system to test it for about 6 hours now but I just don't know what to do because I don't know what to type into the damn black rectangle. How hard can it be to just tell us what to do? About to completely give up on the Pi.
Just saw this - please not this is not a Raspi problem but a GIT problem. I hate git. Google for 'git rants' to see why!
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.

ethanol100
Posts: 641
Joined: Wed Oct 02, 2013 12:28 pm

Re: New version of Raspistill

Sun Oct 20, 2013 8:17 pm

poing wrote:OK,
so I did
sudo apt-get update
sudo apt-get upgrade
rm -rf userland
git clone https://github.com/JamesH65/userland
cd userland
./buildme
But it doesn't work...
So just to clear some things(I might have misunderstood something). The new features require some changes in the firmware, which you need to upgrade using rpi-update. apt-get only updates the raspbian packages and not the firmware. rpi-update can be installed with "apt-get update" and "apt-get install rpi-update".
rpi-update will overwrite everything in /opt/vc and you need to to run the buildme script in the userland directory again.
Sorry if you have already updated the firmware and I have just get you wrong.

Following James advise you should clone the main userland repo.
(https://github.com/raspberrypi/userland/commits/master will show the latest changes and the shutter speed is added 8 hours ago: "Merge pull request #105 from JamesH65/shutter_speed")

I do not know which git problem you mean. Did I overlook some error messages?
Last edited by ethanol100 on Sun Oct 20, 2013 8:31 pm, edited 1 time in total.

poing
Posts: 1132
Joined: Thu Mar 08, 2012 3:32 pm

Re: New version of Raspistill

Sun Oct 20, 2013 8:20 pm

Thanks James.

But it still doesn't seem to work. After trying out your lines and typing:

Code: Select all

 raspistill -ss 300000 -ISO 100 -o test12.jpg
 raspistill -ss 150000 -ISO 100 -o test13.jpg
 raspistill -ss 75000 -ISO 100 -o test14.jpg
 raspistill -ss 5000 -ISO 100 -o test15.jpg
(where 5000 microseconds is 1/200 sec, correct me if I'm wrong)

They all respond with:

Code: Select all

mmal: mmal_vc_port_parameter_set: failed to set port parameter 64:0:ENOSYS
mmal: Function not implemented
and all images report 1/15 ISO 100.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26672
Joined: Sat Jul 30, 2011 7:41 pm

Re: New version of Raspistill

Sun Oct 20, 2013 9:54 pm

Old firmware. It doesn't have the appropriate call for setting shutter speed.
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.

poing
Posts: 1132
Joined: Thu Mar 08, 2012 3:32 pm

Re: New version of Raspistill

Mon Oct 21, 2013 9:22 am

After a good night's rest the world seems brighter again ;)

Thanks ethanol100, rpi-update did the trick.

The -ss function works nicely, quick testing shows the shutter speed ranges from 1/3s (slower makes the camera hang and requires a reboot) to 1/34483s which actually records an image when I shine a flashlight directly into the lens. The camera is also very fast in taking an image when using -t 1.

Many thanks James, a very very useful addition to the possibilities of the camera board! More testing later today.

thegnnu
Posts: 157
Joined: Thu Oct 18, 2012 7:07 pm
Location: Bristol

Re: New version of Raspistill

Mon Oct 21, 2013 3:54 pm

James I have just tried to upgrade and the github is giving me the 404 errors

rpi-update firmware
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS
*** Performing self-update
--2013-10-21 16:46:33-- https://github.com/Hexxeh/rpi-update/ra ... rpi-update
Resolving github.com (github.com)... 192.30.252.130
Connecting to github.com (github.com)|192.30.252.130|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://raw.github.com/Hexxeh/rpi-updat ... rpi-update [following]
--2013-10-21 16:46:38-- https://raw.github.com/Hexxeh/rpi-updat ... rpi-update
Resolving raw.github.com (raw.github.com)... 185.31.19.133
Connecting to raw.github.com (raw.github.com)|185.31.19.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6782 (6.6K) [text/plain]
Saving to: `/usr/bin/rpi-update.tmp'

100%[=============================================>] 6,782 --.-K/s in 0.001s

2013-10-21 16:46:43 (4.41 MB/s) - `/usr/bin/rpi-update.tmp' saved [6782/6782]

*** Relaunching after update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS
*** ARM/GPU split is now defined in /boot/config.txt using the gpu_mem option!
*** Downloading specific firmware revision (this will take a few minutes)
*** Decompressing downloaded firmware archive
--2013-10-21 16:46:44-- https://github.com/Hexxeh/rpi-firmware/tarball/firmware
Resolving github.com (github.com)... 192.30.252.130
Connecting to github.com (github.com)|192.30.252.130|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/Hexxeh/rpi- ... z/firmware [following]
--2013-10-21 16:46:49-- https://codeload.github.com/Hexxeh/rpi- ... z/firmware
Resolving codeload.github.com (codeload.github.com)... 192.30.252.145
Connecting to codeload.github.com (codeload.github.com)|192.30.252.145|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-10-21 16:46:55 ERROR 404: Not Found.

--------------------------------------------------------------------------------
What can I do to have the camer get the upgrade

Terry

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26672
Joined: Sat Jul 30, 2011 7:41 pm

Re: New version of Raspistill

Mon Oct 21, 2013 7:58 pm

That's Hexxah's git hub for rpi-update, not the Raspberry Pi userland. I don't know about that, but I'd suggest trying again.

Then do the following

Code: Select all

git clone https://github.com/raspberrypi/userland.git
cd userland
git checkout master
./buildme
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.

User avatar
jbeale
Posts: 3675
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

-ss works the first time (but not with timelapase)

Mon Oct 21, 2013 8:22 pm

I did rpi-update and then git checkout and got the new code. The ability to have full manual exposure with the -ss option is great, thank you!!

Next question: any chance we can get the shutter duration set by -ss to remain in effect even during a timelapse sequence? For example, the following command gives me 10 image files. All but the first two images have different exposure times, as you see:

Code: Select all

raspistill -t 5000 -tl 0 -w 256 -h 256 -ISO 100 -awb off -ss 4000 -o W%02d.jpg
identify -verbose W*.jpg | grep ExposureTime

    exif:ExposureTime: 3918/1000000
    exif:ExposureTime: 3918/1000000
    exif:ExposureTime: 3770/1000000
    exif:ExposureTime: 3592/1000000
    exif:ExposureTime: 3443/1000000
    exif:ExposureTime: 3265/1000000
    exif:ExposureTime: 3117/1000000
    exif:ExposureTime: 2939/1000000
    exif:ExposureTime: 2790/1000000
I tried it again with -t 50000 and I got 85 images, with the shutter speed dropping on each one, until by frame 26 it hit bottom at 29 microseconds (1/34483 sec), and stayed there. The scene illumination was fixed, and the images became darker with each shot until they were essentially full black. I am running headless via serial console on GPIO pins, if that matters.

Code: Select all

    exif:ExposureTime: 3918/1000000
    exif:ExposureTime: 3770/1000000
    exif:ExposureTime: 3592/1000000
    exif:ExposureTime: 3443/1000000
    exif:ExposureTime: 3265/1000000
    exif:ExposureTime: 3117/1000000
    exif:ExposureTime: 2939/1000000
    exif:ExposureTime: 2790/1000000
    exif:ExposureTime: 2612/1000000
    exif:ExposureTime: 2464/1000000
    exif:ExposureTime: 2285/1000000
    exif:ExposureTime: 2137/1000000
    exif:ExposureTime: 1959/1000000
    exif:ExposureTime: 1810/1000000
    exif:ExposureTime: 1632/1000000
    exif:ExposureTime: 1484/1000000
    exif:ExposureTime: 1335/1000000
    exif:ExposureTime: 1187/1000000
    exif:ExposureTime: 1039/1000000
    exif:ExposureTime: 860/1000000
    exif:ExposureTime: 712/1000000
    exif:ExposureTime: 534/1000000
    exif:ExposureTime: 385/1000000
    exif:ExposureTime: 207/1000000
    exif:ExposureTime: 59/1000000
    exif:ExposureTime: 29/1000000
    exif:ExposureTime: 29/1000000
    exif:ExposureTime: 29/1000000
 ...and so forth.

poing
Posts: 1132
Joined: Thu Mar 08, 2012 3:32 pm

Re: New version of Raspistill

Mon Oct 21, 2013 8:49 pm

I found the same, but why is it important to take a sequence with -tl rather than with a small script and the full raspistill command? From what I gather it's not quicker (what I thought/hoped) to use the -tl option with e.g. -t1; I never get more than about 40 images per minute with full resolution. If jamesh spends more time on the code would the awb -off issue not be more important?

User avatar
jbeale
Posts: 3675
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: New version of Raspistill

Mon Oct 21, 2013 9:15 pm

poing wrote:I found the same, but why is it important to take a sequence with -tl rather than with a small script and the full raspistill command? From what I gather it's not quicker (what I thought/hoped) to use the -tl option with e.g. -t1; I never get more than about 40 images per minute with full resolution. If jamesh spends more time on the code would the awb -off issue not be more important?
I agree. Up until now, I had been using the -tl option with -t 0 because it first waits 1 sec for autoexposure to work, then takes frames as quickly as possible (which for me is about 2 per second, at 256 x 256) and separate calls would mean separate autoexposure waiting. Now that I can set exposure, you are quite right that I might as well use separate raspistill calls for each image. I would also prefer a fix for 'awb -off'.

Along with that, it would be great to capture one frame immediately and then quit, if we are not using auto-exposure or auto-white balance. That should enable a faster response and higher still frame rate than what we have now. Given that it takes a full second for the below command to complete (-t uses milliseconds, right?), I'm guessing that the auto-exposure and auto-white-balance machinery is still being given time to work, even if we aren't using it.

Code: Select all

$ time raspistill -t 1 -w 256 -h 256 -ISO 100 -awb off -ss 8000 -o fast.jpg

real    0m1.031s
user    0m0.010s
sys     0m0.020s
...actually, having a look at the code in ~/userland/host_applications/linux/apps/raspicam/RaspiStill.c ... maybe I could just change this?

Code: Select all

   case FRAME_NEXT_IMMEDIATELY :
   {
      // Not waiting, 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
      // This could probably be tuned down.
      // First frame has a much longer delay to ensure we get exposure to a steady state
      if (*frame == 0)
         vcos_sleep(1000);  // <== maybe we don't need this 1 second delay, with manual exposure.
      else
         vcos_sleep(30);

      *frame+=1;

      return keep_running;
   }
EDIT: no, changing vcos_sleep(1000) to vcos_sleep(1) it doesn't improve anything. I still cannot get anything in under 1 second.

Return to “Camera board”