JiriH
Posts: 9
Joined: Sun May 26, 2013 2:07 pm

STICKY: New features for raspistill command

Sun May 26, 2013 2:32 pm

Is there a place where some new features could be suggested?

I would love to have these two features for raspistill command:

Crop parameter: given area (x/y) would be cropped, like digital zoom to specified area
example (like convert command from imagemagick)
raspistill --crop WIDTHxHEIGHT+OFFSETX+OFFSETY

Exec command after every save: given parameter (command) would be executed after every saved image: useful with timelapse mode. Image after the take could be manipulated or uploaded etc.
example raspistill -t 5000 --timelapse 99999999 --exec '/path/to/program.sh'
then after saving every image it would be executed with parameter image filename /path/to/program.sh /path/to/saved/image.jpg

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

Re: New features for raspistill command

Sun May 26, 2013 3:14 pm

They sound like pretty sensible suggestions. Note that I'm happy to take patches if people implement features that seem to be of benefit.

I think crop should be possible - I know you can specify it for preview- need to investigate furthur for capture.

Exec should be fairly simple to implement.

I'll make this a sticky thread I think - please use it for feature suggestions. Any non-feature related posts will be deleted to keep the thread manageable.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

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

Re: New features for raspistill command

Sun May 26, 2013 3:34 pm

Manual exposure and White Balance

I saw some talk about this earlier where I got the impression it's either not possible or not high on the list. It is very important though, a. for people who know what they're doing with stills and video b. for people that want to use the camera for measurements or comparing different situations. If you have only auto modes the 'brain' of the camera is constantly in your way altering the outcome based on an unknown algorithm.

Flash triggering

I asked a few month ago if it was possible to trigger a flash during capture and Gert van Loo answered it should be possible as the GPIO should be fast enough. That said, if there's no manual exposure there's not much sense in using a flash as the camera will always expose for the ambient light and using an additional flash will only lead to overexposure.

BTW, I edited a 'full frame' picture taken with the new firmware and then printed it on A4 using an Epson 3880 and that did not look bad at all. A great improvement from the earlier firmware. Thanks James! Seems quite a usable little camera (once we have manual modes ;) ).

User avatar
g7ruh
Posts: 67
Joined: Mon Apr 23, 2012 9:49 am
Location: Blackfield UK

Re: New features for raspistill command

Sun May 26, 2013 3:47 pm

[quote="poing"]Manual exposure and White Balance

I saw some talk about this earlier where I got the impression it's either not possible or not high on the list. It is very important though, a. for people who know what they're doing with stills and video b. for people that want to use the camera for measurements or comparing different situations. If you have only auto modes the 'brain' of the camera is constantly in your way altering the outcome based on an unknown algorithm.


I agree with poing. One of the problems with the 'auto' setting is that the colour balance continually changes as the lighting conditions change. I know that is the idea of auto, but it does it so quickly almost like 1 frame to the next. some form of hysteresis or an average of the auto balance over the last x seconds would help make it a little less 'intrusive' when watching a live feed or taking a series of stills over a short period e.g. several minutes.

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

Re: New features for raspistill command

Sun May 26, 2013 4:52 pm

g7ruh wrote:
poing wrote:Manual exposure and White Balance

I saw some talk about this earlier where I got the impression it's either not possible or not high on the list. It is very important though, a. for people who know what they're doing with stills and video b. for people that want to use the camera for measurements or comparing different situations. If you have only auto modes the 'brain' of the camera is constantly in your way altering the outcome based on an unknown algorithm.


I agree with poing. One of the problems with the 'auto' setting is that the colour balance continually changes as the lighting conditions change. I know that is the idea of auto, but it does it so quickly almost like 1 frame to the next. some form of hysteresis or an average of the auto balance over the last x seconds would help make it a little less 'intrusive' when watching a live feed or taking a series of stills over a short period e.g. several minutes.
I'll let this port remain as an example of a NON FEATURE REQUEST post (which would normally be deleted) - since it just repeats the last feature request. If you want to discuss ONE particular feature, then a new thread is the best place. Otherwise this thread will get too big, I won't read it all or I'll miss stuff amongst the cruft, and features will be missed. (But as an answer to the exposure issue - have you tried other exposure modes than auto yet - you may find what you need)
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

