Shot Histogram Request - page 46 - CHDK Releases - CHDK Forum  

Shot Histogram Request

  • 467 Replies
  • 89914 Views
Re: Shot Histogram Request
« Reply #450 on: 11 / October / 2013, 23:11:17 »
Advertisements
One final thought .. to spare us some long tech support forum threads ....it would be good if you patch your top level makefile.inc from

Code: [Select]
ifndef OPT_DE_VERSION
    VER=CHDK
    ifndef OPT_DEFAULT_LANG
        OPT_DEFAULT_LANG=english
    endif
else
    VER=CHDK_DE
    ifndef OPT_DEFAULT_LANG
        OPT_DEFAULT_LANG=german
    endif
endif
to

Code: [Select]
VER=LAPSER
ifndef OPT_DEFAULT_LANG
    OPT_DEFAULT_LANG=english
endif

Thanks!
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline lapser

  • *****
  • 1093
Re: Shot Histogram Request
« Reply #451 on: 12 / October / 2013, 03:24:17 »
Code: [Select]
VER=LAPSER
ifndef OPT_DEFAULT_LANG
    OPT_DEFAULT_LANG=english
endif
Thanks, that's a good idea. The splash screen and misc/build info say "LAPSER" now, so you can blame everything on me.

I thought about using the 1.2 build, but I don't think being a a little out of date on the 1.3 version will be a problem. I'm planning to use 1.3 functions in my scripts too.  And someday, I might even talk you guys into putting something from my build into the 1.3 trunk.  :o

I'm making a conscious effort not to learn too much about ARMs and thumbs and bashes and all that stuff. I spent 10 years in my basement writing machine code during my ill spent youth, and I don't want to get hooked like that again. I'll leave it to you guys :haha I'll be out watching sunsets... with my custom CHDK build and script purring away on a few cameras, of course.

And doesn't this animated stuff drive you nuts?
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

*

Offline srsa_4c

  • ******
  • 4426
Re: Shot Histogram Request
« Reply #452 on: 12 / October / 2013, 08:22:14 »
One of the biggest headaches I've had with my script is writing the log. I have a timer for the print statement that writes the log, and most of the time it takes 10 msec or less. However, sometimes it takes much longer, especially at the start of the time lapse. In this time lapse, the print statement took over 3 seconds one time! I'm pretty sure this happens because the camera is saving pictures as fast as it can in continuous mode. Sometimes, the log file has to wait its turn.
Since most or all your cameras have the file write hook, you could start experimenting with writing the log file before or after a jpeg file is written (place a hook into fwt_open or fwt_close, before the open() or after the close() call). Of course you'll need to buffer the log output for this.

*

Offline lapser

  • *****
  • 1093
Re: Shot Histogram Request
« Reply #453 on: 12 / October / 2013, 13:44:37 »
Since most or all your cameras have the file write hook, you could start experimenting with writing the log file before or after a jpeg file is written (place a hook into fwt_open or fwt_close, before the open() or after the close() call). Of course you'll need to buffer the log output for this.
I thought about using the file write hook but couldn't figure out a good way to do it. That's a good suggestion.

It might still be possible to write from the script (keyboard) task, and avoid buffering, by having the script wait until fwt_close, and delaying fwt_open while the script is writing. I think that could be done in the script_console_add_line() function just for cameras with the file write hook:

Code: [Select]
void script_console_add_line(long str_id)
{
    const char* str = lang_str(str_id);
    console_add_line(str);
    if (print_screen_p && (print_screen_d >= 0)) {
        char nl = '\n';
        // TODO this should be uncached memory

//set flag to delay fwt_open
//wait until fwt_close (if fwt_open was called)
        write(print_screen_d, str, strlen(str) );
        write(print_screen_d, &nl, 1);
//clear flag to delay fwt_open
    }
}
I don't understand the comment about uncached memory. Would this cause a problem with using this idea?

EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos


*

Offline reyalp

  • ******
  • 13438
Re: Shot Histogram Request
« Reply #454 on: 12 / October / 2013, 16:45:44 »
Every once in awhile, I create a diff file with my current patches, and apply it to the latest trunk. Then all I need to do is batch compile all the cameras for that trunk and drag the bin/zip files to the google drive on my computer. That updates them on the web download page too.
If you distribute CHDK binaries, you also need to provide the source that was used to build them. Including the patch in the download directory would meet this requirement.

Quote
I don't understand the comment about uncached memory. Would this cause a problem with using this idea?
This refers CPU cache. The camera RAM is accessible through two different address ranges, one that goes through the CPU cache and write buffer, and one that does not. Low level functions like write() only work 100% correctly using uncached memory, presumably because the actual writing is done with DMA, which doesn't know about the CPU cache. In practice, you can often get away with ignoring this.

So in the quoted case, if the nl = '\n' had not been flushed, you might get some other random character instead of a new line.

See  http://chdk.wikia.com/wiki/CHDK_Coding_Guidelines#Memory_allocation and http://chdk.setepontos.com/index.php?topic=1910.msg42829#msg42829

Note that none of this has to do with disk caching or file buffering, so it's not directly related to your log problem.

