Multi-camera setup project. - page 32 - Creative Uses of CHDK - CHDK Forum

Multi-camera setup project.

  • 462 Replies
  • 214395 Views
*

Offline mphx

  • ***
  • 210
Re: Multi-camera setup project.
« Reply #310 on: 19 / September / 2015, 18:34:06 »
Advertisements
@reyalp

Hey , thanks for looking into this.

So , is it doable or not ?As you say its not an easy task , but...can it be done?

Or , should i start thinking other ways of doing it ?or not doing it at all ?:P

PS : something irrelevant with the topic we are discussing. At some points in the rig we "select" few cameras to download the images , and then we "re-select" the whole cameras again to continue shooting.
I noticed that re-selecting all cameras again is like i am doing the same process as when i start the rig and connect to all cameras..i mean i am not gaining any time..its more or less the same time...
Am i missing something ? is this how is supposed to behave? The real question is , what is "kept" when selecting few and then re-select all ? ids ? camera-side script is keep running?
I reload everything when i re-select all cameras , and maybe it's not needed and i lose time for no reason.

Thanks again.
« Last Edit: 19 / September / 2015, 18:45:41 by mphx »

*

Offline reyalp

  • ******
  • 14128
Re: Multi-camera setup project.
« Reply #311 on: 19 / September / 2015, 23:48:26 »
@reyalp

Hey , thanks for looking into this.

So , is it doable or not ?As you say its not an easy task , but...can it be done?
Not as easy as I hoped, but definitely doable. I've attached an updated multicam.lua

I would check it in, but there I'm having problems with chdkptp svn repo.

This adds a new function mc:shoot (not to be confused with the camera side shoot command). This works similarly to testshots, but has somewhat different options. They are described in the source. Too shoot 3 shots 100ms at one shot every two seconds, synced starting 100ms after the command is issued, you would use something like
mc:shoot{shots=3,interval=2000,synctime=100}

This uses a new camera side function shoot_burst, which repeated clicks shoot_full without releasing shoot_half. I intend to add the ability to use canon continuous mode, which may be faster on some cameras.

Quote
I reload everything when i re-select all cameras , and maybe it's not needed and i lose time for no reason.
I'm not sure what you mean by "reload everything", but you should be able to select cameras without resetting anything. Like
mc:sel({min=2,max=8})
... do some stuff on cameras 2-8...
mc:sel('all')
Don't forget what the H stands for.

*

Offline mphx

  • ***
  • 210
Re: Multi-camera setup project.
« Reply #312 on: 20 / September / 2015, 05:33:12 »
@reyalp

Thanks for looking into this and for the attached updated multicam.lua