JiriH
Posts: 9
Joined: Sun May 26, 2013 2:07 pm

Re: New features for raspistill command

Mon May 27, 2013 5:41 am

I tried to code that exec parameter. Here's the diff of raspistill.c
JamesH, please could you take a look on it. It's working.

Code: Select all

--- RaspiStill_original.c	2013-05-26 22:36:48.802271660 +0200
+++ RaspiStill.c	2013-05-27 07:31:11.519208482 +0200
@@ -105,6 +105,7 @@
    int quality;                        /// JPEG quality setting (1-100)
    int wantRAW;                        /// Flag for whether the JPEG metadata also contains the RAW bayer image
    char *filename;                     /// filename of output file
+   char *execcomand;                   /// Command that will be executed after successful image save
    MMAL_PARAM_THUMBNAIL_CONFIG_T thumbnailConfig;
    int verbose;                        /// !0 if want detailed run information
    int demoMode;                       /// Run app in demo mode
@@ -152,6 +153,7 @@
 #define CommandEncoding     10
 #define CommandExifTag      11
 #define CommandTimelapse    12
+#define CommandExec         13
 
 static COMMAND_LIST cmdline_commands[] =
 {
@@ -167,7 +169,8 @@
    { CommandDemoMode,"-demo",       "d",  "Run a demo mode (cycle through range of camera options, no capture)", 0},
    { CommandEncoding,"-encoding",   "e",  "Encoding to use for output file (jpg, bmp, gif, png)", 1},
    { CommandExifTag, "-exif",       "x",  "EXIF tag to apply to captures (format as 'key=value')", 1},
-   { CommandTimelapse,"-timelapse", "tl", "Timelapse mode. Takes a picture every <t>ms", 1}
+   { CommandTimelapse,"-timelapse", "tl", "Timelapse mode. Takes a picture every <t>ms", 1},
+   { CommandExec,     "-exec",      "ec", "Command to be executed after image save", 1}
 
 };
 
@@ -222,6 +225,7 @@
    state->encoding = MMAL_ENCODING_JPEG;
    state->numExifTags = 0;
    state->timelapse = 0;
+   state->execcomand = NULL;
 
    // Setup preview window defaults
    raspipreview_set_defaults(&state->preview_parameters);
@@ -442,6 +446,22 @@
          else
             i++;
          break;
+ 
+      case CommandExec:  // exec command after save
+      {
+         int len = strlen(argv[i + 1]);
+         if (len)
+         {
+            state->execcomand = malloc(len);
+            vcos_assert(state->execcomand);
+            if (state->execcomand)
+               strncpy(state->execcomand, argv[i + 1], len);
+            i++;
+         }
+         else
+            valid = 0;
+         break;
+      }
 
       default:
       {
@@ -1209,6 +1229,7 @@
             int num_iterations =  state.timelapse ? state.timeout / state.timelapse : 1;
             int frame;
             FILE *output_file = NULL;
+            char *saved_filename = NULL;
 
             for (frame = 1;frame<=num_iterations; frame++)
             {
@@ -1238,7 +1259,9 @@
 	                     fprintf(stderr, "Opening output file %s\n", use_filename);
 	
 	                  output_file = fopen(use_filename, "wb");
+
 	                  asprintf(&saved_filename,"%s",use_filename);
+
 	                  if (!output_file)
 	                  {
 	                     // Notify user, carry on but discarding encoded output buffers
@@ -1249,7 +1272,7 @@
 	                  if (state.timelapse)
 	                     free(use_filename);
                   }
-									
+                                                                        
                   add_exif_tags(&state);
 
                   callback_data.file_handle = output_file;
@@ -1294,7 +1317,18 @@
                   callback_data.file_handle = NULL;
 
                   if (output_file != stdout)
+                  {
                      fclose(output_file);
+                     if (state.execcomand != NULL && saved_filename != NULL)
+                     {
+                      char exec_string[256];
+                      sprintf(exec_string, "%s %s",state.execcomand,saved_filename);
+                      if (state.verbose)
+                        fprintf(stderr, "Executing command %s\n", exec_string);
+                     system(exec_string);
+                     free(saved_filename);
+                     }
+                  }
                }
 
             } // end for (frame)