srsa's suggestion of buffering and doing it in filewrite is seems like a good one. You might also probably do it in the raw hook, since everything else is pretty much blocked at this point. Another alternative would be to use one of the cameras built in logging systems, like uart redirection. http://chdk.wikia.com/wiki/Debugging#UART_redirection_.28DryOS.29

Some kind of buffered logging for script seems like a good idea, but keep in mind that it will make debugging harder if you crash. In this case, logging to the camera log is useful, since recent messages will be recorded with the romlog.
Don't forget what the H stands for.

Re: Shot Histogram Request
« Reply #455 on: 18 / October / 2013, 10:38:54 »
I will have to return Monday to discuss it.

Which I did and that is sorted out.
Just have to wait for suitable weather.

Anything that I need to know about camera settings and using the script ?


*

Offline lapser

  • *****
  • 1093
Re: Shot Histogram Request
« Reply #456 on: 18 / October / 2013, 12:05:40 »
Anything that I need to know about camera settings and using the script ?
Try testing the script inside to see how it works. Most of the default settings should be OK. I set the interval to 1000 msec, but that's up to you.

I need to work some more on the focusing part of the script. It doesn't work on all cameras. I like to set the focus parameter to "1", which focuses at the hyperfocal distance. You may need to start the script with the camera in manual focus mode for it it work.

The most reliable way to set the focus on any camera is to set the focus parameter to 0, and start the script in manual focus mode with the focus set where you want it beforehand. The D20 requires this method.

The script starts out with the meter location function. I usually put one meter on the brightest part of the sky so the sky is exposed correctly. You can put a second meter on a building that is going to light up after dark, if want the building exposed correctly. The meter locations are saved in a file, so the next time you start the script you can get them back by pressing <display> for each meter. Also, while entering meter locations, you can start over by pressing half shoot. That goes back to just 1 meter, in the location you specified. Pressing <display> goes to the next meter, etc. Pressing half shoot twice puts all the meters in the center, the default.

Camera settings should be as simple as possible. That is, turn every automatic feature off that you can. I usually set the white balance to "cloudy". Be sure not to use auto or the color changes will cause flashing during the time lapse. I use AV mode, and set the aperture as wide as possible for sunsets.

You should set "review" to 0 seconds, or off. Then, you'll be able to press <set> while the time lapse is running to turn off the display. This saves battery, and the camera will run about 15% longer.

The script sets the ISO, but I usually set it to 100 with the camera, instead of AUTO. I'm not sure this matters. The script reads the exposure compensation and uses it, so be sure to set it to 0 unless want the entire time lapse exposed differently. I always use continuous mode, which allows faster shot rates, and shows the pictures on the screen as they are taken so you can see what's happening.

In particular, make sure "safety MF" and "IS" are off. Go through all the camera settings and turn off everything you can, too. The main thing is to test run the script and make sure the pictures are coming out right. You might want to do a sunset or two from your porch, or out the window, to see if it works. Good luck!
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Shot Histogram Request
« Reply #457 on: 24 / October / 2013, 14:23:42 »
Hmmm  ....  endless bad weather.


Found the core!
« Reply #458 on: 23 / December / 2013, 00:38:12 »
Lapser must be Dr.Lapser from youtube (I searched youtube for G1X, timelapse) and this confirms it!:
'I keep getting requests from my YouTube videos from people who want to run the time lapse script on their cameras. This way, I can post a link with instructions on how to do it, instead of custom compiling for each request.'
Other than finding the core knowledge of the G1X/CHDK I think I've found a sound bunch of humorous photographers, this confirmed by sayings such as these!:
'And don't worry. NSA only breaks into your house and takes you away to an undisclosed location if you type something stupid, like "Osama bin Laden" ....... uh ... oops?
'the NSA think I'm a 34 year old penguin from Idaho.'
'Your Information and  surfing habits will be added to the NSA haystack and shared with GCHQ and the so-called state of Israel.'
HA! Yep def. found a happy home here.
Didn't see an 'intro' page. Me, just a photographer....
So glad I found the forum....now off for hours of study....ironically I don't even have the G1X yet!

*

Offline lapser

  • *****
  • 1093
Re: Found the core!
« Reply #459 on: 23 / December / 2013, 01:19:49 »
Lapser must be Dr.Lapser from youtube (I searched youtube for G1X, timelapse) and this confirms it!:

Yes, you found me. I hope you don't work for NSA!  :) For the record, I'm also DrHiker on YouTube.

I haven't posted much here lately because I've been getting my sled invention ready for snowshoe season. Here's a photo of the sleds I'm working on, taken earlier today:


I was coming back from an overnight in the mountains. The weather was bad, but I did a time lapse anyway. The nice thing about time lapses is that each frame is a full resolution picture. I took over 4,000 pictures last night, mostly of fog, but this one stood out:


The full time lapse is here, with lots of weather going through.
Fuji Shelter 131222 Canon G1X

And one of my favorite, recent time lapses was from Skinner Butte overlooking the city of Eugene, OR. You can watch it here:
Skinner Butte 131116 Canon G1X
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

 

Related Topics