First of all , i cant use it as it is since in my file there are some custom stuff (that i can't even remember :P) that i put them in order to use a custom TAB in GUI with multi - camera functions , buttons and stuff.

I usually sync my files from repo , so for now since there is a problem as you say , i can't do it.

So can i copy/paste the new additions you made in my working file?

Addition #1

Code: [Select]
--[[
take one ore more shots
opts:{
tv=number -- APEX*96 shutter speed
sv=number -- APEX*96 "real" ISO
av=number -- APEX*96 aperture
nd=number -- nd filter state 0=canon fw, 1=in 2=out
synctime=number -- number of milliseconds in the future to shoot, must be >= min_sync_deley
shots=number -- number of shots, default 1
interval=number -- number of milliseconds between shots, default 2000
--]]
function mc:shoot(opts)
opts = util.extend_table({
},opts)
if not self.min_sync_delay then
warnf('sync not initialized\n')
return
end
self:flushmsgs()
if not opts.synctime then
opts.synctime=self.min_sync_delay + 50
elseif opts.synctime < self.min_sync_delay then
warnf("synctime %d < min_sync_delay %d, adjusted\n",opts.synctime,self.min_sync_delay)
opts.synctime = self.min_sync_delay + 50
end
local init_cmds = {}
local init_cmd
if opts.tv then
table.insert(init_cmds,string.format('set_tv96_direct(%d)',opts.tv))
end
if opts.sv then
table.insert(init_cmds,string.format('set_sv96(%d)',opts.sv))
end
if opts.av then
table.insert(init_cmds,string.format('set_av96_direct(%d)',opts.av))
end
if opts.nd then
table.insert(init_cmds,string.format('set_nd_filter(%d)',tostring(opts.nd)))
end
if #init_cmds > 0 then
init_cmd = 'call '..table.concat(init_cmds,';')
end
if init_cmd then
self:print_cmd_status_short(self:cmdwait(init_cmd))
end
self:print_cmd_status_short(self:cmdwait('preshoot'))
self:print_cmd_status_short(self:cmdwait('shoot_burst',{
syncat=opts.synctime,
args=util.serialize{shots=opts.shots,interval=opts.interval}
}))
self:print_cmd_status_short(self:cmdwait('call release"shoot_half"'))
end
--[[
take one ore more shots, printing timestamps on the screen to allow rough sync comparison
opts:{
tv:number -- APEX*96 shutter speed
sv:number -- APEX*96 "real" ISO
shoot_cmd:string -- shoot type, either shoot or shoot_hook_sync
synctime:number -- number of milliseconds in the future to shoot, must be >= min_sync_deley
defexp:boolean -- use tv=1/256 sv=400
--]]

Addition #2

Code: [Select]
function cmds.shoot_burst()
if type(hook_shoot) ~= 'table' then
write_status(false, 'build does not support shoot hook')
return
end
local synctick,rest=string.match(mc.args,'^([%w_]+)%s*(.*)')
synctick=tonumber(synctick)
local opts,err
if string.len(rest) > 0 then
opts,err=unserialize(rest)
if not opts then
write_status(false,'unserialize failed '..tostring(err))
return
end
end
opts=extend_table({
shots=1,
interval=2000,
shoot_hook_timeout=mc.shoot_hook_timeout,
shoot_hook_ready_timeout=mc.shoot_hook_ready_timeout,
},opts)
hook_shoot.set(opts.shoot_hook_timeout)
for i=1,opts.shots do
press('shoot_full_only')
local wait_time = 0
if not hook_shoot.wait_ready({timeout=opts.shoot_hook_ready_timeout,timeout_error=false}) then
release('shoot_full_only')
write_status(false, 'hook_shoot ready timeout')
return
end
wait_tick(synctick)
hook_shoot.continue()
synctick=synctick+opts.interval
release('shoot_full_only')
-- ensure shoot_full released for some noticable time. TODO could use raw hook
sleep(opts.interval/2)
end
hook_shoot.set(0)
write_status(true)
end

Is something else i am missing?


(seriously there is not a /spoiler option ?:P)
« Last Edit: 20 / September / 2015, 05:35:06 by mphx »

*

Offline reyalp

  • ******
  • 14128
Re: Multi-camera setup project.
« Reply #313 on: 20 / September / 2015, 13:15:00 »
I had to change other parts of the code to make it work, so there are more changes. Here's a patch, which you should probably be able to apply it with tortoise apply patch. Make sure you have a backup of your existing customized files first ;)

I expect assembla will fix the problem with the svn repo pretty quickly.
Don't forget what the H stands for.

*

Offline mphx

  • ***
  • 210
Re: Multi-camera setup project.
« Reply #314 on: 20 / September / 2015, 17:32:11 »
@reyalp

ok , i think file is patched successfully ...lets hope... :)

i will make a test-button with the new command to see how it works.

I will be back with results in the next days.

Thanks again for your efforts.

*

Offline mphx

  • ***
  • 210
Re: Multi-camera setup project.
« Reply #315 on: 22 / September / 2015, 08:31:48 »
@reyalp

Hey again ,

I tried the new command some minutes ago in the studio but i ran into problems.
I suspect something went wrong with the camera-side command (shoot_burst i assume) since there was an error message popped up in camera's screen.

I link the multicam.lua (in case i didnt patched it correctly..) i used and a screenshot of the error.

https://www.dropbox.com/s/2plwzifj37s8aya/multicam.lua?dl=0 -- multicam.lua
https://www.dropbox.com/s/hyg71nbsv2nh02k/20150922_151731.jpg?dl=0 -- screenshot of error

I dont know if this screenshot will help at all...but its there in any case...
« Last Edit: 22 / September / 2015, 08:35:30 by mphx »

*

Offline reyalp

  • ******
  • 14128
Re: Multi-camera setup project.
« Reply #316 on: 22 / September / 2015, 13:10:56 »
The error is that CHDK/LUALIB/HOOKUTIL.LUA is not present.

Either you are using an old version of CHDK, or you have not installed all the files included in the zip. The multicam script should work with the stable CHDK 1.3 or 1.4.
Don't forget what the H stands for.

*

Offline mphx

  • ***
  • 210
Re: Multi-camera setup project.
« Reply #317 on: 22 / September / 2015, 15:02:25 »
@reyalp

That answer was a knife in my heart :)

We are using a rather old version of chdk 1.3 ...from the time 1.3 was still in development branch.

Thing is , that the whole setup is in "production" mode , we cant mess with it , because if something goes terribly wrong..we are fcked up :)