texy
Forum Moderator
Forum Moderator
Posts: 5145
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: New features for raspistill command

Mon May 27, 2013 5:28 pm

I did raise a thread for this, but in case it was missed........that is I,ve had no responses either way.
Is it possible to redirect the preview image to framebuffer1 (fb1). This may/may not need any further software tweaks, so may be already possible, or it may not be possible for technical reasons. Feel free to delete this post James if it is inappropriately placed ;)
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

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

Re: New features for raspistill command

Mon May 27, 2013 9:01 pm

texy wrote:I did raise a thread for this, but in case it was missed........that is I,ve had no responses either way.
Is it possible to redirect the preview image to framebuffer1 (fb1). This may/may not need any further software tweaks, so may be already possible, or it may not be possible for technical reasons. Feel free to delete this post James if it is inappropriately placed ;)
Texy
I don't think that could be done fast enough (has to comes over to the ARM - current preview is composed entirely on the GPU using dispmanx I think, but I'll see if I can find someone who knows.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

xzentorzx
Posts: 4
Joined: Thu May 23, 2013 9:55 pm

Re: New features for raspistill command

Mon May 27, 2013 9:14 pm

JiriH wrote:I tried to code that exec parameter. Here's the diff of raspistill.c
JamesH, please could you take a look on it. It's working.

Code: Select all

--- RaspiStill_original.c	2013-05-26 22:36:48.802271660 +0200
+++ RaspiStill.c	2013-05-27 07:31:11.519208482 +0200
@@ -105,6 +105,7 @@
    int quality;                        /// JPEG quality setting (1-100)
    int wantRAW;                        /// Flag for whether the JPEG metadata also contains the RAW bayer image
    char *filename;                     /// filename of output file
+   char *execcomand;                   /// Command that will be executed after successful image save
    MMAL_PARAM_THUMBNAIL_CONFIG_T thumbnailConfig;
    int verbose;                        /// !0 if want detailed run information
    int demoMode;                       /// Run app in demo mode
@@ -152,6 +153,7 @@
 #define CommandEncoding     10
 #define CommandExifTag      11
 #define CommandTimelapse    12
+#define CommandExec         13
 
 static COMMAND_LIST cmdline_commands[] =
 {
@@ -167,7 +169,8 @@
    { CommandDemoMode,"-demo",       "d",  "Run a demo mode (cycle through range of camera options, no capture)", 0},
    { CommandEncoding,"-encoding",   "e",  "Encoding to use for output file (jpg, bmp, gif, png)", 1},
    { CommandExifTag, "-exif",       "x",  "EXIF tag to apply to captures (format as 'key=value')", 1},
-   { CommandTimelapse,"-timelapse", "tl", "Timelapse mode. Takes a picture every <t>ms", 1}
+   { CommandTimelapse,"-timelapse", "tl", "Timelapse mode. Takes a picture every <t>ms", 1},
+   { CommandExec,     "-exec",      "ec", "Command to be executed after image save", 1}
 
 };
 
@@ -222,6 +225,7 @@
    state->encoding = MMAL_ENCODING_JPEG;
    state->numExifTags = 0;
    state->timelapse = 0;
+   state->execcomand = NULL;
 
    // Setup preview window defaults
    raspipreview_set_defaults(&state->preview_parameters);
@@ -442,6 +446,22 @@
          else
             i++;
          break;
