How To: manual exposure in video mode

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
107
Country
China
While my friend needs to use 6~7 YiCams to shoot VR aka 360-degree video, and facing the issue that different angle will have different exposure value. And I've done many many testing, now finally get the solution for setting manual exposure in video mode. pls use the following steps to test by yourself:

1. exposure module debug message:
Code:
# add this in the autoexec.ash and power up yicam
# t ia2 -exp debug [en] : Enable/Disable exposure module debug message, en = [0|1], 0:disable, 1:enable
sleep 5
t ia2 -exp debug 1

2. enable camera log via yicam app:
Camera_log.jpg

3. then you can get log files in /tmp/fuse_a/, name like:
Code:
# I guess the name is wrong spelling with active?
firmware.avtive.log
firmware.previous.log
firmware.old.log

4. there are many many info in the log file, but useful exposure value are:
Code:
... ...
[00880197] [IA2 EXP][518] Request, mode=0x10, ch=0, [A/S/I/D]=350,1012,0,4096
[00880303] [IA2 EXP][521] Request, mode=0x10, ch=0, [A/S/I/D]=350,1012,0,4118
[00880400] [IA2 EXP][524] Request, mode=0x10, ch=0, [A/S/I/D]=349,1012,0,4096
[00880498] [IA2 EXP][527] Request, mode=0x10, ch=0, [A/S/I/D]=349,1012,0,4118
[00880923] [IA2 EXP][530] Request, mode=0x1, ch=0, [A/S/I/D]=349,1012,0,4118
[00881207] [IA2 EXP][530] Request, mode=0x1, ch=0, [A/S/I/D]=333,1012,0,4118
[00881212] [IA2 EXP][530] Module RESET, latency of [A/S/I/D]=1,2,1,1
[00881212] [IA2 EXP][530] Request, mode=0x1, ch=0, [A/S/I/D]=333,1012,0,4118
[00881536] [IA2 EXP][4] Request, mode=0x10, ch=0, [A/S/I/D]=333,1012,0,4118
[00881768] [IA2 EXP][11] Request, mode=0x10, ch=0, [A/S/I/D]=333,1012,0,4118
[00882006] [IA2 EXP][18] Request, mode=0x10, ch=0, [A/S/I/D]=333,1012,0,4118
[00882235] [IA2 EXP][25] Request, mode=0x10, ch=0, [A/S/I/D]=333,1012,0,4118
[00882469] [IA2 EXP][32] Request, mode=0x10, ch=0, [A/S/I/D]=333,1012,0,4118
[00882706] [IA2 EXP][39] Request, mode=0x10, ch=0, [A/S/I/D]=333,1012,0,4118
... ...
mode=0x1 means: photo mode
mode=0x10 means: video mode
but the [A/S/I/D] value are the same.

5. export the log files to tf card:
Code:
# add this in the autoexec.ash and power up yicam
sleep 5
lu_util exec 'cp /tmp/fuse_a/firmware.avtive.log /tmp/fuse_d/'

6. create manual exposure script:
Code:
# add this in the autoexec.ash and power up yicam
sleep 5
# first need to turn off AE
# t ia2 -ae  [on|off]:    turn on/off AE
t ia2 -ae off
sleep 5
# second set manual exposure value
# t cal -me [mode][agc][shutter][iris][dgain] : Set specified parameter mode = [0|1], 0:VIDEO, 1:STILL
# the following value means: 1/30s, ISO1600
t cal -me 0 192 1012 0 4096

7. A/S/I/D value range, I don't know all the value range now. So need to figure out what value need to use:
Code:
A: >=192 ?
S: same as shutter value (1~2047), but:
   30p should be faster than 1/30s (1012~2047)
   60p should be faster than 1/60s (1040~2047)
I: fixed value 0, 0:iris open, 1:iris close ?
D: range: 4096 ~ 8192 ?

8. A/S/I/D mapping table:
Code:
Shutter Speed vs shutter_index:
1/ 30s: 1012
1/ 60s: 1140
1/100s: 1234

ISO Sensitive vs agc & dgain:
ISO  100: 448 #### 0 4096
ISO  200: 384 #### 0 4096
ISO  400: 320 #### 0 4096
ISO  800: 256 #### 0 4096
ISO 1600: 192 #### 0 4096
ISO 3200: 192 #### 0 8192

9. Run amba script forever, in order to run amba script in anytime, you should make a loop in autoexec.ash, and modify the action.ash to any available script.
Code:
# Startup autoexec.ash
# put this file in your tf card root
sleep 5
# do something
...
while true
do
  sleep 5
  d:/action.ash
done

Code:
# Additional action.ash
# put this file in your tf card root
# make sure action.ash only run once
# remove action.ash after it is loaded
lu_util exec 'rm -f /tmp/fuse_d/action.ash'
# do something else
...
 
Last edited:

StfLA

Member
Joined
Aug 6, 2015
Messages
73
Reaction score
5
Country
France
Very interesting !
Do you think it's possible to do the opposite : to enable AE in Timelapse mode (0.5 & 1s interval) ?
 
OP
luckylz

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
107
Country
China
I have no idea the timelapse video mode enable AE(auto exposure) or not, cos never use that mode.
Maybe you can try:
Code:
t ia2 -ae on
and see what happen.
 