In any case i downloaded the latest chdk 1.4 for our cameras.
Last time i updated chdk on all cameras i used a lua script and the "update" version chdk.

Going from 1.3 to 1.4 can/will be smooth or it's gonna be messy?

If we decide to do the update i guess we gonna try it to 1-2 cameras and see how it goes..but i'd like your opinion of the outcome of such move :)


EDIT : i noticed that the files that were used for the update were diskboot.bin , ps.fi2 and modules folder.
Now i see new files lets say in lualib folder.
So the real question is , what folders/files will be needed for a correct update ? either to a latest 1.3 version or even to 1.4 version?
« Last Edit: 22 / September / 2015, 15:24:31 by mphx »

*

Offline reyalp

  • ******
  • 14128
Re: Multi-camera setup project.
« Reply #318 on: 22 / September / 2015, 16:01:54 »
@reyalp

That answer was a knife in my heart :)

We are using a rather old version of chdk 1.3 ...from the time 1.3 was still in development branch.

Thing is , that the whole setup is in "production" mode , we cant mess with it , because if something goes terribly wrong..we are fcked up :)
I understand that, but I'm sure you understand that I don't want to write code just for the specific random development version you were using. I try to support the current stable and development branches.
Quote
In any case i downloaded the latest chdk 1.4 for our cameras.
Last time i updated chdk on all cameras i used a lua script and the "update" version chdk.
Note that you do not need to update to 1.4, you just need a version of 1.3 from after it was released.

Quote
Going from 1.3 to 1.4 can/will be smooth or it's gonna be messy?
I wouldn't expect it to be a big deal. Note that 1.4 hasn't quite become the "stable" branch yet, but should very soon.

Quote
EDIT : i noticed that the files that were used for the update were diskboot.bin , ps.fi2 and modules folder.
Now i see new files lets say in lualib folder.
So the real question is , what folders/files will be needed for a correct update ? either to a latest 1.3 version or even to 1.4 version?
You should update the entire CHDK folder from the zip. You can do this with a single mupload command, so there should be no reason to get more specific than that.
« Last Edit: 03 / October / 2015, 20:20:20 by reyalp »
Don't forget what the H stands for.

*

Offline mphx

  • ***
  • 210
Re: Multi-camera setup project.
« Reply #319 on: 22 / September / 2015, 16:10:38 »
@reyalp

Well , we discussed it and probably will go for the latest 1.3 version just to be sure.

the script we used the last time was

Code: [Select]
savecon=con
for lcon in mc:icams() do
 con=lcon
 cli:print_status(cli:execute('mup path/to/update/files A/'))
end
con=savecon

i guess that will work this time too....right?

As far as "entire CHDK folder" ..you probably mean take all folders in there..from the full zip right?

Thanks.

« Last Edit: 22 / September / 2015, 16:13:37 by mphx »

 

Related Topics


SimplePortal © 2008-2014, SimplePortal