+ 
+      case CommandExec:  // exec command after save
+      {
+         int len = strlen(argv[i + 1]);
+         if (len)
+         {
+            state->execcomand = malloc(len);
+            vcos_assert(state->execcomand);
+            if (state->execcomand)
+               strncpy(state->execcomand, argv[i + 1], len);
+            i++;
+         }
+         else
+            valid = 0;
+         break;
+      }
 
       default:
       {
@@ -1209,6 +1229,7 @@
             int num_iterations =  state.timelapse ? state.timeout / state.timelapse : 1;
             int frame;
             FILE *output_file = NULL;
+            char *saved_filename = NULL;
 
             for (frame = 1;frame<=num_iterations; frame++)
             {
@@ -1238,7 +1259,9 @@
 	                     fprintf(stderr, "Opening output file %s\n", use_filename);
 	
 	                  output_file = fopen(use_filename, "wb");
+
 	                  asprintf(&saved_filename,"%s",use_filename);
+
 	                  if (!output_file)
 	                  {
 	                     // Notify user, carry on but discarding encoded output buffers
@@ -1249,7 +1272,7 @@
 	                  if (state.timelapse)
 	                     free(use_filename);
                   }
-									
+                                                                        
                   add_exif_tags(&state);
 
                   callback_data.file_handle = output_file;
@@ -1294,7 +1317,18 @@
                   callback_data.file_handle = NULL;
 
                   if (output_file != stdout)
+                  {
                      fclose(output_file);
+                     if (state.execcomand != NULL && saved_filename != NULL)
+                     {
+                      char exec_string[256];
+                      sprintf(exec_string, "%s %s",state.execcomand,saved_filename);
+                      if (state.verbose)
+                        fprintf(stderr, "Executing command %s\n", exec_string);
+                     system(exec_string);
+                     free(saved_filename);
+                     }
+                  }
                }
 
             } // end for (frame)


How can I test that? That's something I would like to use aswell :D

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

Re: New features for raspistill command

Mon May 27, 2013 9:16 pm

You'll need to apply the patch over the raspicam code in the userland tree then recompile.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

texy
Forum Moderator
Forum Moderator
Posts: 5145
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: New features for raspistill command

Mon May 27, 2013 9:20 pm

jamesh wrote:
texy wrote:I did raise a thread for this, but in case it was missed........that is I,ve had no responses either way.
Is it possible to redirect the preview image to framebuffer1 (fb1). This may/may not need any further software tweaks, so may be already possible, or it may not be possible for technical reasons. Feel free to delete this post James if it is inappropriately placed ;)
Texy
I don't think that could be done fast enough (has to comes over to the ARM - current preview is composed entirely on the GPU using dispmanx I think, but I'll see if I can find someone who knows.
Maybe not fast enough for video, but for stills, speed wouldn't be so important ;-)
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

kaos
Posts: 108
Joined: Mon Mar 26, 2012 8:14 pm

Re: New features for raspistill command

Mon May 27, 2013 9:24 pm

Auto exposure lock feedback and standard input triggering.

The second item was originally posted elsethread by someone else, but I'm repeating it here so it will get into the feature request list, and also partly because it might dovetail with the AEL feedback suggestion. This could be a new command line switch for raspistill or a separate command. When executed it would turn on the camera and perform auto exposure as appropriate, and then wait for keyboard or piped input. When a certain character is received, it would trigger an as-near-instantaneous-as-possible shot. The program could then, possibly depending on further command line switches, either exit or wait for another trigger. Possible further refinements would include triggers for other things, like reevaluating exposure.

The AEL feedback is about knowing when the camera has achieved auto exposure lock. It could be implemented in several ways. If the camera or driver remembers the settings last used, you could execute a command, f.x. raspistill without both -t and -o that would perform auto exposure without saving an image, but return immediately when AEL is done. (A related possible refinement of raspistill would be, if -o is specified but not -t, to take the picture immediately when AEL is done, rather than waiting for the currently default 5 second mark.) Actual picture taking could then be done with raspistill -t 0, which would take a picture immediately (or as close as can be achieved) without making any attempt at modifying the settings from those last used. Alternatively, would it be possible to have the camera driver or programs update a raspicam_status environment variable that could be polled by other programs or scripts? The value could be, for example, "Off", "AE_in_progress", or "AE_locked" This might dovetail nicely with the standard input triggering mentioned above: You would fire off a command (asynchronously), poll for "AE_locked" and only then begin taking pictures by sending trigger characters down the pipe.

--
Kári.

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

Re: New features for raspistill command

Mon May 27, 2013 9:57 pm

kaos wrote:Auto exposure lock feedback and standard input triggering.

The second item was originally posted elsethread by someone else, but I'm repeating it here so it will get into the feature request list, and also partly because it might dovetail with the AEL feedback suggestion. This could be a new command line switch for raspistill or a separate command. When executed it would turn on the camera and perform auto exposure as appropriate, and then wait for keyboard or piped input. When a certain character is received, it would trigger an as-near-instantaneous-as-possible shot. The program could then, possibly depending on further command line switches, either exit or wait for another trigger. Possible further refinements would include triggers for other things, like reevaluating exposure.

