Custom exposure curve for Scuba #382
Replies: 7 comments 19 replies
-
Well I never thought I doing that. I wasn't even sure exposure rules could change mid capture. I just tried and they do. It is pretty interesting idea. The camera does some of this already, although I don't know how well it is optimized for dive, so these mode switches may help. I think this is more reliable: Although an issue, once your limit the ISO and shutter, the exposure estimates, will be limited by those settings. There might not be all the data needed for this. P.S. On Mini you should use !MGCMP=1, which disables gyro compensated exposure. It will came to H11 also. This helps have a longer shutter in low light. |
Beta Was this translation helpful? Give feedback.
-
Note, I edited the equation in my origional post, for some reason, it was dropping the |
Beta Was this translation helpful? Give feedback.
-
As an update. I am using the updated conditionals from dnewman. Also added a command in the beginning to set ISO/shutter speed to a auto state. Also addjusted the breakpoint between "Bright" and "Dim" to allow a bit of a smoother transition. The equation I am using now is: Biggest issue is that you can see a Exposure jump when transitioning between regions. I think it is because of the exposure damping and that when you change the max/min is seems to reset the damping or something. I want to experiment with the DAMP command and the breakpoint values to experiment Note: I am using the GoPro 11 black and the multiplications must have the |
Beta Was this translation helpful? Give feedback.
-
Having problems savingl/loading the script as a boot script. Saving: Loading On boot, the script was not working, I don't think it was being read in correctly. It seems to be partially working but is not acting the same as when I just read in the script and I cannot tell what it is actuall reading in. I am hoping that once I get it working from boot I can get it to work with the QuikCapture |
Beta Was this translation helpful? Give feedback.
-
One thing I noticed that may be a bug. When I disable the script by !MBOOT=0 and restarted the camera, there were still ISO Max limits applied that seemed to be from when the script was running. When I went into the protune settings they showed Shutter and ISO at auto even though the camera acted as though ISO was set to a Max of 1600. I set Shutter and ISO to fixed numbers and then back to auto and the limit persisted. I was able to clear it by scanning a i64M1S0 command. I would have thought that if there was limits from previous scripting that it would have been reflected in the settings of the preset and you could be able to clear them. I confirmed this by scanning in a i16M1S0 command and then going into the protune settings. I showed a limit of 1600. When I cleard that to auto, the limit at a max of 1600 still persisted even though the protune settings indicated auto. I tried switching presets, etc. nothing seemed to clear it back except scanning a i64M1S0. Seems to be for ISO Max only .. ISO Min and Shutter seemed to clear properly. |
Beta Was this translation helpful? Give feedback.
-
I made a few changes. I did not like the way the exposure would bounce back and forth or brighten/darken for a frame or two as you crossed boundaries of the comparisons. I could have clamped the value during recording but that it problematic for QuikCapture since I think it is already recording when the script starts. So, I went about trying to figure out a way to directly and set the shutter speed value. Thru a bunch of back and forth involving EV, shutter speed, and ISO calculations, I came up with an equation with the behavior I like. Not going to go into details but I can adjust the parameters. I also reduced the calculation for the "Exposure Indicator" some. Basically, I am calculating a "Exposure Indicator" similar to the 1st post (just not including the scale factor of So, I am now using This works, even when recording with QuikCapture. I do need to test this a lot more and do some capture analysis. |
Beta Was this translation helpful? Give feedback.
-
One question. When I run the above, during boot it goes thru the normal owner info and then indicating what commands are active. It then shows "Boot Command: Lscub". It then clears the "Lscub" part but the "Boot Command:" stays on the screen. Any way to make it clear out so I can see the whole screen? If I go into record mode it clears it out and it also clears out when using QuikCapture. |
Beta Was this translation helpful? Give feedback.
-
Hi all,
Sorry in advance for a long post. Up front, I am not an expert on GoPro Labs, this is really my first effort here. If you see a way I could be doing this better, pls comment!
I am an avid scuba diver and almost always dive with a GoPro. I like the GoPro because it is simple and small. But, I have suspected that the exposure curve for the GoPro was biased toward fast shutter speeds and higher ISOs. For my style of filming when diving, I rarely have fast action but often have very dim light. This has always resulted in more noise that I would like, especially at depth where there is little light and higher ISOs are required.
I saw the Metadata page and tried MEXPS=1 which shows ISO and shutter speed overlay on the screen. I looked at these values and discovered that the GoPro does indeed favor higher shutter speeds and therefore higher ISOs than I would like to see in my application. For example, even with good light I was seeing shutter speeds over 1/300 while the ISO was up at 400. I would have much preferred lower ISO and slower shutter. This was even the case with stabilization turned off.
So, I was looking for a way to modify the exposure curve selection of shutter speed vs ISO. Note that since the aperture is fixed, this curve basically trades off motion blurriness and stabilization (shutter speed) versus noise. For underwater applications, the light is often so dim that stabilization is not effective anyway and motion is typically slow. This is not a knock on the GoPro, it is an action cam so it is understandable that it is biased toward fast shutter speed at the expense of noise, especially since most action applications are outdoors in a well lit environment. It just does not fit my application for scuba diving.
I read the page on Action Commands / scripting and was intrigued by some of the exposure calculations shown at the bottom using variables and the ISO and shutter speed values. So, I decided to see how I could modify this curve using scripting and manipulating the shutter speed and Min/Max ISO settings. I identified 3 areas that I wanted to change based on brightness levels.
Calculations
The Action commands page (at the bottom) has a calculation for an EV value. I don’t need an accurate calculation, just something that is simple to calculate and monotonic. So, several elements of the equation can be removed to calculate an “Exposure Indicator”. The equation provided is:
EV = logbase2 (f-number^2/(time x gain_above_base_iso))
I don’t need either the f-number or the logbase2 since they are effectively just scaling the calculation.
So, I was looking at:
E=1//(time x gain_above_base_iso))=1/time * 1/ gain_above_base_iso
Explanation of the variables are in the Action command page but the calculation reduced to
=Gi=G0.01=E1=E/G=Es. G and E are variables. i and s are iso and shutter speed (1/value) numbers.
For my application, I typically shoot with a 30fps shutter speed. Using this, you can break the above ranges into:
Bright – E>=60
Dim – 7.5 <= E < 60
Dark – E < 7.5
Conditionals
I tried a variety of conditional structures but had issues in trying to structure it as a series of If, Else If, Else type structures so I had to resort to a series of simple if statements in a sequence that gave me the desired result. The code became:
If E>=60 then
shutter angle = auto and ISO Max = 100 (i1M1S0 command)
End If
If E < 60 Then
If E >=7.6 Then
shutter angle = 180 and ISO Max = 800 (i8M1S180 command)
End If
End If
If E<7.6 Then
shutter angle = 360 and ISO Max = 3200 (i32M1S360 command)
End If
I realize that nesting “If” statements would be more efficient but I tried a few combinations and could not get one to work. Maybe someone here has an approach to restructure this to work more efficiently.
Note that I had to use 7.6 instead of 7.5 because of the way the conditionals work, I had to have a little buffer to allow the calculation to go below the 7.6 threshold in order to allow the <7.6 conditional to work but the settings for this range prevented the calculation to ever go below 7.5.
So .. Putting it all together, I came up with the following script:
=Gi=G*0.01=E1=E/G=E*s>E60i1M1S0<E60>E7.6i8M1S180<E7.6i32M1S360!R
And it seems to work!! I have not tried it in the water and still need to do more testing and analysis of recorded clips. Note, your camera should be in shutter speed =auto and ISO Max/Min = auto. I have seen some weird behaviors if I had already set limits for those values before running the script.
Improvements
Some things I may be looking into
- May try to reduce the 7.6 number to just over 7.5. Maybe something like 7.53 This might make a bit smoother transition.
- The breakpoints are all based on the frame rate. So, this script only works for a specific frame rate (30fps). The frame rate needs to be set prior to running this script. Either as a preset of using the “pXX” command. I would like a way to make it frame rate agnostic but this would require being able to read the current frame rate and I have not found out a way to do that. The alternative is to create separate scripts for all the frame rates I plan to use (likely 24, 30, and 60)
- I want to investigate how this would behave if I change it to use 60fps and lock the dim region to 360 degrees instead of 30fps @ 180 degrees. This would allow 60fps in what I hope is my most used region at a similar noise level but still could support a 2x slow motion in post. Downside is it will make the “Dark” region more noisy … unless (next item)
- Want to see what happens if I attempt to drop frame rate from 60 to 30 (or 24) for dark regions. Have not tried and have no idea how the camera would react or if will would reject the command.
- I am not sure about the repeat rate of the calculations. I want to experiment with a incrementing loop value to see what the rate is. I don’t need this to loop super fast, maybe only 2 or 3 times a second (TBD) since it is intended to track gross exposure changes. I am worried about the impact of too high a calculation rate will have on battery life so need to explore more. This may just be my lack of knowledge on how these scripts execute and the !R command.
- Would like to be able to load/execute the script is a specific preset is used and clear it out when other presets are selected. Can't figure out how to do that.
-
Thanks! Suggestions for improvements welcome!
Beta Was this translation helpful? Give feedback.
All reactions