StfLA

Member
Joined
Aug 6, 2015
Messages
73
Reaction score
5
Country
France
It's not for the video timelapse mode but for picture timelapse. I will test.
 
OP
luckylz

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
107
Country
China
If you're speaking of photo timelapse, I just guess it's AE-enabled. Cos I tried before with 10s interval before, but not the 0.5~1s interval, with try later.
 

StfLA

Member
Joined
Aug 6, 2015
Messages
73
Reaction score
5
Country
France
tested with
Code:
t ia2 -ae on
And it doesn't work with picture timelapse mode. Auto-Exposure stays disabled.

edit :
with debug enabled , "t ia2 -ae on", and when I start a photo timelapse with a black cover on the lens, then remove the cover, I got full of
Code:
[0m[00130256] [IA2 EXP][1001] Request, mode=0x10, ch=0, [A/S/I/D]=192,978,0,8192[0m
[0m[00130375] [IA2 EXP][1004] Request, mode=0x10, ch=0, [A/S/I/D]=192,978,0,8192[0m
[0m[00130495] [IA2 EXP][1007] Request, mode=0x10, ch=0, [A/S/I/D]=192,978,0,8192[0m
[0m[00130615] [IA2 EXP][1010] Request, mode=0x10, ch=0, [A/S/I/D]=192,978,0,8192[0m
...
 
Last edited:
OP
luckylz

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
107
Country
China
Code:
mode=0x10 is video mode
 

StfLA

Member
Joined
Aug 6, 2015
Messages
73
Reaction score
5
Country
France
I can lock exposure and other settings for picture 2s timelapse (and more), but I can't unlock it for 0.5s and 1s :-(
 

nCaine

Member
Joined
Mar 26, 2016
Messages
73
Reaction score
37
Country
Poland
luckylz can you post finished script , i got lost in all of this.
Or send to email : nCaine2k@gmail.com

Thx

I got it workng.

But i have a question.
Is it possible to set fixed ISO for video mode, but lave shutter on auto ?
 
Last edited:
OP
luckylz

luckylz

Active Member
Joined
Apr 8, 2015
Messages
414
Reaction score
107
Country
China
hah, can't set fixed ISO within auto shutter speed.
 

Tanckom

Active Member
Joined
May 1, 2016
Messages
179
Reaction score
61
Country
Germany
So, after nCaine's link to this post, i tried it in a darker environement. Auto mode (nothing changed) and again with these two
lines in autoexec.ash :

Code:
t ia2 -ae off
sleep 5
# second set manual exposure value
# t cal -me [mode][agc][shutter][iris][dgain] : Set specified parameter mode = [0|1], 0:VIDEO, 1:STILL
# the following value means: 1/30s, ISO1600
t cal -me 0 192 1012 0 4096
Which should fix ISO to 1600 and shutter to 1/30.
However both videos looked the same. Running latest 1.2.13 on SN23A model.
Anybody may help or know why? (Both videos looked same grainy - however an ISO of 1600 shouldn't be that much noisy

And can somebody explain why the sleep 5 seconds is there?
 
Last edited:

nutsey

Well-Known Member
Joined
May 12, 2015
Messages
604
Reaction score
543
Location
Turkey
Country
Russian Federation
Anybody may help or know why? (Both videos looked same grainy - however an ISO of 1600 shouldn't be that much noisy

And can somebody explain why the sleep 5 seconds is there?
Put one more 'sleep 5' in advance. This command lets the script wait until camera boot up and be ready to operate.
 

Tanckom

Active Member
Joined
May 1, 2016
Messages
179
Reaction score
61
Country
Germany
Okay, got it. Had made the fault to put it in the front of my script. Moved it a bit backwards, and works now.
 

omegas

New Member
Joined
Jun 2, 2016
Messages
6
Reaction score
1
Country
Russian Federation
9. Run amba script forever, in order to run amba script in anytime, you should make a loop in autoexec.ash, and modify the action.ash to any available script.
Code:
# Startup autoexec.ash
# put this file in your tf card root
sleep 5
# do something
...
while true
do
  sleep 5
  d:/action.ash
done

Code:
# Additional action.ash
# put this file in your tf card root
# make sure action.ash only run once
# remove action.ash after it is loaded
lu_util exec 'rm -f /tmp/fuse_d/action.ash'
# do something else
...

All works perfect, but this part - not. I can't run anything from this while loop... trayng 2 days, and nothing :( Can u show any real examples? May be i need set some chmod to action.ash? I can't run nothing (external file) from autoexec.ash :-(
 

omegas

New Member
Joined
Jun 2, 2016
Messages
6
Reaction score
1
Country
Russian Federation
Sorry, i fix this... I think problem was in "\n" end line in win... and copy/paste from forum...
 

omegas

New Member
Joined
Jun 2, 2016
Messages
6
Reaction score
1
Country
Russian Federation
May be some one know, how take liveview picture when cam in station mode? To tune exposure onfly...?
  1. Now i run script to set exposure on 6 cams
  2. make short video on one of them
  3. download it via ftp on tab
  4. play it
  5. if i mistake in p.1, than redo from p.1
It is too long...
 
Top