The AEL feedback is about knowing when the camera has achieved auto exposure lock. It could be implemented in several ways. If the camera or driver remembers the settings last used, you could execute a command, f.x. raspistill without both -t and -o that would perform auto exposure without saving an image, but return immediately when AEL is done. (A related possible refinement of raspistill would be, if -o is specified but not -t, to take the picture immediately when AEL is done, rather than waiting for the currently default 5 second mark.) Actual picture taking could then be done with raspistill -t 0, which would take a picture immediately (or as close as can be achieved) without making any attempt at modifying the settings from those last used. Alternatively, would it be possible to have the camera driver or programs update a raspicam_status environment variable that could be polled by other programs or scripts? The value could be, for example, "Off", "AE_in_progress", or "AE_locked" This might dovetail nicely with the standard input triggering mentioned above: You would fire off a command (asynchronously), poll for "AE_locked" and only then begin taking pictures by sending trigger characters down the pipe.

--
Kári.
Note that when you using a sensible -t value (i.e. one that give the system time to stabilise - t 0 is not a good idea), it should be correctly exposed when you fire the capture which should happen with 1 or 2 frames. So for example, in time lapse mode the captures will generally be exactly when asked for since the system will already be stable. Note that RaspiStill reinitialises the camera from powered down each time it is run (and I'm not going to change that if its even possible), so every time it's run it need to go through a exposure sequence.

Sounds like a completely new app would be needed, daemon like, which starts up the camera and sits and waits in the background for commands from elsewhere to do stuff.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

kaos
Posts: 108
Joined: Mon Mar 26, 2012 8:14 pm

Re: New features for raspistill command

Mon May 27, 2013 10:46 pm

jamesh wrote:Note that when you using a sensible -t value (i.e. one that give the system time to stabilise - t 0 is not a good idea), it should be correctly exposed when you fire the capture which should happen with 1 or 2 frames. So for example, in time lapse mode the captures will generally be exactly when asked for since the system will already be stable.
Yes, but what is a sensible (or safe) -t value? If it is around 100 milliseconds or less, I guess the need for AEL feedback is pretty much non-existent, but if it is much more there will be cases where pre-locking the auto exposure value and then triggering at a precise instant could be useful. I guess, by the way, that the "1 or 2 frames" refer to the precision of the capture event, not the time needed for AEL?
jamesh wrote:Note that RaspiStill reinitialises the camera from powered down each time it is run (and I'm not going to change that if its even possible), so every time it's run it need to go through a exposure sequence.
Is that a hard (or deeply-embedded-in-underlying-code, which I guess comes to the same thing) limitation? No reasonably easy way to just provide it with the same parameters as used last time? I think this point is also relevant to the possibility of manual exposure: If we can provide the camera with the same parameters as used last time, it should also be possible to twiddle these parameters for manual control.

--
Regards, Kári.

Andybp
Posts: 19
Joined: Mon Oct 01, 2012 5:03 pm

Re: New features for raspistill command

Mon May 27, 2013 10:55 pm

I'd like to see an option if setting the time to infinity on raspivid please, rather than having it set to 999999 or whatever.

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

Re: New features for raspistill command

Tue May 28, 2013 7:21 am

kaos wrote:
jamesh wrote:Note that when you using a sensible -t value (i.e. one that give the system time to stabilise - t 0 is not a good idea), it should be correctly exposed when you fire the capture which should happen with 1 or 2 frames. So for example, in time lapse mode the captures will generally be exactly when asked for since the system will already be stable.
Yes, but what is a sensible (or safe) -t value? If it is around 100 milliseconds or less, I guess the need for AEL feedback is pretty much non-existent, but if it is much more there will be cases where pre-locking the auto exposure value and then triggering at a precise instant could be useful. I guess, by the way, that the "1 or 2 frames" refer to the precision of the capture event, not the time needed for AEL?
jamesh wrote:Note that RaspiStill reinitialises the camera from powered down each time it is run (and I'm not going to change that if its even possible), so every time it's run it need to go through a exposure sequence.
Is that a hard (or deeply-embedded-in-underlying-code, which I guess comes to the same thing) limitation? No reasonably easy way to just provide it with the same parameters as used last time? I think this point is also relevant to the possibility of manual exposure: If we can provide the camera with the same parameters as used last time, it should also be possible to twiddle these parameters for manual control.

--
Regards, Kári.
Last comment on this one to save clogging up the thread. -t x => x will vary according to the scene - I'll think about adding a callback in the code that prevent a picture being taken until its ready.

The camera is run by the GPU. ARM side camera code needs to tidy up after itself by shutting down the camera which cleans up all the allocations on the GPU. It's not a limitation - it's the way it has to be to ensure robust memory and resource management - you cannot have an app close down and leave stuff allocated on the GPU - that's a memory leak. There is intentionally no state information passed between invocations. Hence my comment you need something running full time on the ARM to 'manage' camera accesses. And that will take a lot of power as the camera will be running all the time.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

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

Re: New features for raspistill command

Tue May 28, 2013 7:22 am

Andybp wrote:I'd like to see an option if setting the time to infinity on raspivid please, rather than having it set to 999999 or whatever.
OK. That's a sensible idea and shoudl be quick to implement.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

User avatar
g7ruh
Posts: 67
Joined: Mon Apr 23, 2012 9:49 am
Location: Blackfield UK

Re: New features for raspistill command

Tue May 28, 2013 12:59 pm

jamesh wrote:Manual exposure and White Balance

I'll let this port remain as an example of a NON FEATURE REQUEST post (which would normally be deleted) - since it just repeats the last feature request. If you want to discuss ONE particular feature, then a new thread is the best place.
Otherwise this thread will get too big, I won't read it all or I'll miss stuff amongst the cruft, and features will be missed. (But as an answer to the exposure issue - have you tried other exposure modes than auto yet - you may find what you need)

jamesh apologies, thanks for leaving it here. I intended to add to the need by saying that it should be more than a binary option, so you can please more people more of the time by having a more fully featured feature :) I have tried other exposure modes etc.

chorlton2080
Posts: 124
Joined: Sun Dec 23, 2012 9:44 pm

Re: New features for raspistill command

Tue May 28, 2013 8:19 pm

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.

JiriH
Posts: 9
Joined: Sun May 26, 2013 2:07 pm

Re: New features for raspistill command

Tue May 28, 2013 9:37 pm

That would my exec parameter will solve, but I don't know why Jamesh doesn't want that feature include.
You would call the script after the take and move picture to place from where it would be served.

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

Re: New features for raspistill command

Tue May 28, 2013 10:57 pm

JiriH wrote:That would my exec parameter will solve, but I don't know why Jamesh doesn't want that feature include.
You would call the script after the take and move picture to place from where it would be served.
Why do you think I don't want it included - I merged your patch in today!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

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

Re: New features for raspistill command

Tue May 28, 2013 11:00 pm

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.
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.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

erikcf
Posts: 19
Joined: Thu May 23, 2013 4:17 am

Re: New features for raspistill command

Tue May 28, 2013 11:17 pm

One potential use for that patch that was merged in to optionally execute a command for each picture taken would be to run a command to move completed files, so that a script checking for files does not see partially written files.

JiriH
Posts: 9
Joined: Sun May 26, 2013 2:07 pm

Re: New features for raspistill command

Wed May 29, 2013 9:13 am

jamesh wrote:
JiriH wrote:That would my exec parameter will solve, but I don't know why Jamesh doesn't want that feature include.
You would call the script after the take and move picture to place from where it would be served.
Why do you think I don't want it included - I merged your patch in today!
Because of no reaction on my post

Thank you, then :)

A little change saved_filename should be freed outside of condition

Code: Select all

if (state.execcomand != NULL && saved_filename != NULL)
  {
    char exec_string[256];
    sprintf(exec_string, "%s %s",state.execcomand,saved_filename);
    if (state.verbose)
      fprintf(stderr, "Executing command %s\n", exec_string);
    system(exec_string);
    free(saved_filename);
}

Code: Select all

if(saved_filename != NULL)
	free(saved_filename);
Because it was freed only when exec parameter was involved

willip5
Posts: 78
Joined: Wed May 29, 2013 11:55 am
Location: France

Re: New features for raspistill command

Wed May 29, 2013 12:03 pm

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

Return to “Camera board”

Who is online

Users browsing this forum: No registered users and 10 guests