Silentpic API

Started by engardeknave, April 28, 2013, 07:04:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

engardeknave

I brought up the idea of putting take_silent_pic() in another thread. My workaround for not having this was to programmatically enable silent pics in the menu and issue a SHOOT_HALF press. But this is useless for DOF brackets because aperture can't be applied before saving the DNG.

I tried it with sticky DOF preview, but you can't take silent pics in this mode apparently. Even if you could, though, with this many things to do to prepare the bracket, it would be impractical to use.

I had another problem with the script capturing all key presses, so I couldn't do anything else as long as the script was running. I used lastkey(). I didn't investigate this much, but I don't see how I could have caused it.

Ideally, what I'm trying to accomplish is to have a button I can press to execute a quick silent pic DOF bracket without moving the mirror & shutter.

I guess the scripting stuff is kind of on hold until TCC is ready, but the 14-bit RAWs are so incredibly useful it might be worth adding some picoc functions to support them for now. I'm not sure why silent pics are mapped to half shutter by default, but that really makes them painful to use.

a1ex

Exposure override enables the aperture.

For buttons, I'm thinking at some way to tell in advance what buttons will be used by the script, so it will capture only those. Something like: setup_keys(SET, MENU, LEFT, RIGHT).

engardeknave

So this is the script I made to do a simple DNG DOF bracket. I'm not sure if you can do anything at this point, but I thought I'd post what I got working and the problems with it.


//console_show();
console_hide();

int main(void){

  if(!lv){click(LV);}
  float bracketset[3]={1.8,2.8,4};
 
  while(1){
    if(get_gui_mode()==2){ //canon menu
      set_gui_mode(0);
      sleep(0.5);
      dofbracket(bracketset);
      beep();
      printf("Done.");
      //break;
    }
    sleep(0.1);
  }

  return 0;
}

void dofbracket(float *aps){

  //save settings
  int takesilent=menu_get("Shoot","Silent Picture");
  int expoveride=menu_get("Expo","Exp.Override");
  //int explock=menu_get("Expo","Expo.Lock");

  //need these enabled
  menu_set("Shoot","Silent Picture",1);
  menu_set("Expo","Exp.Override",1);
  //menu_set("Expo","Expo.Lock",1);

  float a1=get_aperture();
  float s1=get_shutter();
  printf("Current aperture is %f\n",a1);
  printf("Current shutter is %f\n",s1);

  int i=0;
  while(aps[i]>1){
    set_aperture(aps[i]);
    set_shutter(pow(aps[i],2)*s1/pow(a1,2)); //seems to work better than exposure.lock
    sleep(0.01);
    takepic();
    printf("%fs @ f/%f\n",get_shutter(),get_aperture());
    i++;
  }
 
  //put everything back
  set_aperture(a1);
  set_shutter(s1);
  menu_set("Shoot","Silent Picture",takesilent); 
  menu_set("Expo","Exp.Override",expoveride);
  //menu_set("Expo","Expo.Lock",explock);
}

main();


Problems:

-Can't use keys; have to hijack the Canon menu.
-Have to sleep(1.5) between each silent pic (probably because it relies on a click(SHOOT_HALF)), which mostly defeats the point of this.

a1ex

Why not just call takepic?

engardeknave

Oh yeah, you did say that takepic does silent pics now. I changed it, and it's better, but it's still not really fast. It doesn't seem to be going faster than one shot every 300ms with sleep(0.01) between shots.

a1ex

Of course - it takes time to setup the raw mode, allocate RAM, save the DNG...

For fast burst, one has to port take_fast_pics. But then you can't change the LiveView settings from one frame to another - except ISO and maybe shutter, via frame overrides. That's something that must run in Canon's LiveView task, and PicoC is not the right tool here.

engardeknave

That actually sounds amazing for handheld HDR stills.

I have another issue, but I don't think it's worth another thread. Can we get rid of that "script running..." message? It's not very helpful since we can see it running in the menu. It just looks terrible flickering over the histogram.