CHDK Forum

Using CHDK => Creative Uses of CHDK => Topic started by: mphx on 10 / July / 2014, 16:25:30

Title: Multi-camera setup project.
Post by: mphx on 10 / July / 2014, 16:25:30
Hello all ,

I registered today at forum just to share my project and exchange info and tips with you all.
First of all i need to say that everything i did so far is by gathering info from this forum and other places , so nothing is actually *my* creation , i just put them together to serve my purpose.

The Project : Me and a friend of mine will setup a multi camera studio ,lets say, for some 3d modelling/producing 3d miniature purposes.We will use ~64x canon A2500 for the project.

Stuff so far ... : 8x A2500 (running chdk 1.3), 1-2 powered usb hubs , and the necessary cables.All these as a start to do some testing.


Shooting Method : I read a lot about this phase.What to use and what not to use.We started experimenting with multicam.lua (credits to reyalp :) )and its commands.Syncing was working good with 2 cameras.With 8 cameras connected we had some hicups .Some cameras were losing sync by a little bit.Not more than 40-50msecs.
But then again , when we will have 64 cameras connected..i cant and i dont want to imagine what the sync would be like.

So i abandoned that method for now and i am testing "usb remote" method using an on/off switch attached to the usb cable that connects main usb hub to pc.Method works great with 2 cameras.Tesing with 8 cameras is pending.
**Thats why cameras run chdk with patched kbd.c (Credits go to waterwingz :) )**

Transferring Method :That's an easy step.I am using a bat script for downloading the pictures from the cameras.Nothing fancy.

Manual Focus : I played a bit with set_aflock and set_focus commands and they seem to work as supposed.I will play more with focus when we will set up all cameras at the studio.

Things i'd like to do or do with some other way.

1.Is there a way to reboot or disconnect multiple cameras? I have found the command for mass-shutdown.Is something like

Code: [Select]
mc:cmd('call reboot()')
gonna work?I tried it and somehow cameras stucked/crashed.About disconnecting multiple cameras , is a new function needed in multicam.lua i imagine?

2.I saw a thread somewhere in the forum discussing how to be possible to "name" each camera so u know that upper left is camera1 , bottom right camera2 , etc etc.Also if something like this is possible it's easy to see if some camera malfunctioned , didn't take the shot or anything anyway.So , is it possible to"name" the cameras?
If something like this is possible , that would be helpful with transferring the images from cameras.
My batch script creates a parent folder (lets say shooting1) and then takes the increasing usb bus number of the currently connected cameras and uses it to create sub-folders (shooting1/0001 , shooting1/0002 , etc).In each of these subfolders go the photos of each camera.Its a good solution but i would like something like this.

e.g. shooting1/cam1-photo , shooting1/cam2-photo , etc etc etc

So i need a way to "name" each camera with a steady name (maybe "read" the serial numbers and put a name on them or something like this) and then use this name to rename pictures when downloading.
So here comes another question.Is it possible to rename a photo when chdkptp downloads it from cli ?

3.When i press shoot and cameras are standing by for usb voltage change (for me to click the switch in other words) i noticed that shooting happens after ~10 secs if i dont click the switch.Can i change this 10secs behavior?


Sorry for my long post , i had so many things stacked up to say !

Thanks .



Title: Re: Multi-camera setup project.
Post by: waterwingz on 10 / July / 2014, 17:36:58
I registered today at forum just to share my project and exchange info and tips with you all.
First of all i need to say that everything i did so far is by gathering info from this forum and other places , so nothing is actually *my* creation , i just put them together to serve my purpose.
Welcome!  I started this a couple of days ago for people just like you :

Shooting with Multiple Cameras using CHDK (http://chdk.wikia.com/wiki/Shooting_with_Multiple_Cameras_using_CHDK). 

It's a wiki page so edits and improvements are very welcome.


Quote
**Thats why cameras run chdk with patched kbd.c (Credits go to waterwingz :) )**
.. and a few other people.

Quote
1.Is there a way to reboot or disconnect multiple cameras? I have found the command for mass-shutdown.Is something like
Code: [Select]
mc:cmd('call reboot()')gonna work?I tried it and somehow cameras stucked/crashed.About disconnecting multiple cameras , is a new function needed in multicam.lua i imagine?
I've been working on a customized version of multicam.lua (seperate camera & PC versions of the script) and it has commands to do what you want. 
link >bcam.zip (https://app.box.com/s/hwyvqrldf8uyq9u5phjk)
It's also fairly easy to add more.

The usual cautions about this being a "work in progress" - I'm working on making in tolerant to cameras going on & offline without bailing out with a cryptic error message.



Quote
2.I saw a thread somewhere in the forum discussing how to be possible to "name" each camera so u know that upper left is camera1 , bottom right camera2 , etc etc.
Yea .. I started that here :
Building a mult-camera rig  (http://chdk.setepontos.com/index.php?topic=11583.msg114152#msg114152)
and continued it here:
Unique Camera ID Numbers needed for multi-camera rigs ? (http://chdk.setepontos.com/index.php?topic=11631.0)
I was not exactly overwhelmed with comments about the idea.


Quote
Is it possible to rename a photo when chdkptp downloads it from cli ?
My next versions of bcamHost.lua & bcamRem.lua use the unique camera ID and the shot number to create unique  file names and place the same shot from multiple cams in the same folder.

Quote
3.When i press shoot and cameras are standing by for usb voltage change (for me to click the switch in other words) i noticed that shooting happens after ~10 secs if i dont click the switch.Can i change this 10secs behavior?
This one goes way back.  The idea here is that when you get to this stage in the sync process,  the shooting task is in a tight loop waiting for the USB 5V signal to go away.   Many other camera functions are essentially suspended as a result and at some point the camera will do a "watchdog reset".  So 10 seconds was picked as a "safe" value.  It's likely this varies a bit with different camera models and also possible that 60 seconds would work as well.  I can make you a custom build if you want to play a bit and find the limit for the A2500.
Title: Re: Multi-camera setup project.
Post by: mphx on 10 / July / 2014, 18:33:54
Thanks for answering waterwingz ,

Let's see..

1.I have read the wiki link that you ... linked many times and all the multicamera project/threads .It's where i got info and ideas for our project :)

2.I tested a bit your files .To be honest the bcamHost.lua file only , as i prefer to run scripts from pc to the camera . I am not programming expert , or lua for that matter. But  i have some common sense and i try to figure things out by comparing and analyzing them.
So , i tried some commands of that file and after connect() , everything else fails.Script cannot "send" them to camera and the error is the classic "no script running".
I noticed that there is no start() function on the .lua file .Shouldn't be one there to start the camera-part code execution and allow the other commands to function ?Just an observation , i might be talking nonsense here.

3.i have read the threads about unique id numbers and stuff. I will try to see if i can come up with something at the direction reyalp suggested e.g. set some numbers/names at the serial numbers in a script and handle the camera through them.For many cameras setup , that would be a boring job to do , but i believe its a one-time job.To match up some variables to ALL serial numbers.

4.About "i will take the photo in 10 secs" annoying thing. I understand the concept you are describing.My friend was thinking something like.. shooting task in loop forever and we walk around with the switch in our hands and take the shot in whatever moment we feel like .As i understand this won't happen.So the best thing that can be done is to raise that "safe limit".
I will keep it in mind and think it over and let you know..no need to make something for me at this point..not yet atleast.
I was also thinking of some kind of countdown timer in chdkptp gui when i press shoot to inform of the remaining time and some sound alarms too .Probably easy task with some lua programming ...


And a last thing that came up my mind right now.When i click the switch to take the shot , cameras naturally disconnect from pc.
When i click it again to connect them back and do the file transferring i noticed that batch script fails to connect to one of the cameras...i need to run it twice to connect to both and get the images right.
I thought to insert a mass-connect and exit() before the actual transferring , just to "wake" them up and it seems to be working but i consider it a "dirty" solution.Consider 64 connections just to wake cameras up and then 64 connections for the transferring..It's not looking good.

I am trying to see things and how they will work in the big scale in every step.

Is there something else that i can do ?

Thanks.
Title: Re: Multi-camera setup project.
Post by: waterwingz on 10 / July / 2014, 19:29:12
2.I tested a bit your files .To be honest the bcamHost.lua file only , as i prefer to run scripts from pc to the camera . I am not programming expert , or lua for that matter. But  i have some common sense and i try to figure things out by comparing and analyzing them.
So , i tried some commands of that file and after connect() , everything else fails.Script cannot "send" them to camera and the error is the classic "no script running".
I noticed that there is no start() function on the .lua file .Shouldn't be one there to start the camera-part code execution and allow the other commands to function ?Just an observation , i might be talking nonsense here.
Thanks.
My version of the host script (bcamHost.lua) depends on having the related camera script (bcamRem.lua) running.  They work as a pair.  I needed to do that in order to have the script on the camera side have a unique ID number like you see in the linked image.  So you can't just run the host side alone - it needs the script on the camera side to communicate with.

If you enable the script to run at camera startup, it makes the whole process very automatic.

At some point, I'll add a "mass download" function that allows you to update each camera with a new camera side script ( bcamRem.lua )

Quote
3.i have read the threads about unique id numbers and stuff. I will try to see if i can come up with something at the direction reyalp suggested e.g. set some numbers/names at the serial numbers in a script and handle the camera through them.For many cameras setup , that would be a boring job to do , but i believe its a one-time job.To match up some variables to ALL serial numbers.
See my comment above.
(https://chdk.setepontos.com/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FMsNVW2M.png&hash=658c877975e339f364fe324f51690d99)
Quote
4.About "i will take the photo in 10 secs" annoying thing. I understand the concept you are describing.  My friend was thinking something like.. shooting task in loop forever and we walk around with the switch in our hands and take the shot in whatever moment we feel like .As i understand this won't happen.So the best thing that can be done is to raise that "safe limit". I will keep it in mind and think it over and let you know..no need to make something for me at this point..not yet at least. I was also thinking of some kind of countdown timer in chdkptp gui when i press shoot to inform of the remaining time and some sound alarms too .Probably easy task with some lua programming ...
If you can figure out how to read that remote switch from your PC then the rest is easy. Some sort of Arduino clone board acting as a USB slave would be simple to rig up.   Search eBay for "wireless remote control" - there a lots of $5 key fob transmitter/receivers you could use as the remote part of the equation.

Quote
And a last thing that came up my mind right now.When i click the switch to take the shot , cameras naturally disconnect from pc...
... Is there something else that i can do ?
Ah, I think you miss the point of the trick you mentioned in your first post.
http://chdk.setepontos.com/index.php?topic=8769.msg105488#msg105488 (http://chdk.setepontos.com/index.php?topic=8769.msg105488#msg105488)
The hack mentioned there tricks the camera's PTP code into not noticing that the USB power goes away when you "shoot".  That solves all the issues you have mentioned here.  But you do currently need a custom built version of CHDK with the hack included. At some point I guess I'll post a patched version to add to the trunk - possibly enabled and disabled by a script function I think.
Title: Re: Multi-camera setup project.
Post by: reyalp on 10 / July / 2014, 23:59:34
Shooting Method : I read a lot about this phase.What to use and what not to use.We started experimenting with multicam.lua (credits to reyalp :) )and its commands.Syncing was working good with 2 cameras.With 8 cameras connected we had some hicups .Some cameras were losing sync by a little bit.Not more than 40-50msecs.
Out of curiosity, what version of chdkptp was this using? In chdkptp r602, I added shoot_hook_sync which should have substantially better sync than the previous method.

USB remote (or battery temp terminal) is still probably a much better option for your project, but if you were using shoot before, I'd be interested to know how it compares to the new method.
Title: Re: Multi-camera setup project.
Post by: mphx on 11 / July / 2014, 04:52:12
Thanks all for answering.

Let's see now..

1.@waterwingz : I suspected that your script might work that way (one script on the pc and the other on the camera).But the whole situation process raises a conflict in my eyes.
When i mass-connect to the cameras and they go into "rec mode" , ready to shoot , they kinda start "default" script running.I mean i see the "Default Script <ALT>" at the lower left side.
This goes off when either cameras get disconnected (i suppose , because when they shoot , viewfinder goes black...some bug? but everything is working despite of that and view comes back when i connect cameras back and switch them back to play mode) or  i issue a "mass exit" command from chdkptp.
Won't this whole process fail if some other script (yours lets say) is running already on the camera?

2. when i said , take the switch and walk around , i didnt think about "remote" switch , but a wired one.When i say walk around we are talking a distance of 2-3 meters from pc to the "cameras setup" and back..Not big distances.I dont mind to carry a cable with me lets say...but i'd like to have the shooting task in loop forever , go over to the cameras , give instructions to the customer where to stand , what to do , what not to do and when he/she is ready . i  press the switch .

3.I see that you quoted two lines i wrote but you left out some others that was the whole point.
I said that i press shoot at chdkptp....shoot task goes into loop...i press switch...cameras diconnect and at the same time shooting occures.All good so far.
When i press switch again , cameras connect to pc again...obviously and then i run my script to download the images from the cameras.chkdptp command tries to connect to each camera and download the images to some predefined folders.
What i said was that at the first running of the script , chdkptp fails to connect to one of the two cameras...the same every time?different?i dont care , i didnt look into it.Its meaningless.Fact is that iof one of the two cameras doesnt connect and images dont get downloaded.
If i run the script a second time..ALL IS GOOD.So i wonder if this a usb-related thing..cameras dont get available fast or something.
As i said i include a "mass connect , mass exit" command  in the script prior the download command..just to "wake" cameras up...to make them available...my thoughts..maybe its nonsense.
It works everytime..but as i said...its 2 cameras and the connections and disconnections are fast.I wonder how much time the script will need when it has 64 cameras to handle.
Its obvious that i used a custom build with the hack included. (chdk-shell , downloaded the source , edit kbd.c for my camera model , compile it , "stick" it to the cameras :) )

4. @reyalp : Cameras are using chdk 1.3 r599 .That the version STICK chose for my camera and i dont see a reason not to believe it :)

First of all all my sync-tests where using an online meter (with milliseconds) and all cameras where focusing on it.I dont have a CRT monitor for some more accurate tests..
With the first method (shooting via chdkptp) as i said 1-2 cameras out of 8 were losing "some" msecs.Not much.Nothing tragic.And if you think that the "objects" getting shot will be mostly static, that wouldn't be a problem.
But i fear that when 64 cameras will be connected , maybe sync will go off for more millisecs.
I have to add at this point that i used syncat parameter for shooting to make shooting a bit more accurate but with not a significant changes at the result.
If there is something else i could tweak/use for this "method" , feel free to enlight me :)

The second method (usb hacked cable , switch on/off , hacked kbd.c etc) is rumored to be more accurate.With 2 cameras is working very good.I need to test it with 8 cameras now.

In few words...what shooting method is "known" to have good sync with multiple cameras?

Thanks.
Title: Re: Multi-camera setup project.
Post by: Microfunguy on 11 / July / 2014, 05:04:57
what shooting method is "known" to have good sync with multiple cameras?

None.
It is a statistical problem.
With two cameras I have found that 70% of the time the sync error is less than one msec.
For 30% of the time it is tens of msec, presumably because the Canon firmware is busy with an 'important task'.

So, does that mean for any shoot 19 of your cameras will have a sync error of tens of msec ?
Title: Re: Multi-camera setup project.
Post by: mphx on 11 / July / 2014, 05:22:59


None.
It is a statistical problem.
With two cameras I have found that 70% of the time the sync error is less than one msec.
For 30% of the time it is tens of msec, presumably because the Canon firmware is busy with an 'important task'.

So, does that mean for any shoot 19 of your cameras will have a sync error of tens of msec ?

I think the real question is : What's the margin of lost sync that is acceptable for a given project.
As i said in my previous post , my "objects" getting shot will be more or less static.People standing on a platform posing .It will be little or near to none movement .
So losing some tens of msecs it wont be much of a problem.3d modelling and processing will correct any hicups.
Thing is i need to find the most efficient method now so i can keep working on it .I can't have 64 cameras at this point.I can test methods with 2 or 8 and make conclusions for the 64x.
So yes it is a statistical problem.And we are trying to find the most accurate (for less cameras) and most reliable method and then we BELIEVE that this method will work well with more cameras.
Title: Re: Multi-camera setup project.
Post by: Microfunguy on 11 / July / 2014, 05:38:10
I need three more cameras for a 24-camera rig that will be used outdoors.
I do not have a laptop (for PTP)) so will just use a simple USB switch connected to all cameras.
I will download from the cards at home.

With that in mind, can you post your BAT file for me to try ?

Title: Re: Multi-camera setup project.
Post by: mphx on 11 / July / 2014, 05:57:12
@microfunguy

the BAT file i am using is a bit weird hybrid file :)

It does the following things.
1.it uses an external vbs script that creates a parent folder (lets say shooting0001 , shooting0002 , etc) every time BAT file is executed.It checks if some of these folders exist , it uses the next available number for the naming.It can be done with bat commands too.
2.Creates a file (id.txt) with the id of all connected cameras.
3.Uses the increasing-unique bus id number to create a sub-folder into the parent folder of STEP 1 .
4.Download every image of every camera in the respective sub-folder.

Extra features

1.an empty mass-connect/mass-exit for reasons i have mentioned to previous posts.
2.a check if all subfolders are populated with files.If a subfolder is empty , that means that images were not downloaded or the specific camera didnt shoot.
It creates a text file reporting which subfolder is empty.

If by "i will download from cards" u mean u will get the cards out of the cameras in some card reader , then this script wont do you any good.
If not , then gladly to post it.
Title: Re: Multi-camera setup project.
Post by: Microfunguy on 11 / July / 2014, 06:11:00
If by "i will download from cards" u mean u will get the cards out of the cameras in some card reader , then this script wont do you any good.

That is a 'worst case' situation that a friend did use on a commercial project.
Slightly tedious but worked fine .. obviously.

Quote
If not , then gladly to post it.


Thanks, post or send via personal message .. your decision.
Either way, it is an education.

Although I do have a complete,working SDM PTP solution there is an occasional bug and I do not want to spend Summer time working on it.

If necessary, I will just use CHDK.


David
Title: Re: Multi-camera setup project.
Post by: mphx on 11 / July / 2014, 06:23:17
ok here goes the scripts


1. The folder.vbs script

Code: [Select]
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
    BasicFolder="./"
    FolderPrefix="shot"
    FormatName="0000"
    FolderPostfix=0
    Do
FolderPostfix=FolderPostfix+1
  last_string=right(formatname+cstr(FolderPostfix),len(formatname))
NewFolder=BasicFolder+"\"+FolderPrefix+last_string
    Loop Until not FSO.FolderExists(NewFolder)
    FSO.CreateFolder(NewFolder)
Set wshshell = CreateObject("WScript.Shell")
Dim WshSySEnv
Set WshSysEnv = wshshell.Environment("Volatile")
Wscript.Echo FolderPrefix+last_string
Set WshSySEnv = Nothing

It create folders with increasing number in their name.It also does checking for already existing folders and uses the next available number.You can change the variables to your liking.Easy to understand the structure , even by me :)
This script is called by the main BAT script , so if you want to change its name , you have to change it in the BAT too.

2. The BAT script

Code: [Select]
@echo off
cls

chdkptp -elist > id.txt

for /f "tokens=*" %%i in ('cscript //nologo folder.vbs') do set Value=%%i

for /f "tokens=3 delims=-" %%A in (./id.txt) do (
chdkptp -e"connect -d=%%A" -e"!require 'extras/dcimdl'" -e"!dcimdl('%Value%/%%A/',true,false)"
>nul 2>nul dir /a-d "%Value%\%%A\*" && (echo Files exist) || (echo No file found in %%A  > check.txt)
)

(i excluded the commands for mass-connect/disconnect.Useless to some.Easy to find them.)

The above script works.But some things i want them to be done differently.
Lets say the last check.That checks if a subfolder is empty or not.It reports both results.But i put only the "empty" result to be written to the file.So if 20 cameras shoot..and one camera fails...it will be 20 "Files exist" in the command prompt  window and one record written in the check.txt.
I have to silence somehow the "positive" result of this check.

Also i dont like the way the images are saved.I have mentioned in earlier posts how i want the things to happen.One folder , all photos with camera-related filenames.

EDIT : i found a way to the first problem i mentioned above. echo "File exists" > nul  , seems to silence the output although i suspect a "blank" line will be produced.I will check it further.
Title: Re: Multi-camera setup project.
Post by: Microfunguy on 11 / July / 2014, 06:36:51
Thanks, I will try that this evening.

As I said, I have a friendly PTP command-line and gui client that handles the shooting and saving to separate folders and lots, lots more but quite honestly if others are willing to devote  time to this problem I would rather be out shooting photos.

I will possibly work on it again during the northern Winter.

I don't see any problem with your clients standing still for tenths of a second !

Title: Re: Multi-camera setup project.
Post by: mphx on 11 / July / 2014, 06:42:36
Thanks, I will try that this evening.

As I said, I have a friendly PTP command-line and gui client that handles the shooting and saving to separate folders and lots, lots more but quite honestly if others are willing to devote considerable time to this problem I would rather be out shooting photos.

I will possibly work on it again during the northern Winter.

I don't see any problem with your clients standing still for tenths of a second !

What problems do you reffer to ?Problems with your client?Bugs?Can i test it with my cameras?I mean are they supported ?

Clients won't have any problem standing still or slightly moving for tenths of a second.But i want to be sure that cameras (all of them ) won't lose more milliseconds than we can handle afterwards.That's why i am searching the most reliable (for many cameras setup ) method from now so i can optimize it and make it work in my liking.
Most of the work is after the shooting in the 3d modelling.I dont want to spend more time than necessary on the shooting process.
Title: Re: Multi-camera setup project.
Post by: Microfunguy on 11 / July / 2014, 06:55:47
What problems do you reffer to ?Problems with your client?Bugs?

Yes, I did start a thread here, will have to find the details.

Quote
Can i test it with my cameras?I mean are they supported ?.

Sure, why not .

Send me a personal message with a suitable email address.
I will have to remind myself how it works.


David
Title: Re: Multi-camera setup project.
Post by: waterwingz on 11 / July / 2014, 08:23:26
1.@waterwingz : I suspected that your script might work that way (one script on the pc and the other on the camera).But the whole situation process raises a conflict in my eyes.
When i mass-connect to the cameras and they go into "rec mode" , ready to shoot , they kinda start "default" script running.I mean i see the "Default Script <ALT>" at the lower left side.
There is essentially no such thing as a true "Default Script".  It's just telling you that there is no script loaded (or assigned to load when you press the shutter button) when you see that.

Quote
Won't this whole process fail if some other script (yours lets say) is running already on the camera?
Not at all - you've missed the basic concept here.  The whole point of what I did was to keep the camera script running at all times and connected to the host code on the PC. Things like the shoot command happen because the host program tells the script on the camera to shoot and it does so.  You need a script running on the camera that understands how to talk to the script on the host.  They all stay sync'd and happy that way.

Quote
3.I see that you quoted two lines i wrote but you left out some others that was the whole point.
I got your point and left out all the text that was all related to the same thing.  Per my comment above, if the script on the camera stays connected to the script on the host the whole time then you won't need to worry at all about disconnecting and reconnecting.

Quote
4. @reyalp : Cameras are using chdk 1.3 r599 .That the version STICK chose for my camera and i dont see a reason not to believe it :)
He is talking about the version of CHDPTP - not CHDK.  STICK has nothing to do with that.
FWIW, it's extremely unlikely you have r599 CHDK 1.3.0 on your cameras.
Title: Re: Multi-camera setup project.
Post by: mphx on 11 / July / 2014, 09:07:31
pff my bad about the versions.

CHDKPTP is r599 and chdk is 1.3.0 but i dont recall subversions at the moment since i am not at home to check the cameras.

The custom chdk build i compiled is a2500-100a-1.3.0-r3496-0-full just for the history.
Probably default build has the same *r3496*.
Title: Re: Multi-camera setup project.
Post by: mphx on 11 / July / 2014, 10:25:16

There is essentially no such thing as a true "Default Script".  It's just telling you that there is no script loaded (or assigned to load when you press the shutter button) when you see that.


Not at all - you've missed the basic concept here.  The whole point of what I did was to keep the camera script running at all times and connected to the host code on the PC. Things like the shoot command happen because the host program tells the script on the camera to shoot and it does so.  You need a script running on the camera that understands how to talk to the script on the host.  They all stay sync'd and happy that way.

Quote
3.I see that you quoted two lines i wrote but you left out some others that was the whole point.
Quote
I got your point and left out all the text that was all related to the same thing.  Per my comment above, if the script on the camera stays connected to the script on the host the whole time then you won't need to worry at all about disconnecting and reconnecting.



I get the concept that "Default Running" means there is no script to run actually.
But when this indicator is ON i have noticed that i cant run a script from pc to the camera let's say.
But my whole thinking at this subject was wrong because i was thinking commands from multicam.lua .
That was wrong since your script is substituting this script and there is one script running at the whole time.

At your last phrase "you won't need to worry at all about disconnecting and reconnecting".
But with the "usb switch" method a disconnection occurs no matter what.At that point the two script won't lose "connectivity"?

Bare with me if my question don't make sense.. i am trying to figure out how your script would behave at all phases of the shooting.
(I am gonna try it in a meanwhile).
Title: Re: Multi-camera setup project.
Post by: waterwingz on 11 / July / 2014, 11:15:42
I get the concept that "Default Running" means there is no script to run actually. But when this indicator is ON i have noticed that i cant run a script from pc to the camera let's say.
You can only run one script at a time on the camera. When chdkptp wants to run a script there cannot be one already running. I think that when it does run a script, it does not provide a script name to the camera so the "default script" name defaults in the CHDK code and that is what you are seeing.

Quote
At your last phrase "you won't need to worry at all about disconnecting and reconnecting". But with the "usb switch" method a disconnection occurs no matter what. At that point the two script won't lose "connectivity"?
When you used CHDKshell to build your own version using my simple patch, you bypassed that. The patch tricks the Canon PTP code into not seeing the disconnection (i.e. USB power going away) when you press the button. The PC also can't tell that the button was pressed so both the host script and the camera scripts keep running as if nothing has happened. That was the whole point of doing the patch in the first place - you could just use the stock build otherwise.
Title: Re: Multi-camera setup project.
Post by: mphx on 11 / July / 2014, 11:50:46
ok , i did a bit of testing with bcamhost/bcamrem scripts.

Features that i liked.

1.Naming the cameras and the shoot count. That is a good feature to check if a camera lost a shot.
2.Easy mass transferring without doing multiple connections with a batch script to download the images.
Mass connection at the beginning and the download from all the cameras..good one.
3.Named folders after the cameras' name.

Although i will insist on what i said before.I don't know what scripts think it is happening when the switch is pressed for shooting.What i see and what computer knows is that it "loses" cameras at that point.
And cameras are getting online again when i press switch again.

For example. I used the script to connect all the cameras.Used the shoot command and as expected it got into a loop.I pressed the switch and photos were taken.
So far so good.At this point chdkptp doesn't see any cameras.
I press switch again and naturally cameras are getting available once again.
At this point host script has lost connectivity with remote script.
I issued a download_last() command and it didn't get through. I had to issue a connect() (again) prior to download_last() one.
That's not a problem for me but it indicates that connectivity was lost on all levels when i pressed the switch for the shooting part to happen.

Or i am missing something ..its possible :)
Title: Re: Multi-camera setup project.
Post by: waterwingz on 11 / July / 2014, 11:58:38
Although i will insist on what i said before.
Hmmm ... well then I will insist that it works for me.   :P

Quote
I don't know what scripts think it is happening when the switch is pressed for shooting.What i see and what computer knows is that it "loses" cameras at that point. And cameras are getting online again when i press switch again.
I think we need to discuss your switch hardware?  Do you have a circuit diagram of what you created?  The patch assumes that you only open the +5V wire in the USB cable (typically the red wire - leave the green, white and black connected).  Usually you would use a momentary contact "normally closed" type switch to do that .
Title: Re: Multi-camera setup project.
Post by: srsa_4c on 11 / July / 2014, 12:14:54
If the camera is busy with a tight loop, it's very much possible that most other firmware tasks don't get any CPU. If something tries to communicate over USB during that time, it will likely fail.
Title: Re: Multi-camera setup project.
Post by: mphx on 11 / July / 2014, 12:41:52
Quote
I think we need to discuss your switch hardware?  Do you have a circuit diagram of what you created?  The patch assumes that you only open the +5V wire in the USB cable (typically the red wire - leave the green, white and black connected).  Usually you would use a momentary contact "normally closed" type switch to do that .

My switch is a classic psu switch button.I took it off of a broken psu.2 wires at the back (although this one has 4 wires and i just use the 2 of them.Both "couples" tested and work and i just chose one of them).
I connected the wires in the red wire of the usb cable (+5V line).
Are you saying that connectivity between cameras and pc should never be lost ?whatever i do with the switch?

Another question concerning your scripts.Keep in mind that remote script is executed manually , not autostarted.

When i issue an exit() command from the pc , script stops executing on the camera.If i wanted to start it again (on the camera) , whats the step ?Just manually executing it from the camera?Or it can be started from the pc ?
Also ,about downloading the last image .Is it possible to download all the images ?Lets say i take a shot with all the cameras , but client sneezed and i have to take another shot for the same session.
This results having 2 images on every camera.Your script will only download the last one.
And a last thing...maybe combine download command with delete command.Most of the times since photos are downloaded , they are not needed to stay on the cameras.

Thanks
Title: Re: Multi-camera setup project.
Post by: mphx on 12 / July / 2014, 07:23:27
@waterwingz

i was looking/testing your two scripts (bcamhost/bcamrem).I was wondering how easy (for someone who knows about lua apparently) to embed your (mass)download function into current multicam.lua.

I see that function download_last() (from bcamhost) calls function cmds.getlastimg() (from bcamrem)  and if am not mistaken no other function is involved in this process.
If we strip those functions from unecessary variables (let's say the one about naming the target-local download folder) is it possible to embed it in multicam.lua?
I have zero knowledge about lua programming , so i might aswell talking nonsense here :)
Title: Re: Multi-camera setup project.
Post by: waterwingz on 12 / July / 2014, 09:20:56
i was looking/testing your two scripts (bcamhost/bcamrem).I was wondering how easy (for someone who knows about lua apparently) to embed your (mass)download function into current multicam.lua.
bcamHost.lua is just a modified version of reyalp's multicam.lua that I'm working on so that it lets me run multiple cameras the way I'd like.  I posted the original version so that novsela would have something to test with but have made many changes to the work flow and added several new "commands" since.

As far as "mass download" goes,  multicam.lua already has the a function called mc:download_last() that does that.
Title: Re: Multi-camera setup project.
Post by: mphx on 12 / July / 2014, 10:37:05
As far as "mass download" goes,  multicam.lua already has the a function called mc:download_last() that does that.

Are you sure about this?I checked the contents of multicam.lua like 10 times ..upwards and downwards and i dont see something related to download.

Only file related with downloading is dcimdl.lua in extras/ but it lacks the "mass" part :)

I am trying all day to see how the two functions i mentioned in your scripts can be combined and put into multicam.lua but as i have said before i lack some lua knowledge.

If you say that such function already exists in multicam.lua feel free to enlighten me :)
Title: Re: Multi-camera setup project.
Post by: waterwingz on 12 / July / 2014, 11:02:47
As far as "mass download" goes,  multicam.lua already has the a function called mc:download_last() that does that.
Are you sure about this? If you say that such function already exists in multicam.lua feel free to enlighten me :)
http://chdk.setepontos.com/index.php?topic=11583.msg114183#msg114183 (http://chdk.setepontos.com/index.php?topic=11583.msg114183#msg114183)
Title: Re: Multi-camera setup project.
Post by: mphx on 12 / July / 2014, 11:10:02
As far as "mass download" goes,  multicam.lua already has the a function called mc:download_last() that does that.
Are you sure about this? If you say that such function already exists in multicam.lua feel free to enlighten me :)
http://chdk.setepontos.com/index.php?topic=11583.msg114183#msg114183 (http://chdk.setepontos.com/index.php?topic=11583.msg114183#msg114183)

Damn i missed you for a little bit.I was exactly at the same thread/post and just finished the test of the *new* lets say multicam.lua.

Working as expected.

Thanks again.
Title: Re: Multi-camera setup project.
Post by: waterwingz on 12 / July / 2014, 11:25:57
Damn i missed you for a little bit.I was exactly at the same thread/post and just finished the test of the *new* lets say multicam.lua.
Helps to keep track of new versions and updates on the svn site : http://trac.assembla.com/chdkptp/browser/trunk/lua/multicam.lua (http://trac.assembla.com/chdkptp/browser/trunk/lua/multicam.lua)
Title: Re: Multi-camera setup project.
Post by: mphx on 12 / July / 2014, 12:28:09
Well i was checking chdkptp binary (windows version) and was still at r599.

Not much love in windows version from reyalp :)
Title: Re: Multi-camera setup project.
Post by: mphx on 12 / July / 2014, 12:58:56
I was reading novsela thread and i see that he is trying something similar with my project,although i believe our cameras wont be on the same level..but anyways.
I was seeing there some very complicated diagrams about the connections of the hubs etc.

I was thinking to use like 8x 10port usb hubs (8 cameras on each of them) and plug them all in 1x 10port usb hub connected to the pc.
A switch on that "last" hub and play with usb-remote and switch on/off method.I know its a very simple concept and i am missing something.

I am guessing it wont work as i imagine right?
Title: Re: Multi-camera setup project.
Post by: waterwingz on 12 / July / 2014, 13:09:10
I was thinking to use like 8x 10port usb hubs (8 cameras on each of them) and plug them all in 1x 10port usb hub connected to the pc.
A switch on that "last" hub and play with usb-remote and switch on/off method.I know its a very simple concept and i am missing something.
How do you plan to power the 9 USB hubs?

If you want to use CHDK's USB remote "sync" feature,  you need to be able to disconnect the 5V "red" wire to all 80 cameras at exactly the same time.  If you don't want to lose USB communications, then you can't simply turn off the power to all the hubs (even supposing that causes the individual cameras to all see the power go off at exactly the same time).

If you can make reyalp's calibrated sync shooting mode in multicam.lua work acceptably then you are spared the pain of trying to switch the hubs.   Note that your earlier tests on two cameras don't tell you what will happen with 80 cameras - the sync error is not 80x(two camera sync error).   It might actually be okay for your application.
Title: Re: Multi-camera setup project.
Post by: mphx on 12 / July / 2014, 16:50:32

How do you plan to power the 9 USB hubs?

If you want to use CHDK's USB remote "sync" feature,  you need to be able to disconnect the 5V "red" wire to all 80 cameras at exactly the same time.  If you don't want to lose USB communications, then you can't simply turn off the power to all the hubs (even supposing that causes the individual cameras to all see the power go off at exactly the same time).

Damn damn damn .I was testing all these days with a non-powered usb hub and i thought i was on a powered one.Tell me if i get the concept right.

1. ~64x cameras powered by an adapter kit (dummy battery and stuff).Every 8 of them on a power plug.
2. 8x 10-port usb hubs powered by different power plug(s) (maximum 8 )
3. 1x 10-port usb hub powered .The 8x hubs of step-2 will connect to it.The switch will be on the cable from this hub to pc.

So , if i am getting this right, somehow , when the shoot task is in loop...i have to press switch FIRST and cut power on all hubs AFTER.And after shot is taken.. i have to give power back to hubs FIRST and then press the switch again AFTER.
Am i getting this right?

Quote
If you can make reyalp's calibrated sync shooting mode in multicam.lua work acceptably then you are spared the pain of trying to switch the hubs.   Note that your earlier tests on two cameras don't tell you what will happen with 80 cameras - the sync error is not 80x(two camera sync error).   It might actually be okay for your application.

In other words , you are suggesting to avoid switch thing?Enlighten me a bit about "calibrated sync shooting mode".When i was using multicam commands for shooting (no switch involved) i was using shoot command with syncat parameter.Is there something else there?
Do i have to issue a sync command to ALL cameras with this method?because issuing sync to 8 cameras was taking *some* secs..i cant imagine what time is needed with ~64....
Title: Re: Multi-camera setup project.
Post by: waterwingz on 12 / July / 2014, 17:57:10
3. 1x 10-port usb hub powered .The 8x hubs of step-2 will connect to it.The switch will be on the cable from this hub to pc.
I don't think that's what you want. See below.

Quote
So , if i am getting this right, somehow , when the shoot task is in loop...i have to press switch FIRST and cut power on all hubs AFTER.And after shot is taken.. i have to give power back to hubs FIRST and then press the switch again AFTER.
Am i getting this right?
No - not really.   What you want is to set things up so that everything is hooked up normally ( i.e. all cameras powered and plugged into a hub,  all the individual hubs connected to a central hub,  and the central hub connected to your PC).    Then you use the PC to issue a "shoot" command to all cameras.  At that point the camera will all start the shooting process and halt just before completing it,  waiting for the USB 5V power at their input jack to go away.  You need to figure out a way to disconnect the USB 5V power (red wire) to each camera at exactly the same time.   

This is exactly what novsela is doing here :  http://chdk.setepontos.com/index.php?topic=11583.msg114297#msg114297 (http://chdk.setepontos.com/index.php?topic=11583.msg114297#msg114297)


Quote
If you can make reyalp's calibrated sync shooting mode in multicam.lua work acceptably then you are spared
In other words , you are suggesting to avoid switch thing?Enlighten me a bit about "calibrated sync shooting mode".When i was using multicam commands for shooting (no switch involved) i was using shoot command with syncat parameter.Is there something else there?
Do i have to issue a sync command to ALL cameras with this method?because issuing sync to 8 cameras was taking *some* secs..i cant imagine what time is needed with ~64....
I think you can do the sync thing once and then just shoot with the values it figures out.   Have only issued the command once while experimenting but that seems to make sense to me.


FYI : I updated my bcamHost / bcamRem lua scripts :  http://chdk.setepontos.com/index.php?topic=11583.msg114393#msg114393 (http://chdk.setepontos.com/index.php?topic=11583.msg114393#msg114393)
Title: Re: Multi-camera setup project.
Post by: reyalp on 12 / July / 2014, 17:57:49
In other words , you are suggesting to avoid switch thing?Enlighten me a bit about "calibrated sync shooting mode".When i was using multicam commands for shooting (no switch involved) i was using shoot command with syncat parameter.Is there something else there?
With the latest lua files from chdkptp svn and CHDK 1.3 (not currently in a release zip, but I'll probably get another one out this weekend), you can use shoot_hook_sync instead of shoot, which should have substantially better sync.
Quote
Do i have to issue a sync command to ALL cameras with this method?because issuing sync to 8 cameras was taking *some* secs..i cant imagine what time is needed with ~64....
Yes, it would be quite slow. It's possible this process could be sped up, but in any case I wouldn't bet much on the reliability with 64 cams.

Note that you should only have to do init_sync once after startup. Doing it after you have switched to rec mode should give more accurate results.

It's possible you could save the sync timings by serial number, or assuming all your cameras are the same model, just come up with empirical values from running init_sync a few times.
Title: Re: Multi-camera setup project.
Post by: mphx on 12 / July / 2014, 18:28:14
@waterwingz

Ok time to give another try to chdkptp method (no switch invloved).I dont like to start pulling wires all over the place.

I think your script(s) are what i'd like for my projects but i am not very comfortable with the way they work.
I mean one script on pc , another on cam.I'd prefer multicam.lua way.
I mean , script is running on pc and runs a part of the "code" from itself to the camera.
Can't you do it this way? :)

@reyalp

Just replace shoot() command with shoot_hook_sync()? is that what you mean?

And sync() is still required i suppose even with the above command?

Also , are you saying that i can issue like 20x sync() commands and write down an average sync timing of every camera and issue them through a file somehow?
Can you elaborate more on this thing?


Thanks again all.
Title: Re: Multi-camera setup project.
Post by: waterwingz on 12 / July / 2014, 18:37:46
I think your script(s) are what i'd like for my projects but i am not very comfortable with the way they work.
I mean one script on pc , another on cam.I'd prefer multicam.lua way.
I mean , script is running on pc and runs a part of the "code" from itself to the camera.
Can't you do it this way? :)
Here's the problem. 

The multicam way loads the same script on every camera and there is no unique way to identify each camera from the host.  What you get is cameras in random order based on how they were enumerated when the USB system connected them. 

What I wanted was to be able to set the camera number based on its physical position on the multicam rig - numbered right to left as they were mounted for example.  Using a unique script on each camera does that.

I guess you could build a PC based table that cross references each camera's unique serial number with a camera number and go at it that way.  It would be a major PITA to setup and edit. 

Or maybe  there is a way to trick the "default script" to read @param values from the camera's A/CHDK/DATA directory.

Alternatively, I could add a "download script" function to bcamHost.lua that would load the same script onto every camera and then reboot the cameras.  As long as you had the script set to autorun on reboot you would be good to go?

I tried to address this here :  http://chdk.setepontos.com/index.php?topic=11631.0 (http://chdk.setepontos.com/index.php?topic=11631.0) but there was not a lot of interest.
Title: Re: Multi-camera setup project.
Post by: reyalp on 12 / July / 2014, 18:49:27
Just replace shoot() command with shoot_hook_sync()? is that what you mean?
if you were using mc:cmd('shoot',{syncat=100}) you would use  mc:cmd('shoot_hook_sync',{syncat=100}) instead.

If you were using testshots, you can use mc:testshots({shoot_cmd='shoot_hook_sync'})

Quote
And sync() is still required i suppose even with the above command?
mc:init_sync() is required if you want synchronized commands. It is only required once after mc:connect()

Quote
Also , are you saying that i can issue like 20x sync() commands kai write down an average sync timing of every camera and issue them through a file somehow?
In principle, it seems like this should work. If the camera is on the same interface every time (or the interfaces are all equal), then the delay shouldn't change between sessions.

Some code would have to be written to initialize the values without running init_sync, but this should not be a big deal.
Title: Re: Multi-camera setup project.
Post by: mphx on 12 / July / 2014, 19:10:35
@waterwingz

ok i will be honest here.I am covered by multicam.lua , but i am more covered with your scripts.
And "more" means the way *your* download process works with the latest update.

BUT i am not feeling comfortable yet :)
I get the idea why it can't be done the multicam way.An idea just popped my little head.
Isn't any way the host script to "read" the serial numbers and cross reference with a specific number?As you suggested.And then pop up a big-fat font message to respective lcd of the camera.

While trying to play a bit with batch script commands and manipulating folders and files for trying to rename images and put them in one folder (as you did with your script eventually)...i found batch commands that could read the contents of a file with the structure <serial number>=<number> in each line and compare a given string to the first part of every line (that is the serial number part) and take the number as a result and do something with it.
I assume it would be *rather* easy to be done with lua commands...

@reyalp

First of all testshots didn't work for me last time i checked..program unresponsive and had to force close it.
Don't know if it will behave the same with the latest version i compiled for future tests.

I got all 8 cameras here , had only 2 for testing while partner had the rest..so i will try some syncing and shooting and see what will happen.

If you feel like to implement the thing about issuing sync timings through some file...let me know :)
Title: Re: Multi-camera setup project.
Post by: waterwingz on 12 / July / 2014, 19:24:58
Isn't any way the host script to "read" the serial numbers and cross reference with a specific number?As you suggested.And then pop up a big-fat font message to respective lcd of the camera.
That leaves you with big-fat font messages showing the camera numbers all mixed up and out of sequence on the shooting rig.  I wanted them in order - and if I need to swap out a camera,  I just put the new one in place and set the camera number with the script @param value.

It's really up to you what you are happy with.   Having worked on many networked controller systems, I'm really aware of the need to be able to positively identify each remote unit and its location.

Title: Re: Multi-camera setup project.
Post by: reyalp on 12 / July / 2014, 19:46:10
commands that could read the contents of a file with the structure <serial number>=<number> in each line and compare a given string to the first part of every line (that is the serial number part) and take the number as a result and do something with it.
I assume it would be *rather* easy to be done with lua commands...
Yes, that has been my plan for multicam.lua. You can make a table indexed by serial number, and then you can associate whatever information you want with the serial.

For initial identification, you'd just need something like waterwingz number display (Or do something obvious with the display and/or AF led) and a command to record some id for the cam.  You could power them on one by one in order, or just connect to them all and go through the list. If you moved them around, you'd just need to update the affected cams.

Quote
@reyalp

First of all testshots didn't work for me last time i checked..program unresponsive and had to force close it.
Don't know if it will behave the same with the latest version i compiled for future tests.
This should be fixed in rev 602. This happened if the synctime given was too short (which could also happen if you didn't specify one)

Quote
I got all 8 cameras here , had only 2 for testing while partner had the rest..so i will try some syncing and shooting and see what will happen.

If you feel like to implement the thing about issuing sync timings through some file...let me know :)
I'll try to look into it, but I can't promise any particular timeframe. If you verify that the new method gives you acceptable results, I'd at least know it had the potential to be useful.

How are you measuring the sync?
Title: Re: Multi-camera setup project.
Post by: mphx on 12 / July / 2014, 20:22:23
@reyalp

At first phase , personally , i don't need to know what camera is what number.At shooting phase i just need photos to have some numbering so they can go all in the same folder without the risk of having two or more photos with the same name.

At second phase , for troubleshooting purposes , if some camera had some issues , yes , i would like a way to identify physically which camera is the problematic one.
At this phase numbering can be associated with serial number..so if i see that camera1 lets say didn't shoot and i want to find that camera on the poles...it would be nice to issue a command and pop a TEXT on the screen of that camera.
Sounds easy, but you know better :)
If you move them around , you don't care if the order of the numbers is screwed.You know you can find the camera you want issuing some command.
Worst thing is to do some unnecessary walking..big deal.

How i measure sync?Probably with some lame way , since i don't have any crt monitor lying around for some reliable measurements.
Last time i used an online meter ( this one http://stopwatch.onlineclock.net/ (http://stopwatch.onlineclock.net/) ) and tried to focus all cameras on it.Then checked pictures to see what sync was achieved.

Just finished installing CHDK to the cameras..trying to find a way to set them up all focusing at the same spot and will put a tablet there running the online timer.Tomorrow will do some tests , getting late.


Well , project will be done.We expect to be ready around September , too much to be done with the place , decoration , putting things , painting walls , construct the poles , buying stuff.
I just need to clarify from now which method will be used , because it will determine and some stuff that will be needed to be bought depending on that.
So take your time and do whatever you plan to do in your own pace...it will be useful at some point , since i see the switch-method is going to be rather troublesome so i intend to give chdkptp a GOOD TRY :)
Title: Re: Multi-camera setup project.
Post by: Hardware_Hacker on 12 / July / 2014, 20:38:36
I was reading novsela thread and i see that he is trying something similar with my project,although i believe our cameras wont be on the same level..but anyways.
I was seeing there some very complicated diagrams about the connections of the hubs etc.

I was thinking to use like 8x 10port usb hubs (8 cameras on each of them) and plug them all in 1x 10port usb hub connected to the pc.
A switch on that "last" hub and play with usb-remote and switch on/off method.I know its a very simple concept and i am missing something.

I am guessing it wont work as i imagine right?

Some Important Multi-Camera Project Design Points:-

For "Passive" USB-2 cables:-
* USB-2 Cable Length Limit of 5 meters.
* USB-2 Limit of 3(?) Hubs in Series.
* USB-2_7_Port_Hubs "ARE" two 4 port USB-2_Hubs but just connected in series.
* USB-2_10_Port_Hubs "ARE" ten independent ports.
* USB-2_10_Port_Hubs can have a 3 to 1 price variation for the same but re-branded product.
* USB-2_10_Port_Hubs have a, current limited, power supply delivered from the upstream PC.
* USB-2_10_Port_Hubs Switched , UnSwitched, Powered or Un-Powered are vey easy to "Hack".

For "Active" USB-1/2 over Cat5 or Cat6 cables.
* USB-1 Cable or Cat5 or Cat6 Cable Length Limit of 100 meters.
* USB-1/2 Cable or Cat5 or Cat6 Cable  Length Limit of 50 meters.
* A "Pair" "Active" USB-1/2 Adaptors always are required.
* The "Active" Adaptors for Cat5 or Cat6 cables always uses USB-1/2 protocols.
* All the Cat5 or Cat6 cables pairs are used, BUT they can be "Hacked" [the Details are a WIP]
* The  "Hacked #1" "Active" USB-1/2(s) will then have "Dual" USB-1/2 Channels.
* The  "Hacked #2" "Active" USB-1/2(s) can then have a "PoE" adaptor to:-

#1 Multiplex Dual Channel USB 1/2 "Read/Download" over a single Cat5 or Cat6 cable.

#2 Provide"PoE" battery "Trickle" charging for the multi-cam rig.
#2 Multiplex "Write/Shoot" over a single Cat5 or Cat6 cables via a "PoE" Adapter.

All the above seems very complex, but the "Hacks" and "Wiring" are all done in Break Out Box's. ["BoB's"]
So the the Multi-Camera Project with "BoB's" setup is very modular and is very easy to update or reconfigure.

Important Note in regard to "Multi" which in this post means 80 Cameras.
All, power mains supplied, Camera Battery Adapters have the ability to crate High ESD Voltages.
Also with 80 Camera Battery Adapters there could be 80 TIMES the Common Mode Noise
currents in the camera array rig.

With only a small number of camera in the project this will not be a problem....."BUT ....  is continued"

from here http://chdk.setepontos.com/index.php?topic=11583.msg113619#msg113619 (http://chdk.setepontos.com/index.php?topic=11583.msg113619#msg113619)

and here http://chdk.setepontos.com/index.php?topic=11583.msg113516#msg113516 (http://chdk.setepontos.com/index.php?topic=11583.msg113516#msg113516)

The Original Design Points are here http://chdk.setepontos.com/index.php?topic=11583.msg113423#msg113423 (http://chdk.setepontos.com/index.php?topic=11583.msg113423#msg113423)
H-H

Edits #1 & 2 added some more design more details.

continued here http://chdk.setepontos.com/index.php?topic=11667.msg114430#msg114430 (http://chdk.setepontos.com/index.php?topic=11667.msg114430#msg114430)

Edit #3  Another Important Design Point is also in regard to common mode "Noise Pick-Up":-

A 80 camera multi-camera rig will act as an large "Aerial" and pickup unwanted  AF and RF noise,
measured in "volts per meter".
The effective "Electrical Lentgh" for the rig will be many times, i.e. probably much greater than 100x, more that of a simple prototype rig.

For more details see http://whatis.techtarget.com/definition/volt-per-meter-V-m (http://whatis.techtarget.com/definition/volt-per-meter-V-m)
Title: Re: Multi-camera setup project.
Post by: reyalp on 12 / July / 2014, 20:40:22
How i measure sync?Probably with some lame way , since i don't have any crt monitor lying around for some reliable measurements.
Last time i used an online meter ( this one http://stopwatch.onlineclock.net/ (http://stopwatch.onlineclock.net/) ) and tried to focus all cameras on it.Then checked pictures to see what sync was achieved.
This will not give you a very precise measurement, for the reasons described in http://chdk.setepontos.com/index.php?topic=11583.msg114389#msg114389 (http://chdk.setepontos.com/index.php?topic=11583.msg114389#msg114389)

This may be OK for your project, but you should be aware of it. The absolute best you could get with multicam will have something like 10-20ms variation anyway, and in practice it's probably worse.

You also need to make sure the exposure time is relatively short compared to the precision you are trying to measure.
Title: Re: Multi-camera setup project.
Post by: mphx on 12 / July / 2014, 20:53:55
@Hardware_Hacker

Thanx for your input on the matter , will keep them in mind.

@reyalp

I know its a lame way but it's the best one i can come with since i dont own a crt monitor anymore.

As i said before project is to shoot people standing on a platform in the center of the poles.I suppose exposing of the "objects" wont be that long and variation of the sync around some tens of milliseconds would be acceptable.
Differences in the photos will be "fixed" at the 3d modelling/processing afterwards.No big deal.
So if multicam at its best gives variations of 10-20ms or even 40-50ms..its acceptable.

Gonna do some lame tests tomorrow with the 8 cameras to see what's going on :)
Title: Re: Multi-camera setup project.
Post by: Hardware_Hacker on 12 / July / 2014, 22:13:55
@Hardware_Hacker
Thanx for your input on the matter , will keep them in mind.
@reyalp
I know its a lame way but it's the best one i can come with since i dont own a crt monitor anymore.

See post #42, edit #1

 I am working on a, low cost, simple, multiple 8x8 LED Dot Matrix Array Sync Tester using a
32khz watch crystal ["PAL" crt monitors have a horizontal frequency of ~~15.750 kHz.]

The concept is similar to Slow Scan TV but "ONLY ONE" LED in "X" x "Y" LED Dot Matrix Array is on at a time.
The, 16x32, or 16x40,  LED Dot Matrix Array can then have various scan times. i.e. 1x, 2x, 4x, 8x, etc.

The Slow Scan LED Array is "Reset" by the shoot command, the camera test images will be simple
"Bar Graphs" in Hexadecimal time. this can also record the time in S:M:H. see also here.

Black Standard_ free Windows Binary Clock http://www.romanblack.com/binclk.htm (http://www.romanblack.com/binclk.htm)

Note:- The key concept is the camera "Sync" time difference and the fact that is measured in
            hexadecimal time units is not of any real practical significance.

H-H

Comments, Ideas, W-W, or any one.

Edit #1 a similar idea By ahull Re: testing sync among more cameras Reply #98 20/November/2013, is here

http://chdk.setepontos.com/index.php?topic=8312.msg107331#msg107331 (http://chdk.setepontos.com/index.php?topic=8312.msg107331#msg107331)

This concept can also be extended to produce "Strip" Panoramas.
A camera is mounted on a old VCR "Video_Drum" motor the above timer outputs are used
to drive some sort of motor controller to rotate the camera.

A combined Multi-Camera Sync_Tester and a "Strip" Panorama maker.

Here http://chdk.setepontos.com/index.php?action=dlattach;topic=11667.0;attach=10443 (http://chdk.setepontos.com/index.php?action=dlattach;topic=11667.0;attach=10443)
Title: Re: Multi-camera setup project.
Post by: waterwingz on 12 / July / 2014, 22:41:32
I am working on a, low cost, simple, multiple 8x8 LED Dot Matrix Array Sync Tester using a
32khz watch crystal ["PAL" crt monitors have a horizontal frequency of ~~15.750 kHz.]
The concept is similar to Slow Scan TV but "ONLY ONE" LED in 8x8 LED Dot Matrix Array is on at a time.
The, 16x32, or 16x40,  LED Dot Matrix Array can then have various scan times. i.e. 1x, 2x, 4x, 8x, etc.
The Slow Scan LED Array will is "Reset" by the shoot command, the camera test images will be simple
"Bar Graphs" in Hexadecimal time. this can also record the S:M:H see also here.
That's kind of what I did here :  http://chdk.setepontos.com/index.php?topic=8312.msg104805#msg104805 (http://chdk.setepontos.com/index.php?topic=8312.msg104805#msg104805)

I eventually modified what you see in the picture to use 10 "high bright" LED's.   With some fiddling with the initial count delay, I got quite good results.

But then I realized how much easier, and more accurate, this is if you use an oscilloscope.  Even the cheapest old analog one will do.
Title: Re: Multi-camera setup project.
Post by: Hardware_Hacker on 12 / July / 2014, 23:19:56
"..... Even the cheapest old analog one will do...."

But everything is "Digital" these days, I traded my Old Analogue Junk for a "Free" Ixus 265 camera.

H-H

Slightly Off Topic, A combined Multi-Camera Sync_Tester and a "Strip" Panorama maker.

Example see the attached Hand Held Strip Pano-307 [low light].png

Was made on a hand held Ixus 125 using the continuous canon shoot mode.

Its based on the original concept By Knuckx CHDK Remote-2 - a two stage remote control adapter for CHDK

24/February/2012 here http://chdk.setepontos.com/index.php?topic=7717.msg81804#msg81804 (http://chdk.setepontos.com/index.php?topic=7717.msg81804#msg81804)

and here https://dl.dropboxusercontent.com/u/39043879/IMG_0138.JPG (https://dl.dropboxusercontent.com/u/39043879/IMG_0138.JPG)

It could also be used or extended for a portable Multi-Camera rig.
Title: Re: Multi-camera setup project.
Post by: waterwingz on 12 / July / 2014, 23:29:46
But everything is "Digital" these days, I traded my Old Analogue Junk for a "Free" Ixus 265 camera.
Offer them a case of beer or the equivalent in local currency to trade back?
Title: Re: Multi-camera setup project.
Post by: mphx on 13 / July / 2014, 06:07:02
Did some testings today with all 8 of them.

Since i don't own any fancy equipment for the sync testing , i just held a tablet running the online meter in front of the cameras.

On all 3 tests , all cameras "shot" the same time up to the last millisecond..That's a good thing although i get that this kind of measurement isn't that accurate.

@reyalp

At syncing process , i noticed that the program went unresponsive for few secs at the middle of the process.
That happened to me before when i was testing 8 cameras , but after some syncing , then it went smoothly.
Today i hit 2-3 syncs just to see the behavior , but on all syncs , the "problem" remained.
No impact to the shooting as i see , since all cameras were mostly synced.
I thought to mention it in case that indicates some problem...
Title: Re: Multi-camera setup project.
Post by: reyalp on 13 / July / 2014, 17:17:28
At syncing process , i noticed that the program went unresponsive for few secs at the middle of the process.
That happened to me before when i was testing 8 cameras , but after some syncing , then it went smoothly.
Today i hit 2-3 syncs just to see the behavior , but on all syncs , the "problem" remained.
No impact to the shooting as i see , since all cameras were mostly synced.
I thought to mention it in case that indicates some problem...
If you are using the chdkptp GUI, I would strongly suggest switching to the CLI for multicam. Start with chdkptp -i

If you were running init_sync in the GUI, long running operations can make windows show "unresponsive" This does not a problem own it's own.

I recommend using the CLI since timing may not be as good using the GUI, and I have noticed some problems with connections being dropped when you are using multiple cameras with the GUI. Also, I do almost all my development in the CLI, so it is more likely to be well behaved.

If you weren't running the GUI, then I'd need clarification of how it became unresponsive.
Title: Re: Multi-camera setup project.
Post by: mphx on 13 / July / 2014, 17:47:08
@reyalp

Since there are some commands involved when handling multiple cameras...you know..start multicam , sync , preview mode , rec mode , download images , and all these commands again and again...i am bit bored typing in CLI :)
So i have made some buttons in the gui for more easy use of the commands.

When program was processing the sync timing of each camera ...it got "stuck"..probably operation took a bit longer at camera no 3.Then after like 5-6 seconds , messages in the console were shown all together..like something were holding them back.
Tried once , twice , three times...same thing at the same camera..
That had happened some days ago too, but after 2-3 syncs , all processing was smooth...

Anyways , there was no practical impact at the shooting.Although one camera at try no 1 , didn't shoot.At tries no 2 and no 3 all were smooth and ok.
Title: Re: Multi-camera setup project.
Post by: reyalp on 13 / July / 2014, 18:50:32
@reyalp

Since there are some commands involved when handling multiple cameras...you know..start multicam , sync , preview mode , rec mode , download images , and all these commands again and again...i am bit bored typing in CLI :)
So i have made some buttons in the gui for more easy use of the commands.
That makes sense. FWIW, you could also make Lua functions or CLI commands that do this. I have never used the GUI with more than 3 cameras connected, so I wouldn't be confident that it will behave nicely with 64.
Quote
When program was processing the sync timing of each camera ...it got "stuck"..probably operation took a bit longer at camera no 3.Then after like 5-6 seconds , messages in the console were shown all together..like something were holding them back.
This sounds fairly normal. Long running calls block the GUI in some cases. This may vary depending on whether you are issuing the commands in the input box or using code directly from your buttons.

If for some reason things got hung up in the middle of an individual sync attempt, it could throw the timing off for that camera. In this case a line like

1:Canon PowerShot A540: send 10 diff 863 pred=51743 r=51750 delta=-6

would show a large delta.

Quote
Anyways , there was no practical impact at the shooting.Although one camera at try no 1 , didn't shoot.At tries no 2 and no 3 all were smooth and ok.
Shoot failing (where the camera never gets to the point it thinks it's ready to shoot) is something of a known issue. This may be more likely if you are in full auto mode (AUTO rather than P) or if the flash is enabled.

Another thing to watch out for with the GUI: By default, it polls all the available cameras cameras to update the camera dropdown. I don't think this should cause problems, because it runs in a timer that won't execute while something else is actually running, but if it does you can control with
set gui_dev_check_interval=<value>

0 will turn it off completely.
Title: Re: Multi-camera setup project.
Post by: Hardware_Hacker on 13 / July / 2014, 20:55:19
I was seeing there some very complicated diagrams about the connections of the hubs etc.

I am guessing it wont work as i imagine right ???
Another Design Setup Point and another "...very complicated diagram..." A590IS-Current [5x7].png

This shows the current changes, with a little bit of artistic license,  and the Multi-Camera Sync testing
concept but using 5x7 DMD's using two A590IS cameras as an example .

* The (Image) Sync Bar Graphs are different lengths because each camera is behaving slightly differently.
* The Cameras Current Spikes occur at different times because each camera is behaving slightly differently.

Note that the Sync Tester has different scan rates. The Image Bars are very short because a very low
scan rate was used for the example.

So, for 80 cameras in the array, and if the camera control is wired/connected as a "Rat's Nest"
these currents will interact, randomly, with the Multi-Camera Sync.

# Some cameras in the Array will see a Advanced Sync Pulse.
# Some cameras in the Array will see the Real Sync Pulse.
# Some cameras in the Array will see a Retarded Sync Pulse.
# Some cameras in the Array might occasionally see NO Sync Pulse. [But Very Unlikely]

This "Rat's Nest" and "Current Spike" effect is made much worse by using Battery Power Adapters.

Again see ( Post #27 by W-W) the link is here
 http://chdk.setepontos.com/index.php?topic=11583.msg113516#msg113516 (http://chdk.setepontos.com/index.php?topic=11583.msg113516#msg113516)

"...I'd spend the money on .... opto-couplers per camera (..., and USB 5V power) and let each camera "float" on its own.

Again see the response ( Post #28 by H-H) the link is here
http://chdk.setepontos.com/index.php?topic=11583.msg113517#msg113517 (http://chdk.setepontos.com/index.php?topic=11583.msg113517#msg113517)

Also continued from Here
http://chdk.setepontos.com/index.php?topic=11583.msg113619#msg113619 (http://chdk.setepontos.com/index.php?topic=11583.msg113619#msg113619)

Edit #1 Added Attack_Decay-05.png

Advanced Sync Pulse and Retarded Sync Pulse produced by"Rat's Nest" and "Current Spike"
effect is made much worse by using Battery Power Adapters.

H-H

"....I am guessing it wont work as i imagine right ???...."
Title: Re: Multi-camera setup project.
Post by: mphx on 14 / July / 2014, 05:29:22
@Hardware_Hacker

Ok i got the point.It's not that easy as i thought :)

@reyalp

I created some lua scripts , containing the commands i am using in the buttons at GUI.
And  used them through CLI.Everything worked as expected and syncing was pretty good (almost perfect judging from the online meter i used..but ye ye i know it's not an accurate method but variation of few msecs is acceptable for the project).
Ok it's a bit more work writing commands in CLI but i can live with it if that means more reliable conditions.

So for now i will stick to this "method" and see how it goes with more cameras , when we get the rest i mean :)
Title: Re: Multi-camera setup project.
Post by: reyalp on 14 / July / 2014, 16:27:10
Ok it's a bit more work writing commands in CLI but i can live with it if that means more reliable conditions.
The GUI might work for you, there's just a lot more room for things to go wrong. In the long run, it would certainly be nice to have multicam controlled from the GUI.

If you want to share you code I can look into incorporating it into multicam.
Quote
So for now i will stick to this "method" and see how it goes with more cameras , when we get the rest i mean :)
Since it seems like this approach might be usable, I'll try to get serial number mapping / download stuff sorted out.

One thing to be aware of with multicam is that the time it takes to shoot will go up with the number of cameras. It works by sending a message to each cameras that says shoot at time X in the future, and sending the message to each camera takes a certain amount of time (there is no broadcast in PTP). The "minimum sync delay" listed after init_sync() is an estimate of this, although in practice you probably want to leave some head room. On my setup this seems to be about 4 ms/cam with Digic 4 cams, but I don't know if there will be additional overhead if you have a bunch of hubs and cams.
Title: Re: Multi-camera setup project.
Post by: Hardware_Hacker on 14 / July / 2014, 16:34:44
@Hardware_Hacker
Ok i got the point.It's not that easy as i thought :)

For anyone that still haven't got the point and don't like  "...very complicated diagrams..."

A much simpler explanation, using an array of 100 cameras and 100 cheap power adapters.

Lets say each camera uses 3 watts thats 300 watts supplied from the 100 cheap power adapters.

Starting with the case where array of 100 cameras is powered from the original canon battery's:-

* There is NO External (sneaky) available paths for the current's to flow through.
* The original canon battery has very low internal resistance.
* The Canon Battery management system works even when internal resistance rises.
* There are FCC compliance rules regarding (RF) escaped energy.

In the case of the 300 watts supplied from the 100 cheap power adapters.

* The Canon Battery management system works with cheap power adapters.
* The cheap power adapters probably have much higher internal resistance.
* There are multiple External (sneaky) available paths for the currents to flow through.
* Some Canon P&S cameras have a 1/4-20 Metal tripod mount.
* Via the USB-B cable connectors.
* Via the 100 cheap power adapters power cables.
* Via the Optional Battery third terminal Sync.
* Via other sneaky Common mode current paths, i.e. Restive, Magnetic, Capacitive Coupling.
* The sneak currents or escaped energy Causes very random effects as per prior posts.
* The 100 cheap power adapters are also a SOURCE of sneak currents.

Only a very small percentage of the original 300 watts will, in practice, will directly affect the Sync.
So let's say its 0.1% this is still very significant amount of sneak currents going through your
"Rats Nest" wiring which could have 100 or even 1000 times more "Electrical Length" than
a simple prototype rig with only a couple of cameras .

So the overall project aim is just to try to have some sort of control over the sneak currents.
And have some sort of control (plan) over the Common Sync wiring before construction starts.

Edit #1 attached Multi-Camera_Array_Concept [+Rats].png

This is the case when the Sync is hard wired to each camera in the array.
So the aim is to dissapate the energy in the Parallel Sync Pulse in a resistor at the
far end of the USB-2 +5 Volt Sync Wire. [when using USB-2 Hot-Plug]

* USB-2 Hot-Plug Parallel Sync Pulse will be faster, so there is less USB-Jitter effect.
* Less sneak currents or escaped energy will be picked up via the common mode noise.

Note That this applies also to Opto-Couplers. They have another issue to consider.
         "Miller Effect", this is also helped by individual termination resistors, but at the cost of
         sensitivity of the Opto-Couplers. see

http://en.wikipedia.org/wiki/Miller_effect (http://en.wikipedia.org/wiki/Miller_effect)

Edit #2

This one in series of post's in regard to Multi-Camera Arrays is also about what physical/scaling
effects that might/may become important a CHDK Multi-Camera Array Constructor.

I regard to USB-2 there is probably over a billion USB-2 devises in use, i.e. a well proven technology.

I regard to USB-2 Hot-Plug CHDK Remote Switching [Non-array] devises in use, may be well over
10,000 i.e. another well proven technology.

I regard to USB-2 Hot-Plug CHDK Remote Switching, for Large Camera Arrays, devises in use, might
be about 20.  i.e. an emerging technology.

H-H

Edit #3 see  Reply #59 by W-W ... [Fixed some stuff]

"...nobody has ever made it work...."

The Post is about "trying to make it work better" as you increase the number of cameras in the array.

Also "...describing here is a simple exercise in Ohm's law..."

The Post is really about "Reactance" effects  as you increase the size and number of cameras in the array.
[ i.e. Restive, Magnetic, Capacitive Coupling.]
 http://en.wikipedia.org/wiki/Electrical_reactance (http://en.wikipedia.org/wiki/Electrical_reactance)
Title: Re: Multi-camera setup project.
Post by: mphx on 14 / July / 2014, 17:31:37

The GUI might work for you, there's just a lot more room for things to go wrong. In the long run, it would certainly be nice to have multicam controlled from the GUI.

If you want to share you code I can look into incorporating it into multicam.


Since it seems like this approach might be usable, I'll try to get serial number mapping / download stuff sorted out.

One thing to be aware of with multicam is that the time it takes to shoot will go up with the number of cameras. It works by sending a message to each cameras that says shoot at time X in the future, and sending the message to each camera takes a certain amount of time (there is no broadcast in PTP). The "minimum sync delay" listed after init_sync() is an estimate of this, although in practice you probably want to leave some head room. On my setup this seems to be about 4 ms/cam with Digic 4 cams, but I don't know if there will be additional overhead if you have a bunch of hubs and cams.

Till now i haven't done anything fancy. As far as GUI is concerned i have made an additional TAB (i called it "multicam") and i created some buttons there .Buttons that at the bottom line execute multicam.lua commands ( start/connect , sync , rec mode , preview mode , shutdown all , exit , download last).For fast management on multiple cameras.
I had an "argument" with my project-partner about gui vs cli.I told him that cli is a bit more "typing" but more reliable while gui/buttons are more user friendly and less reliable (as far as sync is concerned , all other commands are working great) ..
He definitely wants gui and buttons.He is even trying to "skip" sync process if that means less potential trouble in the whole process.Told him that it will be risky and stupid to skip sync at all.
With your last paragraph you put a new parameter in the play i didn't think/consider/know.We have to consider it too.

Things i'd like to see in multicam.

1.Download stuff- Downloading last images works great.The folder naming could be tweaked a bit.In two ways.
First before creating each cameras' folder (named as i can understand from their increasing number e.g. 1,2,3,4,5...) it could create a parent folder e.g. shoot1 and create cameras' subfolders in it.That implies that it has to check for available increasing numbers for the naming.
Waterwingz has done something like this with his scripts.
Also i don't know if serial number mapping is easy but if these folders had their names from the first x numbers of the serials then photos or the folders themselves can be easily manipulated through batch scripts.
I mean instead of naming these folders like 1,2,3,4,5,6... lets name them e.g. 0ACEC43 (part of the serial number).Then a batch script can easily map them with a database of serials and rename photos like cam1-img001.jpg for instance.And put them in one common folder.
Lastly for the download issue i would like to see download ALL and some deleting command :)
I don't know what can be done with lua , so i just throw ideas.

2.The thing we were talking about issuing sync timings through a file.You know , hit 10-15 syncs..take the average of the timings and then issue them through some commands or something.Don't know if this is possible , but if sync needs like 10-12 secs for 8 cameras , i believe for 64 will be ~80 secs , that's like 1,5min.
Not looking good :)

3. Some big font in camera's display to state its number?As a result of some serial mapping if this is possible to be done.


P.S. : Did some testing without syncing on the cameras.They were rather synced all of them.As much as i can tell from my lame online-testing method.But i believe 64 without syncing will be a bit mess at the best.So syncing process must be sorted out to be fast and accurate as much as it can be done.

Title: Re: Multi-camera setup project.
Post by: Microfunguy on 14 / July / 2014, 18:29:18
Well, I like an easy life.

For my outdoor rig I will power them with multiple lead-acid batteries and use a simple USB remote switch, no hubs needed.
Back home, I will connect each group of eight via a hub to the PC and switch them to Playback one-by-one.
The images will be automatically downloaded to numbered folders without using PTP.

If I ever need anything more complicated, which is unlikely, I will just use CHDK if I am too lazy to spend more time on my command-line application.

Title: Re: Multi-camera setup project.
Post by: waterwingz on 14 / July / 2014, 20:45:23
* There is NO External (sneaky) available path for the 300 watts to flow through.
This is nonsense.  Watts are a measure of power dissipation - they do not "flow" or "sneak" around.  Current flows and is measured in amps. 

What you are describing here is a simple exercise in Ohm's law where you have multiple power sources.  If the DC side of the power sources all use a common (low resistance) grounding point there is no issue.  That simply comes down to a large enough conductor and good bonding to minimize  "Electrical Length".

If the power supplies have any significant leakage from the AC side then that's an electrical safety issue regardless of whether you use one or fifty. Grounding the DC side will eliminate "floating" voltage levels the can potentially product very low energy sparks.

Noise pickup on the USB 5V signal line is a potential problem which will depend on sources of high frequence noise in the immediate environment.  However, as you point out, it can be mitigated by a suitable termination resistor at the end to each USB cable set.

This is not that hard - reading your description is enough to suggest this project cannot be done and that nobody has ever made it work.

Sorry to be blunt here.
Title: Re: Multi-camera setup project.
Post by: reyalp on 14 / July / 2014, 22:33:02
P.S. : Did some testing without syncing on the cameras.They were rather synced all of them.As much as i can tell from my lame online-testing method.
How are you shooting for these shots? Specific sequence of function calls.
Quote
But i believe 64 without syncing will be a bit mess at the best.
Each command is just sent sequentially to each cam, so if you aren't using sync, 4ms per cam  there would be a minimum 1/4 second between the first and last cam.

Quote
So syncing process must be sorted out to be fast and accurate as much as it can be done.
If you always get approximately the same sync values for all the cams, then we can just use a fixed value.

It may be possible to speed the sync process up. It users 10 iterations because that was a number I picked off the top of my head, and the 10 iterations of _check are probably not needed in routine use.

I need to spend some time looking at this code, I've kind of forgotten how it works (assuming it actually works  :-[)
Title: Re: Multi-camera setup project.
Post by: Hardware_Hacker on 14 / July / 2014, 22:59:26
What you are describing here is a simple exercise in Ohm's law where you have multiple power sources.  If the DC side of the power sources all use a common (low resistance) grounding point there is no issue.  That simply comes down to a large enough conductor and good bonding to minimize  "Electrical Length".

Attached Multi-Camera_Array_Concept [-Rats].png

Shows how to "...good bonding to minimize  "Electrical Length"..."

Edit #1

This Also, as compared to the "Rats Nest" method, minimizes  "Electrical Length"
because the cameras Grounds are in parallel rather than in series.

However the cheap power adapters are still able to generate currents spikes
because they most probably use cheap [i.e. no components] to filter these current spikes.

* The Canon Battery management system works with cheap power adapters.
* The cheap power adapters probably have much higher internal resistance.

H-H
Title: Re: Multi-camera setup project.
Post by: reyalp on 15 / July / 2014, 01:15:24
In chdkptp changeset 610 I made some changes which speed up the sync process a lot.

I removed the check phase since it basically didn't do anything. It can still be run manually using check_sync_single(mc.cams[camera number])

I also removed some unneeded delay from init_sync, and changed the statistics to include min, max and standard deviation. You can also pass in the number of iterations, like mc:init_sync(5). In general, I don't think a lot of iterations is going to be helpful, although there are occasional outliers in send time which could throw things off if you got unlucky. You do need to run at least one to establish the clock offsets.
Title: Re: Multi-camera setup project.
Post by: mphx on 15 / July / 2014, 10:18:48
In chdkptp changeset 610 I made some changes which speed up the sync process a lot.

I removed the check phase since it basically didn't do anything. It can still be run manually using check_sync_single(mc.cams[camera number])

I also removed some unneeded delay from init_sync, and changed the statistics to include min, max and standard deviation. You can also pass in the number of iterations, like mc:init_sync(5). In general, I don't think a lot of iterations is going to be helpful, although there are occasional outliers in send time which could throw things off if you got unlucky. You do need to run at least one to establish the clock offsets.

Do i grab multicam.lua from https://www.assembla.com/code/chdkptp/subversion/nodes/610/trunk/lua (https://www.assembla.com/code/chdkptp/subversion/nodes/610/trunk/lua)
or do i wait for some new windows binary at some point? :)
NOTE: I see util.lua has same description with multicam.lua , is it needed too?


Sync-less shooting was done simply by issuing

1.connect/start
2.preshoot + shoot
(multicam commands)

Result was pretty synced ...we are talking about 8 cameras , 20-30cm usb cables , 2x 4port powered usb hubs.
I dont know if the result would be synced in larger scale ...

EDIT :

Did some syncing with the new multicam.lua.Check screenshot..i think something isn't working right.

Did twice , once init_sync(5) , once init_sync(). Same end result (minimum sync delay 0) and same warnings.

https://www.dropbox.com/s/t9j2yfyzaq2kawj/newsync.JPG (https://www.dropbox.com/s/t9j2yfyzaq2kawj/newsync.JPG)

EDIT no2 :

All ok now.Util.lua was needed after all :)
Did some tests.. sync takes 3secs for 8cameras..big improvement..Result is all images perfectly synced.Atleast with my lame sync testing.
Title: Re: Multi-camera setup project.
Post by: reyalp on 15 / July / 2014, 22:34:29
Do i grab multicam.lua from https://www.assembla.com/code/chdkptp/subversion/nodes/610/trunk/lua (https://www.assembla.com/code/chdkptp/subversion/nodes/610/trunk/lua)
or do i wait for some new windows binary at some point? :)
You should make sure all the lua files you use are from the same version. You can get a zip of all the files using the download button on the link you quoted.

Alternately, you can use svn and check out http://subversion.assembla.com/svn/chdkptp/trunk/lua/ (http://subversion.assembla.com/svn/chdkptp/trunk/lua/)

This also makes it easy to switch back to an older version, and to deal with any local modifications. If you are using windows, tortoisesvn is a good svn client.
Title: Re: Multi-camera setup project.
Post by: mphx on 16 / July / 2014, 04:48:45

You should make sure all the lua files you use are from the same version. You can get a zip of all the files using the download button on the link you quoted.

Alternately, you can use svn and check out http://subversion.assembla.com/svn/chdkptp/trunk/lua/ (http://subversion.assembla.com/svn/chdkptp/trunk/lua/)

This also makes it easy to switch back to an older version, and to deal with any local modifications. If you are using windows, tortoisesvn is a good svn client.

Ok , i hope i wont mess anything up. I downloaded tortoisesvn , right click on my lua folder , svn checkout , put remote url on the box , clicked ok , updated my files to revision 610 (didn't touch my custom lua files , and everything working ok as i can tell).
Now i have 2 different choices when i right click the folder. SVN update , SVN commit.
I think i MUST NOT , touch the second one right ? :)

I will "play" with "SVN update" when i know/think that some new versions are upoloaded by you , am i right?

Just asking in order not to mess anything up .
Title: Re: Multi-camera setup project.
Post by: waterwingz on 16 / July / 2014, 07:48:00
Now i have 2 different choices when i right click the folder. SVN update , SVN commit.
I think i MUST NOT , touch the second one right ? :)
Unless you have commit access to the repository, it won't make any difference what you do with the "second one".
Title: Re: Multi-camera setup project.
Post by: mphx on 16 / July / 2014, 09:06:37
Unless you have commit access to the repository, it won't make any difference what you do with the "second one".

Yes , it makes sense.Otherwise it would be a chaos in the repository :)
Title: Re: Multi-camera setup project.
Post by: mphx on 16 / July / 2014, 12:52:40
Ok , next subject in the project :)

Focus and zoom setup.

I tried to play a bit with commands for setting up zoom and focus (set_aflock,set_focus,get_focus,get_zoom,set_zoom etc)

Things that i want to do.

1.Set focus on multiple cameras at once.I have made it work with one camera.Tried to connect 2 cameras and play with set_aflock and set_focus and only one camera was affected.
2.Get current focus.I mean camera gets an initial focus with set_aflock(1).Before i start issuing new focus distances , i want to see whats the current focus distance.
3.get_zoom , set_zoom didn't seem to work for me , even with one camera.Do i miss something in the syntax of the command?Do i need to do something else prior of it?

Thanks.


EDIT : Number #1 solved.
Number #3 solved (thanx to a thread of waterwingz.set_aflock() needed before any zoom related commands)
Title: Re: Multi-camera setup project.
Post by: reyalp on 17 / July / 2014, 00:07:48
1.Set focus on multiple cameras at once.I have made it work with one camera.Tried to connect 2 cameras and play with set_aflock and set_focus and only one camera was affected.
How are you trying to do this?

With multicam, you can execute arbitrary lua code on all cameras by using
!mc:cmd('call ... your lua code')
If you want to see the status (including return values of your code) you can do
!return mc:cmdwait('call ...')

Note that errors in your code will cause the camera side multicam script to exit, so you would need to use mc:start() again if that happens. You use pcall instead of call to catch errors, but it cannot be use the CHDK functions that yield, meaning things like shooting, waiting for key presses, sleep etc.

Before r611 (which I just checked in, use svn update to get it) mc:cmdwait would by default pick up messages left around by previous calls to mc:cmd.  Now both cmd and cmdwait will discard any existing messages before running their code.

If you find yourself using large amounts of code with call, you might want to create a new command. You can do this by adding to the rlib code at the bottom of multicam.lua, or do it on the fly.

e.g.
Code: [Select]
!return mc:cmdwait('call function cmds.foo() print(mc.args) end')
creates a new command names foo, where mc:cmd("foo hello world") will print hello world on the camera screen.
Quote
2.Get current focus.I mean camera gets an initial focus with set_aflock(1).Before i start issuing new focus distances , i want to see whats the current focus distance.
Do you expect to do this across all the cameras, or one camera at a time? Are you trying to return the focus distance value?

Quote
3.get_zoom , set_zoom didn't seem to work for me , even with one camera.Do i miss something in the syntax of the command?Do i need to do something else prior of it?
You must be in record mode for these to take effect, other than that there should be nothing special. Examples of the actual code you are using would be helpful.

Quote
EDIT : Number #1 solved.
Number #2 solved (thanx to a thread of waterwingz.set_aflock() needed before any zoom related commands)
You should not need af_lock before setting zoom (in fact, zooming with aflock set may cause problems), do you mean focus related commands?
Title: Re: Multi-camera setup project.
Post by: mphx on 17 / July / 2014, 04:14:59
@reyalp

1. Zoom - I had a problem with set_zoom.I am talking with one camera.Throwing values in set_zoom , while being in rec mode , and nothing .Totally nothing.Then i was fooling around in forum and found a thread of waterwingz who was trying to see why his cameras were shutting down after using a "zoom" script .At some point he threw an idea , putting a set_aflock inside his script before the actual zoom commands.And no problems with his cameras.
So an idea popped to issue a set_aflock(1) before set_zoom..and TAAA-DAAA ..lens moved!
And i created another button in the GUI , with exactly what you said.. !mc:cmd('call ... your lua code').Worked like a charm.
Same thing did with focus...Specifically i created 2 buttons with set_aflock/set_zoom/set_focus in each of them.Partner wants two states of zoom/focus..so we can cycle through them with two buttons.

Overall , zoom and focus worked for multiple cameras.Only thing remained now is ISO and shutter speed...i think i will hardcore ISO from the chdk menu in every camera and i think i found the command for shutter speed.

2. Focus

About getting the initial focus distance.No , i dont expect to do it on all cameras at once.I was thinking the process of setting up the cameras and finding what zoom/focus each one should have so they will be targetting and focusing in the center of the rig.
In few words all cameras will be targetting a specific spot.It would be rather stupid to start throwing values at focus or measuring the distance with some tool .
I was thinking since set_aflock(1) , takes an initial focus before hand over the control of focus..i can target the center of the rig and then issue the command.So it will focus there..if i can get back the distance of THAT focus , probably with get_focus , then i can put the same value of focus to all cameras , since they are gonna targetting the same spot.
I could put the value to my new buttons i created with set_aflock/zoom/focus and all cameras focus at the same spot.Minor adjustments may be needed but that would be easy to handle.


Thanks.
Title: Re: Multi-camera setup project.
Post by: waterwingz on 17 / July / 2014, 09:32:50
Then i was fooling around in forum and found a thread of waterwingz who was trying to see why his cameras were shutting down after using a "zoom" script .At some point he threw an idea , putting a set_aflock inside his script before the actual zoom commands.And no problems with his cameras.
If you are talking about this thread : set_zoom problems in uBASIC & Lua scripts (http://chdk.setepontos.com/index.php?topic=7071) then a number of improvements were found and many others tried. However, I still have at least one camera (SD940), and there are several others like it, that will not zoom reliably so good luck!
Title: Re: Multi-camera setup project.
Post by: mphx on 17 / July / 2014, 10:58:07

If you are talking about this thread : set_zoom problems in uBASIC & Lua scripts (http://chdk.setepontos.com/index.php?topic=7071) then a number of improvements were found and many others tried. However, I still have at least one camera (SD940), and there are several others like it, that will not zoom reliably so good luck!

Well zoom is secondary than focus/iso/shutter speed .I will be happy if i am done with them.Final tests with zoom will be done when we set up the cameras in the rig.
Title: Re: Multi-camera setup project.
Post by: reyalp on 17 / July / 2014, 17:13:40
So an idea popped to issue a set_aflock(1) before set_zoom..and TAAA-DAAA ..lens moved!
OK, this is strange, but as waterwingz says, some cameras have problems with zoom. In a worst case scenario, you should be able to adjust zoom by sending key presses. This is inconvenient on cameras with a large number of zoom steps though.

Note that if you engage af lock using the normal canon firmware (half press + focus mode button, usually) zooming will cancel the AF lock. How this might relate to set_aflock() is not well defined.

Quote
Overall , zoom and focus worked for multiple cameras.Only thing remained now is ISO and shutter speed...i think i will hardcore ISO from the chdk menu in every camera and i think i found the command for shutter speed.
See http://chdk.wikia.com/wiki/CHDK_Scripting_Cross_Reference_Page (http://chdk.wikia.com/wiki/CHDK_Scripting_Cross_Reference_Page)
You can also look at how testshots sets ISO and TV.

Quote
About getting the initial focus distance.No , i dont expect to do it on all cameras at once.I was thinking the process of setting up the cameras and finding what zoom/focus each one should have so they will be targetting and focusing in the center of the rig.
In few words all cameras will be targetting a specific spot.It would be rather stupid to start throwing values at focus or measuring the distance with some tool .
I was thinking since set_aflock(1) , takes an initial focus before hand over the control of focus..i can target the center of the rig and then issue the command.So it will focus there..if i can get back the distance of THAT focus , probably with get_focus , then i can put the same value of focus to all cameras , since they are gonna targetting the same spot.
I'm still not clear how you expect this procedure to actually work.

Some things to keep in mind
1) All of these cameras have a large depth of field. If you have 64 cameras in a ring with a subject in the center, then just setting the focus to about the center of the ring may well be sufficient.
2) Using different zoom will likely change the effective aperture, so different exposures may be required. The distortion in the images will also be different, which may affect your image processing.
3) If you need unique focus, zoom and exposure values for each camera, your shot set up is going to become quite tedious.

You can operate on individual cameras with multicam, although it isn't very convenient at the moment. To send a command, you can use something like:
Code: [Select]
con 1> !mc.cams[1]:write_msg("call return get_focus()")
And to get the results, you could use something like this mess
Code: [Select]
con 1> !r={} mc:get_single_status(mc.cams[1],'call',r) return r
={
 status={
  status={
   [1]=-1,
  },
  cmd="call",
 },
 done=true,
}
The values of the inner status table are the return values (-1 in this case)

The mc.cams[1] identifies the first cam in arbitrary USB order.

Clearly querying / manipulating single cams is something that should be improved, and should tied in with permanent serialnumber based camera identification. It shouldn't be terribly hard to make mc:cmd etc operate on a subset of available cameras.
Title: Re: Multi-camera setup project.
Post by: mphx on 17 / July / 2014, 19:13:22
@reyalp

First of all we assume that all cameras will have the same settings of zoom(actually no zoom at all) , focus , iso , shutter speed etc.

So if any of the above is going to be set up , its gonna be for all the cameras.So it will be probably set up through multicam.

1.About focus

The idea is that an object will be in a rather steady spot in the middle of all cameras.So every camera has to focus there.Before any shooting .
Autofocus would probably not work well , because we can't control where the small square in viewfinder will target and focus.
So the plan is to set the focus in a steady distance.How do we find how much is the distance from the center of the rig to the cameras?
a)Take a measure tool and start measuring the distance , convert it to mm and set it with set_focus.
b)I thought to get ONE camera to focus in the object spot and get the value of the distance somehow (with get_focus maybe?) and use that value to set the focus distance to EVERY camera.

Thats what i am describing :)

2.About zoom

Zoom is something that came up to my partner's mind.Thinking that maybe the "object" could be small..like a pet , or a small child..cameras should be able to zoom+focus to them .
So we were thinking to use two modes...two states of zoom+focus.. one for everyday use (probably zero zoom + custom focus set) and another one for that special case i described above (custom zoom + custom focus).
Create 2 buttons with the right values and switch between them according the case.
I don't know beforehand if that second state should be applied to all cameras or to some of them.That remains to be tested on site.
And yes it's strange , zoom to work with the "help" of set_aflock but that's a fact.Without it , set_zoom was..dead!


As far as iso and tv are concerned , since iso will be the same at all times for all cameras , i was thinking to put it in the chdk menu...to all cameras...and then "play" with tv to see what value gives the best result.

All these are theories , and remain to be tested when we will actually set up the cameras (in 1-2 weeks that is).

I will keep your example scripts in mind , in case , specific subnet of cameras should be setup with certain focus/zoom/etc values although i feel the same with what you said..it will be a bit tedious to do so.Lets hope it won't be needed.
Title: Re: Multi-camera setup project.
Post by: waterwingz on 17 / July / 2014, 19:45:44
As far as iso and tv are concerned , since iso will be the same at all times for all cameras , i was thinking to put it in the chdk menu...to all cameras...and then "play" with tv to see what value gives the best result.
Why not just set the ISO in the Canon menu for each camera?  You only ever need to do it once.
Title: Re: Multi-camera setup project.
Post by: reyalp on 17 / July / 2014, 22:59:45
a)Take a measure tool and start measuring the distance , convert it to mm and set it with set_focus.
If the object is centered, you can probably just take the radius of the ring, and always use that value. Or if your object is large compared to the ring, subtract it's radius. As I said, the cameras have large depth of field so unless the subject is quite close it doesn't have to be very precise.

That said, you could easily use the code I posted to get focus on one camera and then then set focus on all of them. If you use the GUI may even be able to check focus in the live view.

How big is the ring?
Quote
Zoom is something that came up to my partner's mind.Thinking that maybe the "object" could be small..like a pet , or a small child..cameras should be able to zoom+focus to them .
So all the cameras would have the same zoom, that makes sense.
Title: Re: Multi-camera setup project.
Post by: mphx on 18 / July / 2014, 07:38:14

Why not just set the ISO in the Canon menu for each camera?  You only ever need to do it once.


That's the plan. :)

Quote
If the object is centered, you can probably just take the radius of the ring, and always use that value. Or if your object is large compared to the ring, subtract it's radius. As I said, the cameras have large depth of field so unless the subject is quite close it doesn't have to be very precise.

That said, you could easily use the code I posted to get focus on one camera and then then set focus on all of them. If you use the GUI may even be able to check focus in the live view.

How big is the ring?

That's a good idea. Calculate the radius of the ring and use it as focus distance.Objects will be mostly humans..so their width would make little difference to the distance.
How big the ring will be ?Hmm i don't know the specifics yet...i assume around 4-5 meters in diameter at maximum.Something like that.


New cameras are being ordered Monday/Tuesday , so i will do some more tests with more cameras , to see how sync will behave :) Although i am running out of power outlets at home ...
Title: Re: Multi-camera setup project.
Post by: reyalp on 18 / July / 2014, 22:11:15
How big the ring will be ?Hmm i don't know the specifics yet...i assume around 4-5 meters in diameter at maximum.Something like that.
With a human sized subject standing ~2 meters from the cameras, I'd expect you can just set the focus to about that distance and never need to change it.
Title: Re: Multi-camera setup project.
Post by: mphx on 19 / July / 2014, 05:52:13
With a human sized subject standing ~2 meters from the cameras, I'd expect you can just set the focus to about that distance and never need to change it.

Talk to "partner" and the radius will be about 2.30 meters. So yes , what you said it will be the case.
Title: Re: Multi-camera setup project.
Post by: reyalp on 20 / July / 2014, 23:44:01
I started adding support for persistent ids based on serial number (through r619). This isn't really finished, but it may be enough to be useful. Be warned though that I may make incompatible changes as I continue to work on it.

To create the mapping:
1) connect to your cameras normally using mc:connect()
2) use mc:save_list('path/to/listfile') to save the mapping

The next time you want to connect to the same cams, use mc:connect({list='path/to/listfile'})

I also added support for working on a subset of cameras. multicam now has a list of "selected" cameras. When you connect, all cameras are selected. You can change it with mc:sel()
mc:sel('all') selects all cameras
mc:sel(number) selects a single camera by id number
mc:sel({number, number...}) selects all the specified ids.
After using mc:sel(), any function that would normally operate on all cameras (like mc:cmd() or mc:download_last) operates on the selected cameras instead.

Some other notes
* There is currently no support for old cams that do not return a serial number. This shouldn't affect you.
* The numbers listed in connect no longer correspond to the camera IDs. To see the camera IDs, you can use !mc:list_all() or !mc:list_sel()
* There is no support yet for controlling which id is associated with which serial number, they are just set by the original connect order.
Title: Re: Multi-camera setup project.
Post by: waterwingz on 20 / July / 2014, 23:50:35
* There is no support yet for controlling which id is associated with which serial number, they are just set by the original connect order.
Do you have any thoughts on how to number cameras sequentially by physical position (i.e. left to right) on the rig?

Maybe something to pop the index number in the saved list onto the camera's LCD ?

Title: Re: Multi-camera setup project.
Post by: reyalp on 21 / July / 2014, 00:34:12
Do you have any thoughts on how to number cameras sequentially by physical position (i.e. left to right) on the rig?

Maybe something to pop the index number in the saved list onto the camera's LCD ?
Yes, that plus a function to re-assign the id is the plan, just haven't got there yet.

On windows, I think if you connect (or power on) with enough delay for each one to actually be recognized by the OS, they will appear in the same order to chdkptp. I haven't tried this on linux, or tested very thoroughly on windows for that matter.

I also added some options to mc:connect I didn't discuss in the previous post. If you use mc:connect({add=true}) it leaves existing connections alone and just add new ones. So if you connect one camera, run that, connect the next etc, you would end up with sequential IDs in the order you connected them.

edit:
as of r620, mc:cmd('id') will now toggle an id display (loosely borrowed from bcam).
Title: Re: Multi-camera setup project.
Post by: mphx on 21 / July / 2014, 06:03:44
@reyalp

Very good additions and improvements... i did some testing.
First of all , just to let you know , probably you know it already , there is an error everytime mc:connect() is issued.Nothing to do with latest changes , this happens from day 1.This error doesn't affect the connect() or anything else after that , so i just ignore it..but i thought to let you know.

"ERROR: D:\Downloads\project3d\chdkptp-r599-win32\lua\gui.lua:138: attempt to index field 'apiver' (a nil value)"

Anyways , things i discovered while testing.

1.first of all , svn update didn't go smoothly :) Had 2 "conflicts" , i had to manually copy/paste the new files just to be sure.But this process , i can't use it for gui.lua , since i have added things , to make my own tab.
So every time i just believe that svn update works for this file (it always has a red "!" on it even now as we speak :P )
2.After i did svn update , two of my "buttons" in my new tab didn't work.Every other button worked and only two popped an error.All things have the exact same syntax , except the commands they run.I had to commented out those two buttons in order gui to start.Anyways i will look into this matter later.Lets hope my lua folder is not screwed up alot :)
3.New commands worked fine.I also liked the id display toggling.
4.Let's say i turn on cameras one by one , with some delay , the way i want them to be physically numbered.
And then i connect() to them and issue an mc:save_list().IDs in the file will be as i want them (physically) to be.
Is there a way to put a parameter in mc:connect() to take as an input this file and connect to cameras per id order?This way every time camera with id=1 (id=1 in the file that is) will be connected first , camera with id=2 connected second , etc etc.Regardless in what way and order will be powered on in the future.Just a thought.


EDIT : ignore the problem with buttons , nothing to do with the latest changes...found the problem :)
I used some mc:cmdwait command , and worked perfectly , then i remembered that the syntax is return mc:cmdwait blabla and correct it , and error occured... it assumes that "return" is  closing some function..nice mess...pfff

EDIT no #2 : To add something to the idea on no #4 above. If such thing is possible then someone can create groups of cameras.Lets say i will have 8 poles of 8 cameras each.I can , let's say , connect the cameras of one pole (create the file of ids of these cameras) and do some testing.Do the same thing for every pole.
Then if i want to "work" with a specific set of cameras (of specific pole) , i can just connect using the apoppriate id file.
Title: Re: Multi-camera setup project.
Post by: reyalp on 21 / July / 2014, 16:06:12
First of all , just to let you know , probably you know it already , there is an error everytime mc:connect() is issued.Nothing to do with latest changes , this happens from day 1.This error doesn't affect the connect() or anything else after that , so i just ignore it..but i thought to let you know.

"ERROR: D:\Downloads\project3d\chdkptp-r599-win32\lua\gui.lua:138: attempt to index field 'apiver' (a nil value)"
I think I fixed this in recent versions (607, 614). I can start the gui and run !mc=require'multicam';mc:connect() without any errors. But as I mentioned, I don't test much with the gui.
 
Quote
1.first of all , svn update didn't go smoothly :) Had 2 "conflicts" , i had to manually copy/paste the new files just to be sure.But this process , i can't use it for gui.lua , since i have added things , to make my own tab.
So every time i just believe that svn update works for this file (it always has a red "!" on it even now as we speak :P )
Tortoise have a pretty good interface for editing the conflicts, see http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-conflicts.html. (http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-conflicts.html.) You can reduce the chance of conflicts by putting most of your code in it's own file and just calling functions a few points.

Quote
4.Let's say i turn on cameras one by one , with some delay , the way i want them to be physically numbered.
And then i connect() to them and issue an mc:save_list().IDs in the file will be as i want them (physically) to be.
Is there a way to put a parameter in mc:connect() to take as an input this file and connect to cameras per id order?This way every time camera with id=1 (id=1 in the file that is) will be connected first , camera with id=2 connected second , etc etc.Regardless in what way and order will be powered on in the future.Just a thought.
This is what mc:connect{list=...} option does. The initial connections don't happen in order, but the ID numbers are preserved, and any operations on the cameras happen in the same order.

A detail I didn't explain the last post: if you use mc:save_list() without a path, saves in a file called mccams.txt in a directory specified by CHDKPTP_HOME or (if that isn't set) HOME

If you use list=true on connect, it uses this default file.

Quote
EDIT : ignore the problem with buttons , nothing to do with the latest changes...found the problem :)
I used some mc:cmdwait command , and worked perfectly , then i remembered that the syntax is return mc:cmdwait blabla and correct it , and error occured... it assumes that "return" is  closing some function..nice mess...pfff
When I post code here, I usually post it as I would enter in the CLI. In the CLI !return mc:cmdwait(...)
causes the return values to be displayed.
If you are calling cmdwait from code, then you are responsible for checking or displaying the return values yourself.
Quote
EDIT no #2 : To add something to the idea on no #4 above. If such thing is possible then someone can create groups of cameras.Lets say i will have 8 poles of 8 cameras each.I can , let's say , connect the cameras of one pole (create the file of ids of these cameras) and do some testing.Do the same thing for every pole.
Then if i want to "work" with a specific set of cameras (of specific pole) , i can just connect using the apoppriate id file.
If you made a list with all the cameras, you could use a text editor to create sub-lists. The format is just a lua table. Note that the table is not necessarily in any specific order, so you would need to pay attention to the IDs.

Alternatively, you could use the mc:sel() function, although you would have to list all the ids, like mc:sel{1,2,3,...}. Of course, you could easily make your own functions to do that. I might add a range option.
Title: Re: Multi-camera setup project.
Post by: mphx on 21 / July / 2014, 17:41:46
@reyalp

pff ... i didn't see the paragraph about  mc:connect{list=...} earlier in your post...my bad.

Something to think about now :)

So lets say i do an initial connection to ALL cameras.I generate the file. And then i can take this file and CUT it to pieces ..and create let's say 8 other files numbered (per id i mean) from 1 to 8 , 9 to 16 , etc etc.

And create buttons named "Pole 1" , "Pole 2" , etc etc and each one of these buttons will connect to the specified by the file cameras....am i getting this right?


And a last thing... the syntax of list=true would be something like mc:connect({list=true}) ?


PS : Can some deletion or mass download command be implemented? :)
Title: Re: Multi-camera setup project.
Post by: reyalp on 21 / July / 2014, 21:48:48
And create buttons named "Pole 1" , "Pole 2" , etc etc and each one of these buttons will connect to the specified by the file cameras....am i getting this right?
Yes.

As mentioned earlier, you could also just connect to all the cameras, and make your buttons use mc:sel() with the desired ranges of ids.

Using connect is probably better if you don't expect the other poles to be powered on. Using sel is probably better if you are working on all the cameras, but just want to temporarily do something with only one pole.

Quote
And a last thing... the syntax of list=true would be something like mc:connect({list=true}) ?
Yes. But if you have multiple files as mentioned above, you'll need to use the filename instead.

Quote
PS : Can some deletion or mass download command be implemented? :)
I plan to add both, but as always there is no particular schedule.
Title: Re: Multi-camera setup project.
Post by: mphx on 22 / July / 2014, 08:44:41
I did some more tests with connecting to cameras through the file.

Unfortunately usb naming isn't predictable.What i mean.

I powered cameras up , one by one..in order...i noticed that the last one that was powered up took id no #1 !  :blink:

I created the id file...and then i shutdown all of them.I started powering them up randomly this time.They took the same ids !! I connected them through !mc:connect({list=true}) , but it was pointless , since they had the same ids like before.so file or no file , they took the same ids again.

I disconnected usb hub from the pc and reconnected it.Now ids were reversed... last one got id=8 and first one in order took id=1 (that was what i expected when i first powered them up).
So now it was a good time to check if ids will stay the same using the file.Yep it worked.As expected.

But the thing is that the order of powering up doesn't ensure the given ids.
So it might need some copy pasting serials into the file , to achieve the wanted order....but atleast it will be done once...when the time comes...
Title: Re: Multi-camera setup project.
Post by: waterwingz on 22 / July / 2014, 09:08:19
But the thing is that the order of powering up doesn't ensure the given ids.
So it might need some copy pasting serials into the file , to achieve the wanted order....but atleast it will be done once...when the time comes...
Somehow,  this still feels to me like a better solution : http://chdk.setepontos.com/index.php?topic=11631 (http://chdk.setepontos.com/index.php?topic=11631)
Title: Re: Multi-camera setup project.
Post by: reyalp on 22 / July / 2014, 17:10:24
I powered cameras up , one by one..in order...i noticed that the last one that was powered up took id no #1 !  :blink:
I did warn you that I hadn't tested this thoroughly. It was just casual observation with 3 cameras that might have provided a shortcut to getting them in order.
Title: Re: Multi-camera setup project.
Post by: mphx on 22 / July / 2014, 17:24:17
I did warn you that I hadn't tested this thoroughly. It was just casual observation with 3 cameras that might have provided a shortcut to getting them in order.

Not a big problem...power up the cameras..check what id each one is taking and then just start editing the file with ids to the desired physical order... :)
Title: Re: Multi-camera setup project.
Post by: mphx on 24 / July / 2014, 05:57:35
UPDATE on the project :)

Studio is being getting ready , dummy batteries ordered , tripods bought and guess what... market ran out of cameras !!! pfff :)

We are like 36 cameras short..and i am trying to find the rest from ebay or any place...If we can't find the remaining cameras , we will have to switch to another model ... pathetic country...pathetic market...
Title: Re: Multi-camera setup project.
Post by: reyalp on 24 / July / 2014, 17:46:41
Not a big problem...power up the cameras..check what id each one is taking and then just start editing the file with ids to the desired physical order... :)
In changes through r624, I added a function set_id(old_id,new_id). If the script is running, the IDs on the camera will be updated immediately so you can see it on the ID display.

Once you are satisfied with the ID order, you can save the list.

If the new id is already in use they will be swapped. You can pass an optional third parameter 'error' to generate an error in this case instead.

Additionally, you can now select a range of cameras with mc:sel{min=number, max=number}

save_list works on the selected cameras, so this should make it easy to make subset lists.

I also fixed some bugs, see the svn log for details.
Title: Re: Multi-camera setup project.
Post by: mphx on 24 / July / 2014, 18:41:49
@reyalp

nice addition...will come in handy.
Title: Re: Multi-camera setup project.
Post by: reyalp on 24 / July / 2014, 23:14:09
I've added support for downloading and deleting images. I haven't tested this very thoroughly, so bugs are likely.

Dowloading is done with mc:download_images(), which takes an table of options.

Specifying the destination:
The destination is specified with the dst option. You can use substitution variables, specified like ${foo} to control the path for each iamge.
The default is
dst='${id}/${subdir}/${name}'
which means: The ID number of the camera, the DCIM subdirectory (e.g 100CANON) and the camera filename (e.g IMG_0123.JPG)

Available substitutions are
${id,strfmt} camera ID, default format %02d
${serial,strfmt} camera ID, default format %s
${ldate,datefmt} PC clock date when download was started, os.date format, default %Y%m%d_%H%M%S
${lts,strfmt} PC clock date as unix timestamp + microseconds when download was started, default format %f
${mdate,datefmt} Camera file modified date, converted to PC time, os.date format, default %Y%m%d_%H%M%S
${mts,strfmt}  Camera file modified date, as unix timestamp converted to PC time, default format %d
${name} Image full name, like IMG_1234.JPG
${basename} Image name without extension, like IMG_1234
${ext} Image extension, like .JPG
${subdir} Image DCIM subdirectory, like 100CANON or 100___01 or 100_0101
${imgnum} Image number, like 1234
${dirnum} Image directory number, like 101
${dirmonth} Image DCIM subdirectory month, like 01, date folder naming cameras only
${dirday} Image DCIM subdirectory day, like 01, date folder naming cameras only

the format arguments are all optional

General options:
pretend=bool -- doesn't actually download or delete, just print
delete=bool -- delete files after downloading. Use with caution
overwrite=bool -- overwrite existing files with the same name
verbose=bool -- print what it's doing. Implied with pretend

File options:
By default, it will download files matching the normal image name pattern (ccc_nnnn.ext) from all subdirectories of DCIM. You can pass start_dirs={'A/DCIM/101CANON'...} if you want, but unless your camera numbering is exactly in sync, this won't be very useful.

You can use fmatch to match certain files. For example fmatch='%.DNG$' will only download DNG files. The default fmatch is '%a%a%a_%d%d%d%d%.%w%w%w'

Other find_files options are also available, but may or may not make sense.

examples:
list all the image files on all the cameras, without actually downloading
!mc:download_images({pretend=true})

download DNG files to test/<camera name>, overwriting, delete when done
!mc:download_images({verbose=true,delete=true,overwrite=true,dst="test/${name}",fmatch='DNG$'})

You can also use mc:imglist() to get a list of images in lua. This returns table indexed by ID. Each ID points to an array of file information, which includes the path and stat information.

Note that IDs are not necessarily contiguous, so you shouldn't use ipairs to iterate over the outer table. The inner table is a proper array.
Title: Re: Multi-camera setup project.
Post by: mphx on 25 / July / 2014, 06:18:59
@reyalp

Nice stuff !!

But let me see if i get some things right....

Command is , mc:download_images() right ? i mean it can be run as it is ? and it takes the default values for dst?

Something else , in the example you provide  "!mc:download_images({verbose=true,delete=true,overwrite=true,dst="test/${name}",fmatch='DNG$'})"

if someone wanted dst with default parameters..he should simply exclude it at all from the command?

something like this ?

!mc:download_images({verbose=true,delete=true,overwrite=true})


And one last thing ...i understand that delete function is somehow connected (as a parameter) to the downloading ALL files process.So i guess deletion cannot be combined with other commands ...? let's say download_last?
Of course its a bit redundant , since downloading all images include LAST images...but just asking :)

Also , is it possible delete function to be used alone somehow?Picture this.
Lets say i shoot 5-6 times a client , and the last shot is the good one...so i only want the last images and i use download_last to get them.
I don't care for the rest of the images , so since i downloaded the last ones , i want to delete all images to start a possible new shooting process...

Thanks for your work man , and will do some testing when i get home later this afternoon...
Title: Re: Multi-camera setup project.
Post by: reyalp on 25 / July / 2014, 14:55:58
Command is , mc:download_images() right ? i mean it can be run as it is ? and it takes the default values for dst?

Something else , in the example you provide  "!mc:download_images({verbose=true,delete=true,overwrite=true,dst="test/${name}",fmatch='DNG$'})"

if someone wanted dst with default parameters..he should simply exclude it at all from the command?
Yes, most complicated functions in chdkptp take a table of options, and anything not specified uses the default.

Quote
And one last thing ...i understand that delete function is somehow connected (as a parameter) to the downloading ALL files process.So i guess deletion cannot be combined with other commands ...? let's say download_last?
There is a function mc:delete_images_list() which you could call directly. It expects a list in the same format produced by mc:imglist(), so you can use that to generate a list without downloading. imglist takes the same file selection options as download_images.

Note that mc:download_images() does not have affect all files, it has various options to control which are selected. But there is not currently an easy way to just get the "last" image, or the last N images.

download_last is kind currently it's own thing, it uses a completely different method. It was really just something I threw together as an example. I'll look into making "last" an option for download_images and imglist.

This is all still a work in progress.
Title: Re: Multi-camera setup project.
Post by: mphx on 25 / July / 2014, 16:09:52
@reyalp

ok i missed something... i dont get how imglist() and delete_images_list() work.I mean what they take as a parameter.

And a last thing.. what do you mean "mc:download_images() does not affect all files" ?

Doesn't download EVERYTHING? i did 3-4 tests , did 3-4 shoots and used download_images().Found and downloaded correctly all images...with default parameters of course.
I believe that "download LAST image" and "download ALL images" kinda covers everything .At least for my kind of project.

Anyways putting "last" as an option is a good idea...to make everything run from the same command..although download_lasdt() works as expected as it is.
Title: Re: Multi-camera setup project.
Post by: reyalp on 25 / July / 2014, 17:16:17
@reyalp

ok i missed something... i dont get how imglist() and delete_images_list() work.I mean what they take as a parameter.
imglist takes a table of options, which are passed to rlibs.lua find_files. This is the same thing used for chdkptp's mdownload command. It returns a Lua table, which I described earlier.

That table could be passed directly to delete_images_list()
Quote
And a last thing.. what do you mean "mc:download_images() does not affect all files" ?

Doesn't download EVERYTHING? i did 3-4 tests , did 3-4 shoots and used download_images().Found and downloaded correctly all images...with default parameters of course.
Right, the default is everything, but what I meant is you can modify the criteria used by find_files. If you just wanted to match image numbers 1-3, you could use fmatch='_000[1-3]%.JPG' or something like that. But for multicam this is not useful unless you can keep the image counters exactly in sync.

I'm working on some improvements to this now. As I've said before, the stuff in svn is very much work in progress.
Title: Re: Multi-camera setup project.
Post by: reyalp on 25 / July / 2014, 18:00:05
In rev 634, I added an option called lastimg to imglist (also passed through by download_images). It takes a number specifying how many images to return, starting with the current image counter.

So
!return mc:imglist{lastimg=1}
will show a list of the most recent images on each camera.
!return mc:imglist{lastimg=5}
will show the 5 most recent images.

Note that this does NOT handle folder changes or image counter wrap. If the requested range goes below 1, it will just start at 1, and it will only look in the current image folder.

It can be combined with the standard options, except start_paths, which it sets to the current image folder. So !mc:download_images({lastimg=2,fmatch='DNG$'}) would download the last 2 DNG images.

The start_dirs option was renamed to start_paths.

You can also pass imgnum_min and imgnum_max directly, but again this is unlikely to be useful with multiple cams.
Title: Re: Multi-camera setup project.
Post by: mphx on 25 / July / 2014, 18:48:11
@reyalp

ok , i am really confused about imglist() and delete_images_list()

imglist , produces a list that to be honest isn't practically helpful.So maybe i am missing its true purpose.
It suppose to be combined with some other command?

Give me an example of delete_images_list() because i am missing the point here...

Nice additions you made btw , although i don't think  i will have any use of them...

As i see it (although practical application will tell better) , last image (last ONE) and ALL images would be the most used and needed to be handled.
As i said noone knows what will be needed in the process of the project..so as i said..nice additions :)
Title: Re: Multi-camera setup project.
Post by: reyalp on 25 / July / 2014, 19:34:09
@reyalp

ok , i am really confused about imglist() and delete_images_list()

imglist , produces a list that to be honest isn't practically helpful.So maybe i am missing its true purpose.
It suppose to be combined with some other command?
imglist() returns a list of files. You can pass that  list to delete_images_list.
e.g
Code: [Select]
!mc:delete_images_list(mc:imglist(),{pretend=true,verbose=true})
or equivalently
Code: [Select]
!mylist=mc:imglist()
!mc:delete_images_list(mylist,{pretend=true,verbose=true})

(remove pretend to actually delete)
Quote
As i see it (although practical application will tell better) , last image (last ONE) and ALL images would be the most used and needed to be handled.
If you do lastimg=1, it gets you the last image, and it does it consistently with getting all.

I'm not writing this for you, I'm trying to make something that is generally useful for people working with multiple cameras.
Title: Re: Multi-camera setup project.
Post by: mphx on 25 / July / 2014, 19:49:06
@reyalp

HA , i knew it that imglist and delete_images_list were to combine :)

I know that you are not writing this for me..just i am picturing what will be handy from all these commands and additions.
Of course you made stuff thinking the general picture..

Going to play a bit with delete_images_list now :)
Title: Re: Multi-camera setup project.
Post by: mphx on 29 / July / 2014, 17:35:02
Small update on the project :)

Cameras ordered and shipped and waiting for them.Same with dummy batteries.Poles bought.Mini-balls for attaching cameras to the poles bought.Studio will be done in one-two days.Cables and hubs and power outlets will be bought this week.

I hope everything will be up and running next week and of course when things will be delivered.

As far as chdkptp is concerned i believe i have set it up to my liking ...made the buttons in the gui and tested them.I am trying to see what else will be needed...

Photos will be posted as soon as studio and things are ready and set up :)
Title: Re: Multi-camera setup project.
Post by: ecwarrior13 on 30 / July / 2014, 12:20:24
First I want to say this has been a great post to follow.  Thanks for sharing all your learnings. 

I've been working to configure something very similar as mphx -  I have a few questions and hopefully, since this is my first time, I'm asking the right way.

First here is my set up -
8 Cameras - all set to the same focal point/focus range, same ISO, Same shutter speed (there may be others I'm not aware since I don't do the photo details)
I have them in the Remote Parameters set up - enable remote, one push, Normal control, synch enabled, synch delay

My ideal wish list to perform:
I want to take three photo shoots - verify that each camera took and recorded a picture and move to next photo shoot (2)...photo shoot(3) -  if a camera didn't record a picture - erase all pictures on the other cameras and redo that shoot.  At the end of photo shoot (3) - disable the remote parameters.

Is that possible?

If not then take X number of photo shoots and then disable the remote parameters.

One last thing - is there something where I can make sure all my cameras are set up with the same configuration - iso,shutter speed...etc...and just get an "All cameras setup the same" type message?

Thanks everyone!
Title: Re: Multi-camera setup project.
Post by: reyalp on 30 / July / 2014, 17:32:16
I have them in the Remote Parameters set up - enable remote, one push, Normal control, synch enabled, synch delay
Note this is for the DIY electronic remote (http://chdk.wikia.com/wiki/USB_Shutter_Remote (http://chdk.wikia.com/wiki/USB_Shutter_Remote)). mphx is attempting to use only software PTP control (http://chdk.wikia.com/wiki/PTP_Extension (http://chdk.wikia.com/wiki/PTP_Extension)) so your setup is quite different.

It is possible to combine the two so you can use PTP for settings and file transfer but trigger using the electronic, but this currently requires a modified version of CHDK or using the battery temp signal for sync. Waterwinz page http://chdk.wikia.com/wiki/User_blog:Waterwingz/Multicam_Rigs (http://chdk.wikia.com/wiki/User_blog:Waterwingz/Multicam_Rigs) should have the links to the threads where this is discussed.

Quote
My ideal wish list to perform:
I want to take three photo shoots - verify that each camera took and recorded a picture and move to next photo shoot (2)...photo shoot(3) -  if a camera didn't record a picture - erase all pictures on the other cameras and redo that shoot.  At the end of photo shoot (3) - disable the remote parameters.
There is certainly no existing system which will do this for you. It should be possible to build with enough effort.

"verify that each camera took and recorded a picture"  probably requires PTP, unless you want to walk around to each camera and look at the screen. Same for erasing.


Quote
If not then take X number of photo shoots and then disable the remote parameters.
If you are using the USB remote, then some electronic control will have to be responsible for doing the X number of shots.

Quote
One last thing - is there something where I can make sure all my cameras are set up with the same configuration - iso,shutter speed...etc...and just get an "All cameras setup the same" type message?
It would probably be simplest to just set the parameters before each shot. You are going to need scripting anyway.

You should be aware that this is a fairly complicated project which will require programming and electronics DIY.
Title: Re: Multi-camera setup project.
Post by: mphx on 30 / July / 2014, 19:32:29
@ecwarrior13

You have only 8 cameras , just do it only using software PTP control like me.

Multicam supplies all the commands to do what you need to do .. connect to all cams , sync them , shoot , download photos (last or all) and delete them.

How to check if all cameras took the shot? Two ways i can think of.

1.download command of multicam creates numbered folders to put the images.Optical checking of any missing number will tell you if some camera didn't shoot. Or it creates an empty folder if no image is found?Don't know ! reyalp?

2.Use the custom let's say multicam script of waterwingz , which displays ID and number of SHOT taken on the lcd of the camera.So if after first shooting you see that all cameras are in SHOOT NO 1 and one of them in SHOOT NO ZERO , then this camera didn't shoot.

As far as setting the same parameters on all cameras , i think its rather easy with chdkptp and some lua scripting. iso can be set directly in chdk menu in the cameras...at least that.
Title: Re: Multi-camera setup project.
Post by: ecwarrior13 on 30 / July / 2014, 23:31:47
Thanks reyalp and mphx -  I will use the chdkptp - after reviewing this topic again that will provide what I need.   

My biggest issue - If I'm taking a few shots in a row a random camera will miss a shot. So I will have a series of photos with a ransom camera missing 1 and another missing 1....just trying to figure out how to handle that.

Title: Re: Multi-camera setup project.
Post by: reyalp on 31 / July / 2014, 00:35:47
Thanks reyalp and mphx -  I will use the chdkptp - after reviewing this topic again that will provide what I need.   
Note that chdkptp will not give you the same level of sync available with USB remote. If you want to capture moving objects, then it probably won't be good enough.
Quote
My biggest issue - If I'm taking a few shots in a row a random camera will miss a shot.
The best solution to this would be to figure out why they are missing shots and fix it. With some additional information like
1) what cameras you are using
2) what commands you are using to shoot
3) what canon settings you are using on the camera
we may be able to help.

A couple items off the top of my head.
1) If the camera is in auto mode (probably also some scene modes) it may simply refuse to shoot if it can't find focus. Manual or P modes generally shoot even if they can't focus.
2) There are some issues related to the flash which can make chdk get_shooting() not work right. I expect using the camera flashes would be problematic multicam anyway so turning them off in the canon firmware might be a good idea.

If you are using multicam, it will probably time out somewhere, which will be returned in the status if you use cmdwait. If you look at the mc:testshots function in multicam.lua, it returns the exposure count before and after the shot. You could do something similar to check if a shot has been taken.
Title: Re: Multi-camera setup project.
Post by: mphx on 04 / August / 2014, 13:03:35
Small update on the project :)

New arrivals today.. 18 cameras arrived and i expect another 18 tomorrow.So with the tomorrrow's arrival we are done. 8 initial cameras i had...  2x 18-cameras packages + 20 cameras at my "partner's" house ... a total of 64 cameras. So if everything go well we are starting setting up the "rig" this week.

https://www.dropbox.com/s/63jxynjoot67cof/20140804_195622.jpg (https://www.dropbox.com/s/63jxynjoot67cof/20140804_195622.jpg)

https://www.dropbox.com/s/nsstw6zb4n60tai/20140804_200509.jpg (https://www.dropbox.com/s/nsstw6zb4n60tai/20140804_200509.jpg)
Title: Re: Multi-camera setup project.
Post by: mphx on 09 / August / 2014, 10:00:50
UPDATE :

all cameras present :) Most of the dummy batteries arrived. Studio almost done.. we set up tripods yesterday .Forgot to take pics :(

Now i have to install chdk into 64 sd cards !!

We will start mounting cameras by the end of the month...
Title: Re: Multi-camera setup project.
Post by: waterwingz on 09 / August / 2014, 11:19:24
Now i have to install chdk into 64 sd cards !!
Refresh my memory?  How are you planning to trigger all these cameras?  ( i.e. will you be needing precision sync and if so, via battery terminal or USB 5V?)
Title: Re: Multi-camera setup project.
Post by: mphx on 09 / August / 2014, 14:59:20
@waterwingz

Through chdkptp and multicam commands.Project doesn't need that much of accuracy in syncing since the "objects" will be relatively still and the plan is to use fast shutter speed.

Small movements during shooting will be handled through after-shoot processing....

All that in theory...we will be doing tests when we will mount the cameras and see how good sync will be with 64 cameras and secondary parameters (exposure , shutter speed , iso , etc)
Title: Re: Multi-camera setup project.
Post by: reyalp on 09 / August / 2014, 16:08:54
Now i have to install chdk into 64 sd cards !!
Your mileage may vary, but I would approach this by setting up one card, making a disk image, and then writing that to the remaining cards. On linux (or using a live CD) this can be done easily with dd. I'm sure there's some windows software that will do it too.

After the cards are bootable, you can update by uploading files through chdkptp.
Title: Re: Multi-camera setup project.
Post by: mphx on 09 / August / 2014, 16:52:02

After the cards are bootable, you can update by uploading files through chdkptp.

What do you mean by this ? That you can update chdk , by uploading some "files" of chdk through chdkptp ?
And it can be done for multiple cameras lets say? :)
Title: Re: Multi-camera setup project.
Post by: waterwingz on 09 / August / 2014, 17:00:44

After the cards are bootable, you can update by uploading files through chdkptp.

What do you mean by this ? That you can update chdk , by uploading some "files" of chdk through chdkptp ?
And it can be done for multiple cameras lets say? :)
Other than the first time I setup an SD card for CHDK,  it almost never comes out of the camera again.  Script and CHDK core code get downloaded as updates appear or I make changes while working on code. Downloading to multiple cameras would be a simple extension for multicam.lua (assume it does not already do that?)

Title: Re: Multi-camera setup project.
Post by: reyalp on 09 / August / 2014, 17:45:26
What do you mean by this ? That you can update chdk , by uploading some "files" of chdk through chdkptp ?
Yes, chdkptp can upload files. See the upload and mupload commands.
Quote
And it can be done for multiple cameras lets say? :)
There isn't currently code in multicam.lua to do this, but it could be done similarly to how the old download_last command was implemented.

Uploading a set of files to all cameras is a worthwhile addition to multicam, so I will try to add that at some point. As usual, no particular schedule.
Title: Re: Multi-camera setup project.
Post by: mphx on 09 / August / 2014, 17:46:56
Other than the first time I setup an SD card for CHDK,  it almost never comes out of the camera again.  Script and CHDK core code get downloaded as updates appear or I make changes while working on code. Downloading to multiple cameras would be a simple extension for multicam.lua (assume it does not already do that?)

ok , with scripts i get it. Just copy the scripts to their folder.CHDK core code? How is this done?just copy the new file(s) to the card and reboot the camera? copy diskboot.bin or are more files involved to the "update"?
Title: Re: Multi-camera setup project.
Post by: reyalp on 09 / August / 2014, 17:57:45
copy diskboot.bin or are more files involved to the "update"?
For an updated build, you should copy the files in the "small" download package on the autobuild site. This is DISKBOOT.BIN, PS.FI2 and the stuff in CHDK/MODULES

PS.FI2 is only used for manual loading with firm update, but it can be useful to have on the card.

For an initial install, you need everything in the large download. This includes some script libraries and other files.

If you need specific CHDK settings, you could also copy the .cfg files between cameras. This should be totally fine if they are all the same model. If you copy between different models, some settings will be reset. Alternately, you could use set_config_value with multicam.
Title: Re: Multi-camera setup project.
Post by: mphx on 09 / August / 2014, 18:54:09

For an updated build, you should copy the files in the "small" download package on the autobuild site. This is DISKBOOT.BIN, PS.FI2 and the stuff in CHDK/MODULES

PS.FI2 is only used for manual loading with firm update, but it can be useful to have on the card.

For an initial install, you need everything in the large download. This includes some script libraries and other files.

If you need specific CHDK settings, you could also copy the .cfg files between cameras. This should be totally fine if they are all the same model. If you copy between different models, some settings will be reset. Alternately, you could use set_config_value with multicam.

ok , simple enough. thanks for the info.

So for updating ALL the cameras at once we need some multi-upload function to multicam (no schedule i know.. :) ) and i assume overwriting existing files is by default on ? because i don't see any references on the upload/mupload help description.
How overwriting is handled?
Title: Re: Multi-camera setup project.
Post by: reyalp on 09 / August / 2014, 19:10:14
How overwriting is handled?
The current upload functions overwrite existing files without any prompt or notification.
Title: Re: Multi-camera setup project.
Post by: elizabeth.m on 10 / August / 2014, 12:58:10
@reyalp

1. Zoom -
So an idea popped to issue a set_aflock(1) before set_zoom..and TAAA-DAAA ..lens moved!
And i created another button in the GUI , with exactly what you said.. !mc:cmd('call ... your lua code').Worked like a charm.

I've been following this thread but I can't understand this...
can you tell me what you did step by step for this zoom command, I really dont understand how to zoom all cameras with chdkptp multicam
Title: Re: Multi-camera setup project.
Post by: mphx on 10 / August / 2014, 15:06:40
I've been following this thread but I can't understand this...
can you tell me what you did step by step for this zoom command, I really dont understand how to zoom all cameras with chdkptp multicam

Sure ...

1. connect to ALL cameras through multicam commands .  i use GUI , so when i test something i throw commands to the console.
2.issue
Code: [Select]
!mc:cmdwait('call set_aflock(1)')to the console.

3. same as 2 issue

Code: [Select]
!mc:cmdwait('call set_zoom(12)')
12 , is a random number , you can test any number you like and see what's the supported range for your camera.

For me without the set_aflock command , zoom command didn't work.Strange but true.

Also if you like to play with focus the command is

Code: [Select]
!mc:cmd('call set_focus(10)')
again , you can try any number...number is distance in mm.
Don't forget in order for focus to work you have to set up "manual focus -> ON" in chdk menu (alt..wait for few secs..and in the popup menu ..press UP ..wait for few secs again and check that manual focus went ON...alt again to close the menu and save the change and reboot and check again that the setting is saved).

If you close / reboot the camera or go to preview mode and back to rec mode .. settings of focus/zoom are lost and you have to issue again the above commands.
Title: Re: Multi-camera setup project.
Post by: reyalp on 10 / August / 2014, 15:10:42
can you tell me what you did step by step for this zoom command, I really dont understand how to zoom all cameras with chdkptp multicam
Something like
Code: [Select]
!mc:cmdwait('call set_zoom(2)')
Where 2 is the zoom step you want to zoom to.

The set_aflock thing is some quirk of the particular camera model mphx is using, so it may not be relevant to you.

If set_zoom doesn't work, you can also use key clicks instead, like
Code: [Select]
!mc:cmdwait('call click("zoom_out")')
but this will be slow if your camera has lots of zoom steps.

In it's current state, using multicam requires a certain amount of programming. I'd suggest familiarizing yourself with the CHDK scripting documentation:
http://chdk.wikia.com/wiki/CHDK_Scripting_Cross_Reference_Page (http://chdk.wikia.com/wiki/CHDK_Scripting_Cross_Reference_Page)
and the Lua documentation:
http://www.lua.org/manual/5.1/ (http://www.lua.org/manual/5.1/)

The 'call' command listed above sends lua code to the camera to execute, so you can call just about anything from the scripting cross reference.

The stuff after ! is lua code executed in chdkptp, on your PC rather than on the camera.

edit:
Note that normally the camera will re-focus after zoom changes. The set_focus in mphx example is required because of the use of af lock.
Title: Re: Multi-camera setup project.
Post by: mphx on 11 / August / 2014, 16:24:47
I started installing sd cards to cameras tonight , setting some parameters at the same time.At around camera no26 :) i remembered that i didn't set flash OFF to every camera.
So i started again and i noticed that some cameras had lost the date/time setting.It's no big deal since i don't care if photos taken will be time-stamped or not but it's strange.
Also i noticed that cameras that had already flash OFF had kept the time/date setting and the ones that had lost the setting were ALWAYS the ones that had not the flash OFF setting.
Maybe they are irrelevant maybe not..Just saying :)
Title: Re: Multi-camera setup project.
Post by: elizabeth.m on 11 / August / 2014, 23:33:22
YEs!! I did it.
trying to go to the next step
many many thanks to you @mphx, @reyalp
Title: Re: Multi-camera setup project.
Post by: mphx on 12 / August / 2014, 06:07:42
YEs!! I did it.
trying to go to the next step
many many thanks to you @mphx, @reyalp

Nice to hear :) What's the next step ?
Title: Re: Multi-camera setup project.
Post by: mphx on 20 / August / 2014, 01:29:21
UPDATE on the project :)

We set up tripods  cameras and cable stuff yesterday...too much boring work if you ask me if you have to do everything x64 times ...

Today , we will setup 1-2 laptops and connect all cameras and start doing some real-environment testing in order to see how to setup cameras (direction,shutter speed,etc etc).

some pictures of the studio...

https://www.dropbox.com/s/jasds7gtateg8si/20140819_095944.jpg (https://www.dropbox.com/s/jasds7gtateg8si/20140819_095944.jpg)  -- tripods and camera mounts.


https://www.dropbox.com/s/g7aeokcvi6c82gd/20140819_130214.jpg (https://www.dropbox.com/s/g7aeokcvi6c82gd/20140819_130214.jpg) -- after we mounted cameras and dummy batteries

Later we connected hubs and usb cables... in the base of every tripod now its a little chaos of cables :) We will sort them in "beautiful" piles in later time :)
Title: Re: Multi-camera setup project.
Post by: mphx on 21 / August / 2014, 17:04:27
Next update on the project.

We did some tests but we came across some problems with usb hubs.Well , we think its the hubs.Some of them apparently are not up to the task and we ordered another brand/model .Till they come problems remain.

And by problem i mean not all cameras are recognized at the pc.Maximum we were able to "see" were 40 cameras.That's 5 tripods out of 8.These 5 tripods have the same brand/model of usb hubs and the rest three another one.So we believe that maybe its a matter of hubs.
These three tripods are working if they are connected alone..but when we hook up all tripods ...these 3 tripods dont "appear" at the computer.
We will replace the hubs and see what will happen.

To the practical part now :)

We did some test shootings with the 40 cameras that were working....No flash involved.The noise on the pictures taken was...too much.Then we used more intense light and the noise reduced in acceptable levels.

We did a rough/fast 3d modelling processing to some test shots..and the result was very good...a 3d miniature could be created out of this.So the main purpose of this project seems to be working....creating 3d miniatures.

All that is left now is to make all cameras work..and good to go.

Syncing was very good with 40 cameras...considering that "object" is rather still as i have mentioned before... rapid movements produced foggy "parts" in the picture...but that would not be the case in real situations...
Title: Re: Multi-camera setup project.
Post by: Microfunguy on 21 / August / 2014, 17:47:51
.
Syncing was very good

Nice to know.

 
Quote
"object" is rather still .

So, how do you know the syncing is 'very good'  ?  :)
Title: Re: Multi-camera setup project.
Post by: mphx on 21 / August / 2014, 18:15:20

So, how do you know the syncing is 'very good'  ?  :)

as i have mentioned before ...the whole project is about taking shots people...and creating a 3d miniature out of it.
The whole process doesn't involve movement...of course we wont tell the people FREEZEEEE...we want them to act naturally the time of the shot..but of course not to move alot.
It's like when we get a photograph...u don't run around but u don't play "statue" either...

Considering all these things...test photos were rather synced...i mean all cameras shot almost at the same time.In other words , photos were OK for processing.

In some test shots i was moving my hand...the hand was foggy in the result photos...probably not a good thing...but as i said..the purpose of the project is not to take photos of "moving" objects....

Minor movement will exist of course but this will be handled later at 3d processing.Surely there won't be a hand up in one photo and a hand down in another..we are not talking about that large of movements..
Maybe a very small hand swinging...a minor cloth movement...a bit of a head shake...small movements...
We can handle these things :)

As a conclusion , syncing for the project requirements was "very good" :)
Title: Re: Multi-camera setup project.
Post by: Microfunguy on 22 / August / 2014, 05:23:40
.
As a conclusion , syncing for the project requirements was "very good" :)

and if nothing moved at all, sync would be excellent.

In fact, you could just walk around the subject with a single camera and take as long as you like  :)
Title: Re: Multi-camera setup project.
Post by: mphx on 22 / August / 2014, 14:56:58


and if nothing moved at all, sync would be excellent.

In fact, you could just walk around the subject with a single camera and take as long as you like  :)

true :) we have done it ....but that's not the point...

Many problems with the cameras...they do not operate as supposed.Probably something to do with cables and hubs.We are trying all possible ways....

We have 8 tripods...7 of them working as intended ALONE...if we hook them up all together...problems. the 8th tripod doesn't work at all...we have to change hub there to be sure.

As i see it , hubs generally suck. In one situation one tripod (8 cameras) had strange behavior...and when we change ports in the hub...all were working fine...go figure.....
Another situation , behavior was strange with 8 cameras..but fine with 6 or 7....

So i start to believe that hubs ( 10 port) don't behave well if you fill them up with devices...they are made with the belief that not all ports will be used at the same time...

Anyways , we continue our tests and try every possible solution until everything work fine :)
Title: Re: Multi-camera setup project.
Post by: Microfunguy on 22 / August / 2014, 15:51:45
Although probably of little interest for your application, I will mention an alternative method of working.
I like simple methods, even at the 'cost' of mild inconvenience compared with 'sophisticated' solutions.
My rig consists of three tripods each with eight A620 cameras.
Each tripod has a connector for the +6V power and the USB trigger signal.
The battery voltage is fed directly to each group of eight cameras, no voltage converters are used.
The USB cable is thin two-core, not a proper USB cable.
I have tested the first group, it works perfectly as you would expect with such a straightforward configuration.

When all shooting is completed you can swivel each camera and either remove the SD card or insert a normal USB cable.
Using USB or card reader, the images are automatically downloaded to numbered folders and after the last camera is downloaded an external application is automatically launched.

That is sufficient for my requirements and possibly for some others.

Keep it simple .........


David
Title: Re: Multi-camera setup project.
Post by: waterwingz on 22 / August / 2014, 23:27:34
When all shooting is completed you can swivel each camera and either remove the SD card or insert a normal USB cable.
For 24 cameras ?  Really? Every time you want to transfer images?

Quote
Keep it simple .........
If your cameras don't support simultaneous PTP and USB remote precision sync then I guess that's your only choice.
Title: Re: Multi-camera setup project.
Post by: Microfunguy on 23 / August / 2014, 06:29:15
For 24 cameras ?  Really? Every time you want to transfer images?

Not a problem, takes very little time, you have to wait for the batch of images to download anyway.
Images renamed and routed to individual folders automatically so that is the great chore saver.

Quote
If your cameras don't support simultaneous PTP and USB remote precision sync then I guess that's your only choice.

My personal build not only supports PTP and USB remote precision, there is also a very nice PTP client that I have previously mentioned in the forum.

However, as a matter of philosophy  I much prefer the simplest approach possible.
So do SDM users, that is why many KAP's have no interest in Lua ............. as they told you.
Title: Re: Multi-camera setup project.
Post by: mphx on 23 / August / 2014, 12:43:30
Here again ,


Tests continue....lets see.

1. We managed to shoot with 56 cameras....that's the maximum we have achieved. Result is very good.That's promising.

2.Cameras don't have a steady behavior..from a number and up there are randomly malfunctioned cameras.
I don't know what to think.Hubs not good enough?Cables? usb controllers on the pc ?operating system can't handle more than a maximum number? We even bought a pci (usb) card for extra usb ports.Not much help.

Next step is to use linux to check if things will go better there.And we are thinking to buy more expensive usb hubs...
We need to establish the maximum number of cameras connected to a pc that can work flawlessly AT ALL TIMES ...


There were times were 7 tripods ( 56 cameras) were working flawlessly and there were times that 1 tripod , alone , was behaving bad....only one..for god sake...

I tend to believe it's all about the hubs and the cables...if that is the case..it will be easily solved...


P.S. : that PS is for reyalp :) I noticed that when i had X number of cameras working ok and doing stuff..deleting images from them (multicam command) was missing some cameras when trying to delete images.I had to issue the command twice to be sure that all images from all cameras were deleted.Cameras were still connected to the program (i could go from rec mode to preview mode and vice versa but delete command was misbehaving)
Title: Re: Multi-camera setup project.
Post by: reyalp on 23 / August / 2014, 18:15:38
P.S. : that PS is for reyalp :) I noticed that when i had X number of cameras working ok and doing stuff..deleting images from them (multicam command) was missing some cameras when trying to delete images.I had to issue the command twice to be sure that all images from all cameras were deleted.Cameras were still connected to the program (i could go from rec mode to preview mode and vice versa but delete command was misbehaving)
This doesn't really give me much information to go on. I would expect failures to generate some warning messages in the console.

Regarding the issues with lots of cameras connected: If you are still using the GUI to control, I would strongly trying using the CLI. You could also try
set gui_dev_check_interval=0
in the GUI.
Title: Re: Multi-camera setup project.
Post by: mphx on 24 / August / 2014, 02:38:27

This doesn't really give me much information to go on. I would expect failures to generate some warning messages in the console.

Regarding the issues with lots of cameras connected: If you are still using the GUI to control, I would strongly trying using the CLI. You could also try
set gui_dev_check_interval=0
in the GUI.

Well , when multicam has "lost" some camera(s) , it pop ups a blank popup window with nothing on it.When i see this popup i know that a camera has lost connection.From this point no command can be issued so i have to reconnect them.
Same popup occurs when i "delete" images on cameras..although in this case no camera has lost connection.
Another "message" i see with "delete" command is (i will try to describe it since i don't quite remember it)..it displays in the console the actual command that is used and below that something like <id> : I/O error.
And starts deleting images...but i know it has missed some...so i have to issue it twice to get the rest.

Using CLI was my next thought.To check if behavior of multiple cameras are more steady or not.If random connection failures are because of gui or not.

I will try the command you suggest and see if things are any different when using gui. thanks.


PS : at some point of the tests... i had an error/message ...something like "cannot send <name of command> command : msg queue full. From that point nothing was working..i had to reboot ALL cameras.Any ideas about that?
Title: Re: Multi-camera setup project.
Post by: reyalp on 24 / August / 2014, 15:47:24
Well , when multicam has "lost" some camera(s) , it pop ups a blank popup window with nothing on it.When i see this popup i know that a camera has lost connection.From this point no command can be issued so i have to reconnect them.
Did I mention you should try not using the GUI? ;)

The blank popup means there was an unhandled error somewhere. Unfortunately IUP default error handling doesn't play nicely throwing non-string errors, while chdkptp throws an "error object" table to provide finer grained error handling.

Most of the stock chkdptp code should catch any errors and give you a proper stack trace, but it's possible I've missed some places. If you are using custom GUI code that's just calling multicam functions from a button callback or something like that, it would also have this problem. Since you haven't published the code, I can't give you much help with that.

In general, if you have a callback that calls chdkptp functions, you can do something like
mybutton.action=errutil.warp(function()...end)
where the inner function is whatever your normal callback would be. That will cause errors to go to the console.

Quote
Another "message" i see with "delete" command is (i will try to describe it since i don't quite remember it)..it displays in the console the actual command that is used and below that something like <id> : I/O error.
IO error means that some problem has happened with the USB connection. So this is probably due to your general USB stability problems, and not specific to delete.

Quote
PS : at some point of the tests... i had an error/message ...something like "cannot send <name of command> command : msg queue full. From that point nothing was working..i had to reboot ALL cameras.Any ideas about that?
That should mean that the one (or more) of the cameras was not processing messages as fast as you were sending them. Without knowing more about the specific sequence of events, I would be very difficult for me to guess what is happening.

multicam commands are implemented as messages sent with chdkptp <connection>:write_msg. The camera side script (rlib code at the bottom of multicam.lua) sits in loop waiting for messages. The message system has a queue that can hold up to 15 messages. Normally, you should wait for the previous command to be processed before attempting a new one, by using cmdwait or a hard coded delay.
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 24 / August / 2014, 16:26:55
Probably unrelated so this more as a reference - there have been a few issues discussed, over the years, among the, currently, 2900 odd topics at LibUSB Dev http://libusb.6.n5.nabble.com/LibUSB-Dev-f7i2940.html (http://libusb.6.n5.nabble.com/LibUSB-Dev-f7i2940.html)...in particular I seem to remember one related to problems associated with greater than 64 connected devices. Think it was sorted though. 
Title: Re: Multi-camera setup project.
Post by: mphx on 24 / August / 2014, 16:52:39

Did I mention you should try not using the GUI? ;)

Yes you did :) . We try to keep it simple..and by simple i mean "as less typing as possible".But we will do some tries tomorrow with cli and see.

Quote
If you are using custom GUI code that's just calling multicam functions from a button callback or something like that, it would also have this problem. Since you haven't published the code, I can't give you much help with that.
There is nothing fancy.Added one tab in gui.lua and a new lua file for that tab that just contains my buttons.Which buttons are copy/pasted from other buttons and i just changed the commands :)

Quote
IO error means that some problem has happened with the USB connection. So this is probably due to your general USB stability problems, and not specific to delete.
Yes , i thought so too , but the strange thing is that other commands (preview , rec mode , shoot) continue to work to ALL connected cameras like no camera had lost connection..that's the strange thing.Anyways....

Quote
That should mean that the one (or more) of the cameras was not processing messages as fast as you were sending them. Without knowing more about the specific sequence of events, I would be very difficult for me to guess what is happening.

multicam commands are implemented as messages sent with chdkptp <connection>:write_msg. The camera side script (rlib code at the bottom of multicam.lua) sits in loop waiting for messages. The message system has a queue that can hold up to 15 messages. Normally, you should wait for the previous command to be processed before attempting a new one, by using cmdwait or a hard coded delay.

So i have to turn some cmd to cmdwait.Is there a rule ?What commands need to be "cmdwait"?
Title: Re: Multi-camera setup project.
Post by: reyalp on 24 / August / 2014, 17:17:35
There is nothing fancy.Added one tab in gui.lua and a new lua file for that tab that just contains my buttons.Which buttons are copy/pasted from other buttons and i just changed the commands :)
It doesn't matter if it is "fancy" or not, it is much more difficult to give you specific advice when I don't know what you are actually doing.

Since you post about the problems you encounter, I assume you want help. If you do want help, it's in your interest to make it as easy as possible for those who volunteer their time and effort to help you. Providing as much specific detail as you can about the problem is a good way to do that.

Anyway, in this case it seems like the errutil.wrap code I suggested earlier should give you better diagnostics in your buttons.
Quote
So i have to turn some cmd to cmdwait.Is there a rule ?What commands need to be "cmdwait"?
As I said, you should wait for the previous command to finish before issuing a new one. You can use cmdwait with any command that uses write_status, which AFAIK is just about everything but quit. Note that depending how your code is set up, using cmdwait in the gui may make it effectively lock up until the command finishes.

I suspect there is some other underlying problem causing the queue to fill up, it seems unlikely that you would be issuing more than 15 commands to the same camera in rapid succession.  I wouldn't be surprised if it was somehow related to the communication errors, but I don't see exactly how that would happen, and not knowing the specific sequence of event I can only speculate.
Title: Re: Multi-camera setup project.
Post by: mphx on 25 / August / 2014, 03:04:01
@reyalp

here you go :)

https://www.dropbox.com/s/hfa9womf6bw9aip/gui.lua?dl=0 (https://www.dropbox.com/s/hfa9womf6bw9aip/gui.lua?dl=0)

https://www.dropbox.com/s/yeq7itfr7t4h1ug/gui_multicam.lua?dl=0 (https://www.dropbox.com/s/yeq7itfr7t4h1ug/gui_multicam.lua?dl=0)

my two custom files.

gui_multicam.lua is made of gui_user.lua , so many remarks and names are the same..didn't bother to change them :)

As you can see the maximum number of commands in one button is five...the other buttons are usually 2-3 commands at once.

Problem with hubs/cables are no1 suspect and we are working on it...
Title: Re: Multi-camera setup project.
Post by: mphx on 27 / August / 2014, 08:04:42
At the end of the day it's all about cables and hubs.

Tests with shorter cables and better usb hubs result to more stability to usb connection with the cameras.

We are looking to buying new usb hubs now :)

@reyalp

Is it possible , if i connect to x number of cameras , and y number of them lost connection to continue working (issue multicam commands) to the remaining ?
Right now if atleast one camera lose connection..i can't do anything...i have to reconnect to all.

Is it possible to turn chdkptp into client/server ? :) I mean ...to be able to run chdkptp to let's say two different pcs and each one will connect to a specific number of cameras... then hit shoot to one pc and check in the local lan and sync shoot to all running instances of chdkptp... something like that :)
Title: Re: Multi-camera setup project.
Post by: reyalp on 27 / August / 2014, 22:34:46
Is it possible , if i connect to x number of cameras , and y number of them lost connection to continue working (issue multicam commands) to the remaining ?

Right now if atleast one camera lose connection..i can't do anything...i have to reconnect to all.
It should be possible to flag cameras when they hit an error or remove them from the list of active connections. This is something I've thought about but haven't written any code for yet.

Depending on the specific error, you might have to wait for some timeouts before the error was actually detected.

Quote
Is it possible to turn chdkptp into client/server ? :) I mean ...to be able to run chdkptp to let's say two different pcs and each one will connect to a specific number of cameras... then hit shoot to one pc and check in the local lan and sync shoot to all running instances of chdkptp... something like that :)
Of course it's possible in theory. In practice, I don't see any way to do it without writing a lot of new code.

You could easily have multiple instances of chdkptp receive their standard input over a network, using ssh or something like that. If you feed the standard input from another program, you could probably get shoot commands executed in reasonable sync.
Title: Re: Multi-camera setup project.
Post by: mphx on 01 / September / 2014, 16:21:16
UPDATE on the project :)

Cameras continue to give us a hard time.Their usb connection isn't reliable even with good expensive hubs.
We are starting to think to split tripods/cameras into 2 or 3 pcs , to lighten the load.
8 cameras are working stable.every next 8 cameras decrease stability....randomly....

This thought arises another pack of problems..how to click / shoot synced at the different computers.
We are thinking touch screen and use of teamviewer..still it will be tricky.

@reyalp

I will be straight .. how much do you want to make chdkptp work in a network :)
Title: Re: Multi-camera setup project.
Post by: ahull on 01 / September / 2014, 17:21:17
How are you powering the hubs and cameras?

Could it be the case that the power supply is the cause of your woes, rather than the hubs themselves?

A previous rig suffered from earthing (electrical grounding) issues. You might like to take a look at this thread http://chdk.setepontos.com/index.php?topic=10385.120 (http://chdk.setepontos.com/index.php?topic=10385.120)
Title: Re: Multi-camera setup project.
Post by: reyalp on 01 / September / 2014, 17:37:35
This thought arises another pack of problems..how to click / shoot synced at the different computers.
We are thinking touch screen and use of teamviewer..still it will be tricky.
As I suggested earlier, you should be able to do this programmatically if you use the CLI and feed commands over ssh or similar. You could also do it with some fairly trivial scripting using control files on a network filesystem.

Did you ever try using a linux host? Or using the CLI?

Do you have any more details of the specific errors and when they happen? Does it only happen if you shoot, or if you just connect to the cameras do they stop being connected after a while?

What specific errors do you get?
Quote
I will be straight .. how much do you want to make chdkptp work in a network :)
Spending much more time than I do now to chdkptp would require quitting my day job.
Title: Re: Multi-camera setup project.
Post by: mphx on 02 / September / 2014, 04:42:57

As I suggested earlier, you should be able to do this programmatically if you use the CLI and feed commands over ssh or similar. You could also do it with some fairly trivial scripting using control files on a network filesystem.

Did you ever try using a linux host? Or using the CLI?

Do you have any more details of the specific errors and when they happen? Does it only happen if you shoot, or if you just connect to the cameras do they stop being connected after a while?

What specific errors do you get?

There is no specific error and it doesn't occur in a specific moment..it can happen during "connecting" or during sync/shoot or during download/delete.It just pops a blank error window and when i see it i know that one or more cameras have lost connection.
It's irrelevant with gui..it happens when i use console too.And it happens when i hook up many cameras.With 8 cameras or 16 cameras its fairly stable..from 16 and up its random.
That's why i told you before..if there was a way to "ignore" those cameras that lost connection and multicam commands apply to the rest of them.
Because if one or two lost connection..i can process the result of the rest cameras..But now even one if loses connection , i can't do anything...i have to connect all of them again and pray no camera will lose connection..at  least at the connection stage...
Title: Re: Multi-camera setup project.
Post by: mphx on 02 / September / 2014, 05:15:41
How are you powering the hubs and cameras?

Could it be the case that the power supply is the cause of your woes, rather than the hubs themselves?

A previous rig suffered from earthing (electrical grounding) issues. You might like to take a look at this thread http://chdk.setepontos.com/index.php?topic=10385.120 (http://chdk.setepontos.com/index.php?topic=10385.120)

There are 8 tripods with 8 cameras on each one.On every tripod there is one 9-10 port power outlet + 1 hub.

Every camera has the dummy battery kit (chinese one :) since original is too expensive) and a usb cable going to the hub.

At this point all 8 hubs are going directly to one pc to avoid more problems with more hubs .

We had one tripod (8 cameras) working all day long without any camera lose connection...we are talking about 4-5 hours..doing stuff...we hooked up a second tripod...16 cameras total... we had 90% stability..one or two cameras..losing connection...but not very often.
We managed to make all 64 cameras work at some points but it was..moments...shoot once or twice...download files and that was all before some camera(s) lose connection again.

So we are thinking that the problem occurs when we have many cameras "online".It's either hubs or cables (we use 3m usb cables on all cameras and we are planning to change some of them to shorter ones).

I don't know about power grounding...i mean if it creates problems or not in my case....i can't check it ....
Title: Re: Multi-camera setup project.
Post by: novsela on 02 / September / 2014, 05:47:41
We having the same issues with cameras connectivity,
But it looks like power to USB hubs and tying the USB cables solved 95% .

Another question , how do you control on camera setting ? ISO , speed shutter ,aperture ?

Regards
Title: Re: Multi-camera setup project.
Post by: waterwingz on 02 / September / 2014, 08:50:07
I don't know about power grounding...i mean if it creates problems or not in my case....i can't check it ....
This is almost certainly a grounding problem on the low voltage side. 

Unless they are specifically grounded via their power cords, the low voltage side of each of your camera power supplies and each of the USB hub supplies essentially "floats" at some random voltage level above ground. The thin USB 5V gnd wires in your USB cables are the only thing connecting them together and you can get noise and significant DC voltage drops across those wires.

The best and only way to fix this is a heavy wire (at least 8 ga. or 3.26 mm) connecting the various D.C. grounds together.  That usually means the sleeve side of each DC connector - both the USB hubs and camera power supplies.

Finding a tidy & elegant way to do this can be difficult.   You could use a thin wire on each of your tripod poles to connect the power supply DC grounds and then a thick wire between tripods. 

At a minimum, connect via a thick wire the USB ground pin from one port on each hub to a port on every other hub.  That should get you 90% of the way there.

Post a picture of your USB hubs,  power supplies, and camera power supplies?  Or a link to where you bought them?
Title: Re: Multi-camera setup project.
Post by: waterwingz on 02 / September / 2014, 08:54:21
Another question , how do you control on camera setting ? ISO , speed shutter ,aperture ?
Did you read my response the first time you asked this ? 
http://chdk.setepontos.com/index.php?topic=11583.msg116233#msg116233 (http://chdk.setepontos.com/index.php?topic=11583.msg116233#msg116233)

Hint : USAGE.TXT line 268
Title: Re: Multi-camera setup project.
Post by: mphx on 02 / September / 2014, 14:47:40
Post a picture of your USB hubs,  power supplies, and camera power supplies?  Or a link to where you bought them?

we have used 3 different kind of usb hubs..practically 2 kinds..since one kind of them turned out to be too lousy...

we use some of them -> http://www.amazon.co.uk/gp/product/B002ZU7HH2/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1 (http://www.amazon.co.uk/gp/product/B002ZU7HH2/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1)

and i am expecting some of them --> http://www.amazon.co.uk/gp/product/B005NGQWL2/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1 (http://www.amazon.co.uk/gp/product/B005NGQWL2/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1)

and we are using some digitus usb hubs ( 10 ports i think)..i can't recall the exact model.

Digitus and Manhattan should be pretty good..especially manhattan...if i judge from its price.anker has good reviews..but i haven't use any yet..i am expecting them.

As far as dummy battery kits are concerned , we are using the classic ACK-DC90 kit , but a chinese version of it...not the original

Both hubs and kits don't have ground "pin" in their power cord outlet...so naturally i assume nothing is grounded..

Pfff it's gonna be messy to ground all these things...

Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 02 / September / 2014, 15:57:57
Hint : USAGE.TXT line 268

looks like 368. [edit: oops rev 655  :-[ ]

Another question , how do you control on camera setting ? ISO , speed shutter ,aperture ?

via ptp in isolation from the shoot options ?
Title: Re: Multi-camera setup project.
Post by: reyalp on 02 / September / 2014, 16:21:46
There is no specific error and it doesn't occur in a specific moment..it can happen during "connecting" or during sync/shoot or during download/delete.It just pops a blank error window and when i see it i know that one or more cameras have lost connection.
I explained previously how to make this give you a more informative error message: http://chdk.setepontos.com/index.php?topic=11667.msg116130#msg116130 (http://chdk.setepontos.com/index.php?topic=11667.msg116130#msg116130)

Did you try a linux host? If nothing else, linux system logs might provide more information about what is actually going on.

I would not be at all surprised if the is a hardware issue (power, grounding, cabling, hubs...) but I also wouldn't be surprised if it were a software issue.

I've never used chdkptp with more than 3 cameras, so this is unknown territory for me.
Title: Re: Multi-camera setup project.
Post by: novsela on 02 / September / 2014, 16:23:26
@ waterwings , I read your reply but still I dont get how i can use it once Bcam is running 

In general - I found it is possible via ptpCamGui (pic attached)

Regarding the wiring, we used cheap USB hubs (the cheapest we could get) , but we had lucky , it have on/off 5v power switch per port so it was easy to by pass it with RELAY

http://www.ebay.com/itm/Black-7-Port-USB-2-Power-Hub-High-FNRG-Speed-Adapter-Separated-Switch-Laptop-/141142475386?pt=LH_DefaultDomain_186&hash=item20dcbf427a (http://www.ebay.com/itm/Black-7-Port-USB-2-Power-Hub-High-FNRG-Speed-Adapter-Separated-Switch-Laptop-/141142475386?pt=LH_DefaultDomain_186&hash=item20dcbf427a)

we built 4 control box to aggregate 7 Cameras USB .

Important Note - we found that we must tied thee cables (using plastic strip)

 
Title: Re: Multi-camera setup project.
Post by: reyalp on 02 / September / 2014, 16:31:42
Hint : USAGE.TXT line 268

looks like 368.
Line numbers probably aren't useful unless you specify a revision  ;)

I replied in the other thread, but for any future readers, the above appears to refer to the "shoot" CLI command, which will not help you set exposure in a multicam setup. The code may provide a useful reference, but if you are using multicam you will need to set the exposure by calling lua functions on the camera. In multicam, this can be done using the 'call' command.
Title: Re: Multi-camera setup project.
Post by: mphx on 02 / September / 2014, 16:33:49
There is no specific error and it doesn't occur in a specific moment..it can happen during "connecting" or during sync/shoot or during download/delete.It just pops a blank error window and when i see it i know that one or more cameras have lost connection.
I explained previously how to make this give you a more informative error message: http://chdk.setepontos.com/index.php?topic=11667.msg116130#msg116130 (http://chdk.setepontos.com/index.php?topic=11667.msg116130#msg116130)

Did you try a linux host? If nothing else, linux system logs might provide more information about what is actually going on.

I would not be at all surprised if the is a hardware issue (power, grounding, cabling, hubs...) but I also wouldn't be surprised if it were a software issue.

I've never used chdkptp with more than 3 cameras, so this is unknown territory for me.

A try with linux host is scheduled in the next days.I believe too that is a hardware issue since either in cli or gui..."behavior" is rather the same...will do a linux host try and see if things there are the same or any different .

I will try to implement what you suggested for the error message "catching"


We are thinking to use 4 laptops with 16 cameras to each one of them (2 tripods that is). We did some tests today...but even with 2 tripods connected to each laptop (we used 2 laptops for some early testings) , connection of the cameras was not stable.
And of course is the problem how to sync "hitting shoot" on 4 laptops ....that would be tricky...Linux is not an easy option at the moment...but we will go there if nothing else works...
Title: Re: Multi-camera setup project.
Post by: waterwingz on 02 / September / 2014, 23:33:22
Pfff it's gonna be messy to ground all these things...
You might think about using something like this :  http://www.ebay.com/itm/like/151098536728?lpid=82 (http://www.ebay.com/itm/like/151098536728?lpid=82) but in the correct connector sizes for your hubs & fake batteries.

(https://chdk.setepontos.com/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F84jzW51.png&hash=c58977e7adad4ce047cd477d7d02aa41)

Insert one inline between each of your power supplies and hubs/fake batteries and use the extra plug to create a common ground buss with connectors like this :

(https://chdk.setepontos.com/proxy.php?request=http%3A%2F%2Fallelcdn.upshotcommerce.com%2F%2Fmas_assets%2Fcache%2Fimage%2F2%2Fd%2Fb%2Fe%2F480x480-11710.Jpg&hash=b0d4a3a5068c0bc451a800e2eddf7970)

Connect the ground side only between each power supply. Use normal wire on each tripod and heavy gauge between the tripod. 

I think this will not be too expensive,  will work well, looks tidy,  and is very portable.
Title: Re: Multi-camera setup project.
Post by: mphx on 03 / September / 2014, 04:27:08
@waterwigz

let me see if i get it right... i get the first one and connect one side to the dummy battery and the one of the 2 other sides to the power cord of it.Second side that is left free , i end it with the second thing...
And then i connect with some kind of wire all the "second image" things through that green thing to create a common ground spot  or something?

If the above is correct it can be done for the dummies...i dont get it how can be done with hubs.

What was the other thing you said in earlier post?Connect the ground of one port of every hub all together?This will do partially the trick?
Title: Re: Multi-camera setup project.
Post by: waterwingz on 03 / September / 2014, 08:36:15
let me see if i get it right... i get the first one and connect one side to the dummy battery and the one of the 2 other sides to the power cord of it. Second side that is left free , i end it with the second thing... And then i connect with some kind of wire all the "second image" things through that green thing to create a common ground spot  or something?
Correct.  You could also buy the appropriate male plugs & female jacks, suitable for mounting on a cable, and solder together to create your own adapter cables.
(https://chdk.setepontos.com/proxy.php?request=http%3A%2F%2Fi00.i.aliimg.com%2Fwsphoto%2Fv1%2F1738214868_1%2F9mm-5-5mm-2-5mm-DC-Power-Plug-Socket-Female-Plug-Jack-Male-Plug-Jack-Connector.jpg&hash=8b834d7a6acefbefbf89b0f8c68de571)
You are trying to make a short "patch" cable that does not interfer with normal operation but allows you access to the 0V conductor from the power supply.

Quote
If the above is correct it can be done for the dummies...i dont get it how can be done with hubs.
The pictures you posted of your hubs show that is uses a "wall wart" style power supply that plugs into the hub to provide power.  See the center jack in this picture.
(https://chdk.setepontos.com/proxy.php?request=http%3A%2F%2Fecx.images-amazon.com%2Fimages%2FI%2F61VPW%252By%252B-PL._SX522_.jpg&hash=59790f293b154df99f18d9bb9214dea7)
YOU ARE USING POWER FOR THE HUBS - RIGHT? 
(https://chdk.setepontos.com/proxy.php?request=http%3A%2F%2Fwww.originlive.com%2Fmagento%2Fmedia%2Fcatalog%2Fproduct%2Fcache%2F3%2Fimage%2F800x600%2F9df78eab33525d08d6e5fb8d27136e95%2Fu%2Fk%2Fuk_4.jpg&hash=40aee052522f877ef5f2b84ef1d65aaa)
You can connect the same style cable (perhaps with different sized plugs/jacks) between the power packs and the hub and then connect the other Y lead together and to the Y leads from the fake battery power supplies.

Quote
What was the other thing you said in earlier post?Connect the ground of one port of every hub all together?This will do partially the trick?
I was just trying to suggest another method to get all the grounds connected.  The metal shield on the USB hubs or the 0V power pin on the USB jack might be all connected to the 0V line from the powerpacks.  You will need to check that with an ohm meter. If they are, then any method that connects them all together will help create a common ground point.

Edit : If I have a few minutes later today,  I'll try to create a wiring diagram that shows all of this.
Title: Re: Multi-camera setup project.
Post by: mphx on 03 / September / 2014, 09:16:07
IMPORTANT UPDATE :)

Lets put your ideas on hold a bit waterwingz.

We took apart power cables from usb cables on every tripod.We didn't tied them up or anything..we just kept them far away apart.
Stability went high sky. 5 tripods connected for several minutes...without losing not a single one.Thats a first.
Usually we had random disconnects with only 2 tripods.
Probably there was too much interference from the power cords (don't forget that are chinese dummy battery kits) and some of them are making a high pitch noise....electricity must be doing party there...

More tests and will post results :)
Title: Re: Multi-camera setup project.
Post by: waterwingz on 03 / September / 2014, 10:35:13
Lets put your ideas on hold a bit waterwingz.
Congratulations! You have just proven exactly what I was trying to tell you. 

Without proper grounding, every conductor in your wiring becomes an electrically floating antenna - transmitting and/or receiving noise at random.   With enough noise,  cameras will get confused and go offline.  In severe cases,  actual permanent electrical damage is possible.  And a really good source of noise is cheap switching mode power supplies.

One "solution" is to separate each cable as far away from all the other cables as possible, thereby lowering their ability to couple together and share noise.  You could also add shielding - with braided metal sleeves and or aluminium foil wraps.  At a minimum, run your USB cables away from the power cables to the fake batteries.

If you can get stability this way then that is great. But a better, more stable, and more reliable solution will still be to fix the grounding.

Title: Re: Multi-camera setup project.
Post by: ahull on 03 / September / 2014, 10:51:09
Quote
...
And a really good source of noise is cheap switching mode power supplies.
...

There is a reason why they are cheap... generally they have much poorer noise figures and worse regulation.

They are also inclined to have poor mains isolation too.

As I have suggested with other multi camera rigs, an ELCB or RCD mains breaker plug is a good idea. This should protect you from the rather nasty consequences if one of these cheap power supplies decides to pop and shunt mains voltage in to places it shouldn't go.

Having said all that, I have used quite a number of these cheap devices, and am still around to tell the tale. 
Title: Re: Multi-camera setup project.
Post by: thepanoguy on 04 / September / 2014, 02:48:02
Power supplies are manufactured to ISO or EU Standards to protect people from mains voltage faults and potential electrocution. Switched mode power supplies are designed for specific specifications. Using certified ISO or EU Standards switched mode power supplies, outside their design specifications, can result in electrical hazards.

A successful earthing and electrical noise solution is the understanding of your local earthing system used by the mains supply authorities.

An RCD / ELCB will only protect from a active conductor (live or hot depending on your locality) to earth fault. An RCD / ELCB will not protect from an active to neutral fault. If the earth wiring and electrode is ineffective the earth path is potentially a neutral return conductor. Depending on the situation an RCD / ELCB may or may not trip or it can false trip intermittingly.

In my region (Perth, Western Australia) the supply authority distribute three phase and neutral 240 volts 50hz. RCD / ELCB’s protecting lighting circuits and power outlets are mandatory in residential premises. In the consumer switchboard, the neutrals are terminated into a neutral link and the earths into an earth link. The neutral and earth links are connected with an earth conductor which is run to the outside of the premises and connected to a earth electrode.

In essence, every premise is an earth electrode and when combined a massive earth conductor. The system works because my soil locality is fine sand with moisture.

Other regions use a dedicated earth conductor which is neutral earth bonded by the supply authority.

I have opened double insulated do not earth electronic equipment. In many cases the earth reference is derived from two metal oxide varistors connected in series across active and neutral. The centre tap is used as an electronics earth reference. The active side is connected to a fuse. In the event of a power surge the non-serviceable fuse blows rendering the equipment inoperable. 

In view that countries use different mains supply voltages and earthing systems, it may be helpful to all, if the moderators start a dedicated thread and members post and document their local mains distribution specifications and experiences. 
Title: Re: Multi-camera setup project.
Post by: novsela on 04 / September / 2014, 02:53:37
regarding the cables , please see how we done it
Title: Re: Multi-camera setup project.
Post by: mphx on 04 / September / 2014, 03:21:29
@thepanosguy

In my region (Greece) , grounding is not something that is setup properly.My friend asked the electricity technician that he setup the electric stuff on the studio and he told him that even in more complex buildings , ground wire in the sockets is not even connected somewhere..just hanging in there...go figure...pathetic country with pathetic people when it comes to do a job right.

@novsela

i can't really tell much from the photo :)
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 04 / September / 2014, 05:08:50
...go figure...pathetic country with pathetic people when it comes to do a job right.

Don't be too hard on yourself - the British park F35's on golf-courses http://www.bbc.co.uk/news/world-europe-29056870 (http://www.bbc.co.uk/news/world-europe-29056870) 

Imagine what that must do to the grass :-)
Title: Re: Multi-camera setup project.
Post by: waterwingz on 04 / September / 2014, 09:23:05
In my region (Greece) , grounding is not something that is setup properly.My friend asked the electricity technician that he setup the electric stuff on the studio and he told him that even in more complex buildings , ground wire in the sockets is not even connected somewhere..just hanging in there...go figure...pathetic country with pathetic people when it comes to do a job right.
The discussion here about the grounding system in your building, and the importance of protection circuits on the AC high voltage side, is a valuable discussion about electrical safety.

However, it has almost nothing to do with your problems.   

What you are dealing with is a whole lot of floating DC low voltage systems (cameras & hubs) without a common voltage reference point (sometimes mistakenly called ground).  This gives you all kinds of current paths and voltage drops - made  worse by high frequency noise and coupling between cables.    Ideally your common voltage reference point ( the thick wire I talked about earlier ) would also be connected to an earth ground provide by your building but just having a common reference is 95% of the battle.
Title: Re: Multi-camera setup project.
Post by: mphx on 04 / September / 2014, 12:58:53

The discussion here about the grounding system in your building, and the importance of protection circuits on the AC high voltage side, is a valuable discussion about electrical safety.

However, it has almost nothing to do with your problems.   

What you are dealing with is a whole lot of floating DC low voltage systems (cameras & hubs) without a common voltage reference point (sometimes mistakenly called ground).  This gives you all kinds of current paths and voltage drops - made  worse by high frequency noise and coupling between cables.    Ideally your common voltage reference point ( the thick wire I talked about earlier ) would also be connected to an earth ground provide by your building but just having a common reference is 95% of the battle.

I get what you are saying.

We did some more tests today.We had around 4 tripods working 100% stable for hours..we just took apart usb cables and power cords of dummy batteries.
Also we replaced some usb cables with shorter ones.We gonna replace almost all of them with short ones.
We now wait for some hubs to be delivered in the next few days and replace the ones we have now so we will be kinda sure that we use the best hubs we can get.
We gonna order tonight the shorter cables and we gonna put hubs in the center of the tripods and all usb cables gonna be far away from power cords that are gathered in the bottom of the tripods.

Target is to have atleast 4 tripods stable per pc .If we succeed atleast that then we gonna work with 2 pcs.If we have more stable tripods then we might risk it to use only one pc.

We will first try this scheme , i mean taking apart cables since it seems that it does some good in the whole situation , and then we will think about more grounding actions.
Title: Re: Multi-camera setup project.
Post by: waterwingz on 04 / September / 2014, 13:00:57
Are you using the hubs with power supplies or using them unpowered?
Title: Re: Multi-camera setup project.
Post by: mphx on 04 / September / 2014, 13:02:19
Are you using the hubs with power supplies or using them unpowered?

All usb  hubs are powered.
Title: Re: Multi-camera setup project.
Post by: novsela on 06 / September / 2014, 12:59:53
@mphx -  the pic is for you to see how we run the cable across the rig
Title: Re: Multi-camera setup project.
Post by: mphx on 09 / September / 2014, 14:46:55
UPDATE

Nothing new to be honest :) We are waiting some hubs tomorrow and we bought one more tripod so we are going to play with 9 tripods ( 7 cameras each) ...two tripods close to each other for the "face" and the rest of them in circle.

Here is a rough example of a test we did http://p3d.in/GA01v (http://p3d.in/GA01v) (this is my friend :P )
As i said , when cameras are working, result is more than sufficient.Lets hope with the new hubs and the shorter cables we are waiting by the end of the week , problems will be eliminated , if not entirely ...atleast ...A LOT.
Title: Re: Multi-camera setup project.
Post by: Kam_mim on 09 / September / 2014, 15:14:29
Very Good result mphx.. What software are you using for this?
Title: Re: Multi-camera setup project.
Post by: Microfunguy on 09 / September / 2014, 15:14:51
.

Here is a rough example of a test we did http://p3d.in/GA01v (http://p3d.in/GA01v)


Cannot display, Windows XP not supported and my Windows 7 PC does not have a separate graphics card.

Apart from that, let me ask you a basic question  ...............

you create a 3D model of a person, what then, what is it for ?
Title: Re: Multi-camera setup project.
Post by: waterwingz on 09 / September / 2014, 15:58:32
Here is a rough example of a test we did http://p3d.in/GA01v (http://p3d.in/GA01v)
Very nice.  Displays perfectly on my low end Win7 laptop.
Title: Re: Multi-camera setup project.
Post by: mphx on 09 / September / 2014, 16:30:54
Very Good result mphx.. What software are you using for this?

i am not the 3d expert here but i will try to recall some of the programs used.

Model is created from the photos using agisoft photoscan. Pretty awesome program...
For high quality modelling in a serious pc it needs around 2 hours .For a medium result some minutes.
After model is created there are many rough edges on it.If we had dslr cameras these rough edges would have been as less as possible.
So 3d expert is doing some sculpting .Smooth the model.I can't recall the name of the program..but this program does only sculpting.Nothing else.
Then we take 3d model into 3ds max and we do some correction.
We re-attach texture in the new smooth model (as i am told that's a bit of work to get it right) and we correct anything didn't come up right..interior of arms , legs etc etc.

If you want specific names of programs , i can look them up tomorrow that i will be in the studio and check them at the pc.


Apart from that, let me ask you a basic question  ...............

you create a 3D model of a person, what then, what is it for ?

The whole purpose of the project is to create 3d miniatures of people.Of any kind and posture.A family , a single guy/girl , a bunch of friends , babies , dogs and combinations of all the above.
Maybe someone wants a miniature to remember a day/occasion (e.g. wedding , a newborn baby etc etc).
Maybe someone wants to give a special gift to someone...or something...

Apart of just modelling the person we can do any custom job he wants..his head to someone's else body (e.g. spiderman , superman :) , holding something weird in his hands..whatever...)
Title: Re: Multi-camera setup project.
Post by: novsela on 17 / September / 2014, 17:41:07
looking good !!!

could u send me pic of your rig ?
I would like to see how u managed to take pic from of the head from top view

thx
Title: Re: Multi-camera setup project.
Post by: mphx on 17 / September / 2014, 18:59:39
looking good !!!

could u send me pic of your rig ?
I would like to see how u managed to take pic from of the head from top view

thx

At last we got the new hubs and some shorter cables , so tomorrow we gonna do some changes on the ring.
I will take some pics tomorrow for you to see.
As far as the top view of the head is concerned , nothing fancy..just the top cameras of every tripod are way far up and looking down.That's not the ideal thing to do but all things considered is the best we can do at the moment.
And since the result is pretty good we will keep them the way they are.
Title: Re: Multi-camera setup project.
Post by: mphx on 18 / September / 2014, 11:44:52
Project went back again because of the newly bought cables.They really sucked...sucked is an understatement.
Three cameras alone were losing connection like crazy.T-H-R-E-E.

We used the cables we already had in three T R I P O D S and were online for half a day.And the new cables couldn't "hold" three cameras alone.pfff

100 euros in cables got wasted.So we gonna get some new cables that we know they work for sure tomorrow.
Hubs seem to be working ok.We ended up in 2 brands and we will stick to them :)

More news tomorrow and if all work ok i will get some pics .
Title: Re: Multi-camera setup project.
Post by: mphx on 19 / September / 2014, 12:34:27
Today was a GOOD DAY :)

We replaced all the sucky cables with new ones and we did a temp connection with all tripods going straight to the pc.System was stable for hours...
So it all comes to good quality cables and hubs and keep them away from power sources :) We wasted too much time and money to find good cables and hubs...

https://www.dropbox.com/s/tck3laxo1b0y6y3/20140919_180904.jpg?dl=0 (https://www.dropbox.com/s/tck3laxo1b0y6y3/20140919_180904.jpg?dl=0)

https://www.dropbox.com/s/dube96zitqhx8mq/20140919_180910.jpg?dl=0 (https://www.dropbox.com/s/dube96zitqhx8mq/20140919_180910.jpg?dl=0)

https://www.dropbox.com/s/l1taqja04zyhk6z/20140919_180916.jpg?dl=0 (https://www.dropbox.com/s/l1taqja04zyhk6z/20140919_180916.jpg?dl=0)

https://www.dropbox.com/s/85qp3mk2thi3pj9/20140919_181020.jpg?dl=0 (https://www.dropbox.com/s/85qp3mk2thi3pj9/20140919_181020.jpg?dl=0)

(I need to learn to get better photos or buy a better mobile phone :) )

We did some test shots and results were great.We will re-arrange some cables that as you see in the photos cross vertically the place and put them around tripods.We just put them like that just for the tests.
After these things we will start doing serious test photos to print some 3d miniatures to display in the studio for the customers to see.
Title: Re: Multi-camera setup project.
Post by: waterwingz on 19 / September / 2014, 18:50:29
So it all comes to good quality cables and hubs and keep them away from power sources :) We wasted too much time and money to find good cables and hubs...
The key feature of the "good quality" cables that probably matters is the gauge of the shield layer and its ability to carry enough current to equalize variation in ground potentlal between all those floating power supplies you are using.   In other words,  rather than hooking up a common heavy gauge ground bus like I suggested,  you now have cable with enough current carrying capacity to mostly serve the same functions.   If that works for you then it's good enough - but if it was me I would hook up a separate common ground.
Title: Re: Multi-camera setup project.
Post by: eponymous on 20 / September / 2014, 20:14:09
Poor quality cables are a notorious problem with USB. Not sure how to test them, but they can cause all sorts of problems with drives, etc. They'll work well enough to make trouble. >:(
Title: Re: Multi-camera setup project.
Post by: mphx on 20 / September / 2014, 21:32:33
Poor quality cables are a notorious problem with USB. Not sure how to test them, but they can cause all sorts of problems with drives, etc. They'll work well enough to make trouble. >:(

Sadly you can't test them if you don't buy them :) A cable that works well with usb sticks/disks or printers is not guaranteed that will work well with a bunch of cameras.

If you check the photos that i posted , you will see around the tripods on the floor stacks of cables that we used , they didn't work and are going to be a money (and it was time loss too) loss.
Title: Re: Multi-camera setup project.
Post by: waterwingz on 20 / September / 2014, 22:29:26
If you check the photos that i posted , you will see around the tripods on the floor stacks of cables that we used , they didn't work and are going to be a money (and it was time loss too) loss.
On final time, for the record, I'll point out that with better grounding,  those cables might have worked just fine.
Title: Re: Multi-camera setup project.
Post by: Hardware_Hacker on 21 / September / 2014, 02:40:47
Ref: Post Re: Multi-camera setup project. « Reply #44 on: 13/July/2014,

http://chdk.setepontos.com/index.php?topic=11667.msg114424#msg114424 (http://chdk.setepontos.com/index.php?topic=11667.msg114424#msg114424)

Ref: Post Re: Multi-camera setup project. « Reply #150 on: 02/September/2014

@ mphx "...Every camera has the dummy battery kit (chinese one..."

@ mphx "...I don't know about power grounding...i mean if it creates problems or not in my case....i can't check it ...."

Ref: Post Re: Multi-camera setup project. « Reply #152 on: 02/September/2014

@ W-W "...This is almost certainly a grounding problem on the low voltage side..."

Ref: Post Re: Multi-camera setup project. « Reply #154 on: 02/September/2014,

@ mphx "...Pfff it's gonna be messy to ground all these things...

Ref: Post Re: Multi-camera setup project. « Reply #159 on: 02/September/2014,

@ mphx "...And of course is the problem how to sync "hitting shoot" on 4 laptops ....that would be tricky..."

See Attached; Multi-Camera_Array_Concept [Trillinon Dollar] Lp.png

Ref: Post Re: Multi-camera setup project. « Reply #163 on: 03/September/2014

@ mphx "...Lets put your ideas on hold a bit waterwingz..."

@ mphx "...We took apart power cables (chinese one (???)  from usb cables on every tripod.
We didn't tied them up or anything...we just kept them far away apart..."

@ mphx "...Probably there was too much interference from the power cords..."

Ref: Post Re: Multi-camera setup project. « Reply #164 on: 03/September/2014.

@ W-W "...Congratulations! You have just proven exactly what I was trying to tell you..."

Ref: Post Re: Multi-camera setup project. « Reply #182 on: 18/September/2014,

@ mphx "...100 euros in cables got wasted..."

Ref: Post Re: Multi-camera setup project. « Reply #187

@ mphx "...they didn't work and are going to be a money (and it was time loss too) loss..."

@ W-W "...On final time, for the record, I'll point out that with better grounding, those cables might have worked just fine..."

Ref: Post Re: Multi-camera setup project. « Reply #30 on: 12/July/2014,

@ mphx "...I am guessing it wont work as I imagine right?..." (???)

-~+ NO Pain$ +~-    ,,,,    .-= NO Gain$ =-.

See also attached; Multi-Camera_Array_Concept [Trillion Dollar] Lp.png

The "Sneeky Rats" representing your Multi-camera setup project wiring, "RATS NEST" style. (Also used by most of the similar projects).

There are FOUR "Sneeky Rats" representing, (@ MORE;) "Complex Technical issues", in your Multi-camera setup project.

Two of those "FAT" and "Sneeky Rats" are now beaning feed on your hard earned euros/dollars.

ALSO, Note, the comment on "...too much interference...".

H-H's, "50 cents per foot solution", regarding the "too much interference from ... the (chinese one ... (???)".

@ Mr. Google "...Apart from Tungsten ( foil) Copper has the second highest rate of EMI and RFI rejection, I would suggest Copper ( foil)..."

@ Mr. eBay "...Single-sided Conductive Adhesive Copper Foil EMI Shield Tape..." (eBay item number: 141074247289)
"...A MUST HAVE FOR ELIMINATING ELECTRICAL HUM AND NOISE. COPPER FOIL EMI (ELECTROMAGNETIC INTERFERENCE)..."

@ H-H I think that there is, at least, FOUR basic causes of "...too much interference..."

One the absence of proper filtering in the "CHEAP" Switching Power Supplies.
Another is lack of lack of "Foil EMI Shield Tape" on Camera Power Supply Cables.
The third is the absence of proper filtering in your home made battery power adapters. (i.e "HIGH BATTERY INTERNAL RESISTANCE".)
The USB Hubs and Cables are just the Innocent Victim's of EMI noise as per some previous post's on this subject.
Last but not least is those, "Sneeky Rats", see above.

@ H-H "...Congratulations! You have just proven exactly what I was trying to tell you..." and for your "GOOD WORK", "SO FARRRRR" !!!.

BUT.....to be continued, comments anyone.

PS; DON'T THROW AWAY THE ORIGINAL CABLES AND HUBS !!!.

Happy Hacking from H-H
Title: Re: Multi-camera setup project.
Post by: mphx on 21 / September / 2014, 06:02:08
If you check the photos that i posted , you will see around the tripods on the floor stacks of cables that we used , they didn't work and are going to be a money (and it was time loss too) loss.
On final time, for the record, I'll point out that with better grounding,  those cables might have worked just fine.

Probably yes but i will repeat what i said in a previous post.When i have 2-3 tripods with cables brand A working all day , with the current setup , regardless the presence of grounding or not and then we put cables brand B in another tripod , we turn on only 3 cameras on that tripod and the connection is lost constantly every few seconds...then it's all about the cables.

When we have 5-6 tripods working , some cameras with cable brand A and some with cable brand B ...same setup on all cameras/cables and the connection is lost in those cameras with cables brand B , then since the grounding (or the lack of it) is the same to all cameras..we are talking about quality...of the cables ...

Sure if there was a better setup (grounding-wise i mean) any cable could have done the trick...that doesn't cancel the fact that some cables are "better" than others :)


@Hardware_hacker

"One the absence of proper filtering in the "CHEAP" Switching Power Supplies.
Another is lack of lack of "Foil EMI Shield Tape" on Camera Power Supply Cables.
The third is the absence of proper filtering in your home made battery power adapters. (i.e "HIGH BATTERY INTERNAL RESISTANCE".)
The USB Hubs and Cables are just the Innocent Victim's of EMI noise as per some previous post's on this subject."

I don't get what you mean by "home made".Home made from chinese?Because i didn't make anything myself.All components involved are bought.I can't check if what i bought is "home made" or "factory made" :)

I will agree with your last sentence but i will insist in my view that some hubs and some cables are "better" than others.And that fact is shown in the crappiest conditions and by that i probably mean no proper grounding and no proper power adapters.
I have seen hubs from 10-20euros to 60-70euros and cables from 1-2 euros to 400euros (shielded , silver inside , gold in the edges..)
That stuff can't be the same quality and range to that wide costs.

And of course i won't throw anything from the "no good" cables and hubs.Probably they were not up to the task but that doesn't mean that are faulty.They can work well in other cases (sticks,printers,ext. drives , etc etc).
We will try to sell as many as we can and use the rest somewhere else :)
Title: Re: Multi-camera setup project.
Post by: eponymous on 21 / September / 2014, 09:07:45
Poor quality cables are a notorious problem with USB. Not sure how to test them, but they can cause all sorts of problems with drives, etc. They'll work well enough to make trouble. >:(

Sadly you can't test them if you don't buy them :) A cable that works well with usb sticks/disks or printers is not guaranteed that will work well with a bunch of cameras.

If you check the photos that i posted , you will see around the tripods on the floor stacks of cables that we used , they didn't work and are going to be a money (and it was time loss too) loss.

Yes, but other people buy and test these things too. There are more and less reputable brands.
Title: Re: Multi-camera setup project.
Post by: mphx on 28 / September / 2014, 11:40:16
A minor problem raised up.

Some tests with zoom came up with some distortion...if we take the photos as raw then the problem is solved.
But we can't switch 64 cameras to raw images since raw format is too big for transferring.

Is there a way probably through some lua commands to switch between jpg and raw format at will ?
Title: Re: Multi-camera setup project.
Post by: waterwingz on 28 / September / 2014, 11:55:47
Is there a way probably through some lua commands to switch between jpg and raw format at will ?
set_raw(off/on) (http://chdk.wikia.com/wiki/CHDK_scripting#set_raw) ?
Title: Re: Multi-camera setup project.
Post by: mphx on 28 / September / 2014, 11:57:39

set_raw(off/on) (http://chdk.wikia.com/wiki/CHDK_scripting#set_raw) ?

i shouldn't be confused with the "recording" i see there..right?it means photos ...right? :)

Also since i am not lua expert.. what should be the code of a "button" that switches on/off raw recording?

probably getting current status and turning on or off accordingly raw mode.
Title: Re: Multi-camera setup project.
Post by: waterwingz on 28 / September / 2014, 12:10:28
it means photos ...right? :)
Yes.

Quote
Also since i am not lua expert.. what should be the code of a "button" that switches on/off raw recording?
probably getting current status and turning on or off accordingly raw mode.
I don't know what your existing "button" code looks like but you are probably also looking for the get_raw() (http://chdk.wikia.com/wiki/CHDK_scripting#get_raw) function ?
Title: Re: Multi-camera setup project.
Post by: mphx on 28 / September / 2014, 14:54:11
Ok , i added some buttons for raw mode and for manipulating dng files apart from jpeg.I will put them in test tomorrow and will post the code for anyone that would like to do something similar.
Title: Re: Multi-camera setup project.
Post by: reyalp on 29 / September / 2014, 00:10:38
Some tests with zoom came up with some distortion...if we take the photos as raw then the problem is solved.
It's not clear what you mean. Are you saying the jpeg has distortion but the raw doesn't? Usually, it's the other way around, the camera applies distortion correction to the jpeg, while the raw is uncorrected.

There are also some ports which have bug where using the set_zoom function causes the jpeg to not have the normal distortion correction applied. In this case, we may be able to fix the bug, or you can use repeated clicks of zoom_in and zoom_out to set the zoom.
Title: Re: Multi-camera setup project.
Post by: mphx on 29 / September / 2014, 03:03:52

It's not clear what you mean. Are you saying the jpeg has distortion but the raw doesn't? Usually, it's the other way around, the camera applies distortion correction to the jpeg, while the raw is uncorrected.

There are also some ports which have bug where using the set_zoom function causes the jpeg to not have the normal distortion correction applied. In this case, we may be able to fix the bug, or you can use repeated clicks of zoom_in and zoom_out to set the zoom.

Unfortunately i was not present at these tests.My friend told me these things.He tried to shoot with zoom and there was a result with the "fish eye" effect as he said.He tried with raw on (from the chdk menu) and the result was correct.
So he is thinking about having raw mode ON at all times (with the use of buttons) .But this rises the problem of downloading.Jpeg is like 4mb and dng is like 25mb.
So he will download jpeg files to show to the clients when they shoot and he will download the dng files when the client is gone , because the result is overall better with the dng files.
I will go over the studio today to see the images and the "distortion" and will post again later today.
Title: Re: Multi-camera setup project.
Post by: mphx on 29 / September / 2014, 14:46:19
I was at studio today.There is a distortion at photos with zoom. straight things appear bent.The same distortion in dng format is way less.

We are thinking to play with both formats.Jpeg for rough tests and to show some quick results to the clients and dng format for the actual work.Dng format offers some things jpeg doesnt.We can do some fast corrections with photoshop , things we can't do with jpegs.
So with few minutes work with photoshop we can gain hours in modelling and rest 3d work afterwards.

Cameras are extremely stable all day long and we are now taking demo photos of ourselves :) to make demo miniatures to display in ads , sites and in studio :)
Title: Re: Multi-camera setup project.
Post by: reyalp on 30 / September / 2014, 23:14:43
I was at studio today.There is a distortion at photos with zoom. straight things appear bent.The same distortion in dng format is way less.
The only way I can see this happening is if the camera firmware is incorrectly applying the distortion correction. This could happen if the part of the firmware that does the correction thinks it's at a different zoom level.

Are you using the set_zoom function to change the zoom?

Do you still get the same effect if you use key press functions, like click('zoom_in') ?

If you shoot without zooming in, is the DNG more or less distorted than the jpeg?

Of course, if DNG works for you then you can certainly use it, but looking into the root cause might save you trouble elsewhere.
Title: Re: Multi-camera setup project.
Post by: mphx on 01 / October / 2014, 10:36:40

The only way I can see this happening is if the camera firmware is incorrectly applying the distortion correction. This could happen if the part of the firmware that does the correction thinks it's at a different zoom level.

Are you using the set_zoom function to change the zoom?

Do you still get the same effect if you use key press functions, like click('zoom_in') ?

If you shoot without zooming in, is the DNG more or less distorted than the jpeg?

Of course, if DNG works for you then you can certainly use it, but looking into the root cause might save you trouble elsewhere.

Here we go ,

1.Yes , my button uses the set_zoom function.With this case jpeg is alot distorted and dng a bit less.
2.My friend did a test.He used the zoom in/out buttons in the gui and the JPEG was flawless.DNG was not tested.
3.Without any zoom .. dng is distorted and jpeg is flawless.

Maybe set_zoom function has issues?:)
Title: Re: Multi-camera setup project.
Post by: reyalp on 01 / October / 2014, 23:29:30
Maybe set_zoom function has issues?:)
What version of CHDK are you using? According to the SVN log, an issue like this was fixed in CHDK 1.3 rev 3586 for A2500.
Title: Re: Multi-camera setup project.
Post by: mphx on 02 / October / 2014, 04:23:57

What version of CHDK are you using? According to the SVN log, an issue like this was fixed in CHDK 1.3 rev 3586 for A2500.


So true , i am several versions behind. So remind me again how updating of chdk works.I download the "small" package and i replace some specific files ?Which ones.
And how can i do it for 64 cameras .Any chance for some multi-upload function ? :)
Title: Re: Multi-camera setup project.
Post by: reyalp on 02 / October / 2014, 22:12:50
So true , i am several versions behind. So remind me again how updating of chdk works.I download the "small" package and i replace some specific files ?Which ones.
Upload the complete contents of the small package to each camera. Strictly speaking you don't need the .txt files, and you don't need PS.FI2 if you are going to use "firm update" loading.
Quote
And how can i do it for 64 cameras .Any chance for some multi-upload function ? :)
http://chdk.setepontos.com/index.php?topic=11667.msg115482#msg115482 (http://chdk.setepontos.com/index.php?topic=11667.msg115482#msg115482) still applies

Assuming you've extracted the zip into c:/path/to/update, and have loaded multicam and connected to all the cameras you want to update, something like the following ought to work:
Code: [Select]
savecon=con
for lcon in mc:icams() do
 con=lcon
 cli:print_status(cli:execute('mup c:/path/to/update A/'))
end
con=savecon

If the multicam script is already running (mc:start() has already been called) you will need to call mc:cmd('exit') first, followed by a small wait.
Title: Re: Multi-camera setup project.
Post by: mphx on 03 / October / 2014, 03:06:27

http://chdk.setepontos.com/index.php?topic=11667.msg115482#msg115482 (http://chdk.setepontos.com/index.php?topic=11667.msg115482#msg115482) still applies

Assuming you've extracted the zip into c:/path/to/update, and have loaded multicam and connected to all the cameras you want to update, something like the following ought to work:
Code: [Select]
savecon=con
for lcon in mc:icams() do
 con=lcon
 cli:print_status(cli:execute('mup c:/path/to/update A/'))
end
con=savecon

If the multicam script is already running (mc:start() has already been called) you will need to call mc:cmd('exit') first, followed by a small wait.

Clear enough , BUT , i saved the code in a file with extension .lua , i used cli , to load multicam and connect to the cameras and executed the script.
Didn't work.And by that i mean , it wasn't executed.Some error in the script or it wasn't supposed to be ran like this.
Any ideas?
Title: Re: Multi-camera setup project.
Post by: reyalp on 03 / October / 2014, 23:23:33
Didn't work.And by that i mean , it wasn't executed.Some error in the script or it wasn't supposed to be ran like this.
Any ideas?
Without any output or other information, it would be very difficult for me to know. I did run pretty much the exact same code using an ! command.
Title: Re: Multi-camera setup project.
Post by: mphx on 04 / October / 2014, 05:19:08

Without any output or other information, it would be very difficult for me to know. I did run pretty much the exact same code using an ! command.

The error message was something like :

ERROR: compile failed:[string "mup.lua"]:1: syntax error near <eof>

where mup.lua is the script and the only thing changed is the path of the "update".

Thing is the same error is produced whether i change something in the script or empty it entirely.
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 04 / October / 2014, 11:28:30
If I haven't missed elsewhere...

Edit : If I have a few minutes later today,  I'll try to create a wiring diagram that shows all of this.
would still appreciate that.

Ok , i added some buttons for raw mode and for manipulating dng files apart from jpeg.I will put them in test tomorrow and will post the code for anyone that would like to do something similar.
yes please.
Title: Re: Multi-camera setup project.
Post by: reyalp on 04 / October / 2014, 14:45:51
Thing is the same error is produced whether i change something in the script or empty it entirely.
So it has nothing to do with code I posted.

How are you trying to execute the script?
I would suggest either !dofile'mup.lua'
or change your lua file to define a function and the use
!require'mup.lua' your_function()

Title: Re: Multi-camera setup project.
Post by: mphx on 04 / October / 2014, 16:00:21


How are you trying to execute the script?
I would suggest either !dofile'mup.lua'
or change your lua file to define a function and the use
!require'mup.lua' your_function()

chdkptp -i , to go to the console and then

Code: [Select]
exec mup.lua or

Code: [Select]
!mup.lua
no gui , no buttons , no nothing. And the lua file just includes your script.

I am missing something here , i feel it .
Title: Re: Multi-camera setup project.
Post by: reyalp on 04 / October / 2014, 16:30:34
I am missing something here , i feel it .
Yes. exec (AKA !) runs lua code not lua files. If you want to run a lua file, you need to use a lua function that executes the file, like the examples in my previous post.
Title: Re: Multi-camera setup project.
Post by: mphx on 05 / October / 2014, 17:59:11
Yes. exec (AKA !) runs lua code not lua files. If you want to run a lua file, you need to use a lua function that executes the file, like the examples in my previous post.

Yes , dofile seems to do the trick.Gonna try it in the following days.


Next problem that came up : ISO doesn't stay stable. i have set it up in the chdk menu in all cameras but we have noticed that in extreme lighting occasions iso changes from that pre-determined number.
We wil try to control it from the same button we control zoom/shutter speed with the appropriate command.

@andrew.stephens

I will get the lua files next time i will be at studio.I do some tests in my laptop at home but never sure if they work without having cameras to test them.
So i trust only the lua files in studio :)
Title: Re: Multi-camera setup project.
Post by: reyalp on 05 / October / 2014, 21:09:44
Next problem that came up : ISO doesn't stay stable. i have set it up in the chdk menu in all cameras but we have noticed that in extreme lighting occasions iso changes from that pre-determined number.
1) What is the ISO mode set in the canon firmware?
2) What *specific* chdk settings are you using.
3) How are you determining that the ISO has changed?
4) What does "extreme lighting" mean?

If you just want a fixed ISO value, I'd suggest setting it in the canon firmware rather than in the CHDK menu. I realize this is fairly annoying with a large number of cameras, but doing it in the canon menu shouldn't be more so than the CHDK menu.

If you want to adjust it per shot, then you probably want to send overrides in your shooting script.
Title: Re: Multi-camera setup project.
Post by: mphx on 06 / October / 2014, 03:41:59

1) What is the ISO mode set in the canon firmware?
2) What *specific* chdk settings are you using.
3) How are you determining that the ISO has changed?
4) What does "extreme lighting" mean?

If you just want a fixed ISO value, I'd suggest setting it in the canon firmware rather than in the CHDK menu. I realize this is fairly annoying with a large number of cameras, but doing it in the canon menu shouldn't be more so than the CHDK menu.

If you want to adjust it per shot, then you probably want to send overrides in your shooting script.

Here we go :)

1)Do you mean what is the by default iso value in the camera?I don't know.It changes according the conditions.

2)I don't get what you are asking here.Only thing i have set up in chdk menu is ISO VALUE , nothing else is changed there.

3)Right click the photo , settings , details and checking the info there.

4)By extreme lighting conditions means when camera has to lower or raise enough the brightness during shooting for some reason (e.g. we forget to close the curtain in the shooting area and low light spots are showing in the cameras and they have to raise brightness , or when a camera -usually at the lower positions - have the light bulb in their view...so they have to lower brightness).

In 99% if not 100% of cases we need a fixed iso value , but setting it up in the chdk menu as i said doesn't mean that it gets that value for sure.

When you say set it up in the canon firmware what exactly do you mean?If it means what i am imagining  , it won't be easy task.

Overriding through the shooting script guarantees that it will shoot with that value and cameras won't take initiatives of their own and change it ?
I don't mind iso to be set in every shoot through the script if it is a guaranteed way.

About that last , what's the command ? "set_iso_real"?or "set_iso_mode"?

And a last thing.We need to control white balance...what's the proper way?play with set_prop/get_prop or is there any more easy way?
Title: Re: Multi-camera setup project.
Post by: mphx on 06 / October / 2014, 08:38:59
@reyalp

a bit update about the script you posted for the mass-upload-update :)

First of all script needed a correction.

The command

Code: [Select]
cli:print_status(cli:execute('mup c:/path/to/update'))
to

Code: [Select]
cli:print_status(cli:execute('mup c:/path/to/update /'))
In few words target dir was added :)

We manage to transfer files to 2 cameras BUT there was an error when trying to copy files from CHDK/MODULES subfolder.

In few words only files in root dir of the update folder were copied and i had to take away the subfolder CHDK in order to be able to copy the root dir files.
When CHDK folder was present , the whole process stopped with an error.An error not at all helpful

"ERROR : General Error"

Cameras booted ok with the new version chdk and we are doing test shots as we speak to check if the zoom problem is gone.
My question is , are these files i didn't copy (CHDK/MODULES/*) necessary ?Or i can "forget" them at all?


EDIT

I copied all CHDK/MODULES/ files into a second folder (e.g. update2) and used something like

Code: [Select]
cli:print_status(cli:execute('mup C:/path/to/update2 CHDK/MODULES/'))
and managed to copy those files too.

So i have to use the same script twice and copy the files in 2 seperate folders in order to get everything copied.

The 2 cameras with the new version (3636) shutdown randomly when we "play" with the zoom (aflock-1 , zoom , aflock-0)...while another camera with older version of chdk works fine.
Title: Re: Multi-camera setup project.
Post by: reyalp on 06 / October / 2014, 23:33:09
1)Do you mean what is the by default iso value in the camera?I don't know.It changes according the conditions.
So ISO is set to auto in the func menu? Every powershot I know of allows you to set the ISO manually in P mode.

Quote
2)I don't get what you are asking here.Only thing i have set up in chdk menu is ISO VALUE , nothing else is changed there.
At a minimum, you'd need to make sure "disable overrides on startup" isn't checked, and the box next to "override ISO" is checked.

Quote
3)Right click the photo , settings , details and checking the info there.
When using CHDK overrides, it's not always safe to assume the exif reflects what the camera actually did. If in doubt, you should hold the shutter speed constant and examine the actual images. That said, I suspect in your case the override simply isn't active at all.

Quote
When you say set it up in the canon firmware what exactly do you mean?If it means what i am imagining  , it won't be easy task.
I meant setting it in the menu of each camera. It would not be fun, but it should be saved between reboots and give you exactly the setting you set.

Quote
Overriding through the shooting script guarantees that it will shoot with that value and cameras won't take initiatives of their own and change it ?
Nothing in chdk is guaranteed ;)

If ISO overrides work correctly in the port you are using, then script overrides and menu overrides should both work. You can also set menu overrides from script using set_config_value.

Quote
About that last , what's the command ? "set_iso_real"?or "set_iso_mode"?
See the links available from
http://chdk.wikia.com/wiki/CHDK_Scripting_Cross_Reference_Page (http://chdk.wikia.com/wiki/CHDK_Scripting_Cross_Reference_Page)

Both of those can be used to set ISO. You can also use set set_sv96.

If you are happy using ISO settings allowed by the canon firmware (e.g. 100, 200 etc) you may find set_iso_mode most convenient.

Otherwise, you need to be aware that there are actually two different ISO systems used on the camera "real" and "market" values. The "market" values are the ones accepted by the UI, while set_iso_real and set_sv96 take "real" value. There are functions in CHDK 1.3 to perform conversions between the two, see the "APEX96 Conversion" section of the scripting cross reference.

Quote
And a last thing.We need to control white balance...what's the proper way?play with set_prop/get_prop or is there any more easy way?
Do you need to set white balance mode (like daylight, tungsten etc), or specific custom values?

For the first case, you may be able to do it with set_prop. You should test with one camera to verify that this actually works, in some cases setting a propcase value just changes the value without affecting the behavior of the camera. Failing that, you can set it in the canon menu, or perhaps using http://chdk.wikia.com/wiki/User:Srsa_4c/UI_properties (http://chdk.wikia.com/wiki/User:Srsa_4c/UI_properties)

For the second case, there is currently no way to do it from CHDK.
Title: Re: Multi-camera setup project.
Post by: reyalp on 06 / October / 2014, 23:48:44
First of all script needed a correction.

The command

Code: [Select]
cli:print_status(cli:execute('mup c:/path/to/update'))
to

Code: [Select]
cli:print_status(cli:execute('mup c:/path/to/update /'))
In few words target dir was added :)
I don't know what you copied.  The code I posted in http://chdk.setepontos.com/index.php?topic=11667.msg117270#msg117270 (http://chdk.setepontos.com/index.php?topic=11667.msg117270#msg117270) includes the target directory, 'A/'

I did actually run it before posting.
Quote
In few words only files in root dir of the update folder were copied and i had to take away the subfolder CHDK in order to be able to copy the root dir files.
The code I posted correctly uploads the source directory and all it's sub-directories. I don't know what caused your "general error", it might happen if you have files or directory names in the tree that are not compatible with the camera file system.

Quote
My question is , are these files i didn't copy (CHDK/MODULES/*) necessary ?Or i can "forget" them at all?
You need them.

Quote
The 2 cameras with the new version (3636) shutdown randomly when we "play" with the zoom (aflock-1 , zoom , aflock-0)...while another camera with older version of chdk works fine.
I told you before the aflock zoom thing was suspect. Since the zoom code has changed, it's not surprising that it causes problems. You should check whether the aflock workaround is still required.
Title: Re: Multi-camera setup project.
Post by: mphx on 07 / October / 2014, 05:42:29
@reyalp

First of all my bad about the script.I didn't see the "A/".I was pretty sure i copied/paste your code...anyway...

Code works just fine.

Aboot the zoom now.Patch fixes distortion by a bit ...not entirely.
In low zoom steps is less distortion than in high zoom steps.
And you were right...aflock is not needed anymore.

About iso and white balance i will come back later with these issues :)
Title: Re: Multi-camera setup project.
Post by: mphx on 07 / October / 2014, 15:25:05
Daily update :)

Chapter 1.

CHDK update


CHDK update went smoothly after some hiccups thanks to reyalp's code.We did this update to fix the set_zoom issue in the cameras.(see chapter 2)

Chapter2.

The...ZOOM.

I cant write alot of technical stuff some of them i don't really understand but i will refer only some facts.

Fact #1

Canon A2500 suck.Big time.Noise in the photos is pathetic.We did a test.3 cameras shooting the same thing in daylight conditions.
A canon dslr camera , a canon A2500 compact camera and galaxy s4 , my phone.

Dslr result was nearly perfect..minimum to none noise, expected.galaxy s4 , second place , minimum noise and last position belongs to A2500...pa-the-tic.

Fact #2

Because of fact #1 , in order to get the best result out of A2500s , and by best result i mean best 3d modelling/processing result , we need to shoot with some zoom.
I dont want to go into technicalities but its either buying more A2500s (no money for that) , throw away A2500s and get same number of dslr (guess what , no money for that either) , use specific clothes on people that getting shot (a bit weird to ask such thing from the clients), or SHOOT WITH A BIT ZOOM.

That's why we got into the thing of updating chdk in the cameras in order to "fix" the zoom thing.
But it got fixed partially..if you zoom a little bit , distortion is little...if you zoom more , distortion is more.
More distortion = more screwed up models produced = no go.

So pending problems (for getting better results otherwise MANY conditions must be met in order to get a good result) are :

1. Zoom distortion.
2.ISO (in an effort to reduce noise). In chdk menu "disable overrides in startup" is unchecked and iso override is checked.But as i said in previous post iso is sometimes different in some photos.Trying to control it with script/command pending.
3.White balance. We need the same light conditions in all photos.That's not happening.Some photos are dark , some lighter , some normal , according the light conditions its camera is facing...We need fixed ISO , fixed shutter speed (we have that) and fixed white balance.




Title: Re: Multi-camera setup project.
Post by: srsa_4c on 07 / October / 2014, 16:17:18
But it got fixed partially..if you zoom a little bit , distortion is little...if you zoom more , distortion is more.
Are you saying that you still get distorted JPEGs at the tele end of zoom? Here (http://chdk.setepontos.com/index.php?topic=10626.msg115958#msg115958)'s a user that claims otherwise. The changes mentioned in the linked post are now part of the CHDK 1.3 release for the a2500.
Can you compare JPEGs made
- after zooming with set_zoom
- after zooming manually
?

Quote
2.ISO (in an effort to reduce noise). In chdk menu "disable overrides in startup" is unchecked and iso override is checked.But as i said in previous post iso is sometimes different in some photos.
Please check the camera's Rec menu (the Canon menu in record mode) whether "servo AF" is enabled. If it's enabled, disable it.
Quote
3.White balance. We need (...) fixed white balance.
There is currently no way to set a fixed white balance with CHDK, the only way to do it is to use the Canon shooting menu with simulated keypresses. Note that the camera will still (more or less depending on the preset) continuously adjust white balance, unless you set a custom white balance.
Title: Re: Multi-camera setup project.
Post by: mphx on 07 / October / 2014, 17:57:45
Are you saying that you still get distorted JPEGs at the tele end of zoom? Here (http://chdk.setepontos.com/index.php?topic=10626.msg115958#msg115958)'s a user that claims otherwise. The changes mentioned in the linked post are now part of the CHDK 1.3 release for the a2500.
Can you compare JPEGs made
- after zooming with set_zoom
- after zooming manually
?


I am saying that 2 people (me and my friend ) see distorted jpeg and cameras running the latest up-to-date chdk version (meaning the "fix" is applied).

We tested jpeg and dng formats.Dng format shows less distortion than jpeg BUT dng photos are like ~ 20mb in size.
Every dng file needs like around 10secs to get downloaded. 64cameras = 64 photos = 640secs to download ONE set of photos. That's around 10mins.

So we forget dng.

Let's talk about jpeg now.If i throw little numbers in set_zoom , and by little numbers i mean up to 10-15 , distortion is handled.If we throw numbers from 20 and up , distortion is NOT handled.
3d modelling program is confused and cant produce correct model.

We did several tests today.The golden number for us is zoom = 20 . At that point distortion can't be handled unfortunately.

And since we have 64 cameras to handle(=zoom in/out) i seriously don't care what is the behavior with manually zooming :)

Only light in the tunnel is a setting we found in 3d modelling program about "calibrating" cameras by using some pattern and distortion correction algorithms..a bit complicating procedure and a bit cheap way to solve the problem.

I will check the thing you mentioned about iso and cameras menu as soon as i am back at studio.
About "setting custom white balance"..how do you mean it?How can been done?

Thanks for your input.
Title: Re: Multi-camera setup project.
Post by: reyalp on 07 / October / 2014, 23:34:17
Canon A2500 suck.
It is a bottom of the line P&S, so this shouldn't be a huge surprise.
Quote
Big time.Noise in the photos is pathetic.We did a test.3 cameras shooting the same thing in daylight conditions.
A canon dslr camera , a canon A2500 compact camera and galaxy s4 , my phone.

Dslr result was nearly perfect..minimum to none noise, expected.galaxy s4 , second place , minimum noise and last position belongs to A2500...pa-the-tic.
I'm not surprised the A2500 sucks, but I am somewhat surprised it is much worse than the S4. Can you upload the sample shots somewhere?

Quote
That's why we got into the thing of updating chdk in the cameras in order to "fix" the zoom thing.
But it got fixed partially..if you zoom a little bit , distortion is little...if you zoom more , distortion is more.
More distortion = more screwed up models produced = no go.
Can you verify whether or not the same distortion appears if you zoom using the physical zoom controls (or simulated key clicks)?
For example:
set_zoom(20)
shoot
reboot the camera
click the zoom key until zoom reaches 20 (you can display zoom level in OSD)
shoot the same scene
compare the pictures
This will tell us whether CHDK is messing up the distortion correction, or it's just how the canon firmware deals with it.

It's also worth noting that image processing programs can do the same kind of software distortion correction that the camera does. This is normally done with raw, but it should be possible to do with jpegs as well.
Title: Re: Multi-camera setup project.
Post by: mphx on 08 / October / 2014, 05:09:34
@reyalp

Let's see...

1.With manual zoom , there is no distortion.

2.Here is the samples you asked :)

DSLR --> https://www.dropbox.com/s/7cwwfdqyjichvqp/DSLR.JPG?dl=0 (https://www.dropbox.com/s/7cwwfdqyjichvqp/DSLR.JPG?dl=0)
A2500 --> https://www.dropbox.com/s/2wr3nq3r1zoo3x0/A2500.JPG?dl=0 (https://www.dropbox.com/s/2wr3nq3r1zoo3x0/A2500.JPG?dl=0)
S4  -->  https://www.dropbox.com/s/wex6zk2c8tchuhg/20141007_130626.jpg?dl=0 (https://www.dropbox.com/s/wex6zk2c8tchuhg/20141007_130626.jpg?dl=0)

Download them , and zoom in at the wall at the right side of that green window in the building...the difference in noise is clear there..

All these problems can be solved with cheap ways... we can correct distortion and lighting issues with photoshop lets say...as far as the corrections/fixes are similar to ALL 64 photos and can be applied in short time.
Otherwise it will get a lot of time and it's useless since there is already more 3d work to be done for every shot...
Title: Re: Multi-camera setup project.
Post by: reyalp on 08 / October / 2014, 22:55:01
1.With manual zoom , there is no distortion.
Again sample images would be interesting.

Quote
Download them , and zoom in at the wall at the right side of that green window in the building...the difference in noise is clear there..
Agree the S4 is less noisy, and sharper over all. The A2500 isn't quite at minimum ISO, but its very unlikely that will make up the difference.
Title: Re: Multi-camera setup project.
Post by: mphx on 09 / October / 2014, 05:37:02

Again sample images would be interesting.


I don't know if we have the samples saved.I'll check.


Quote
Agree the S4 is less noisy, and sharper over all. The A2500 isn't quite at minimum ISO, but its very unlikely that will make up the difference.

As i see the A2500 sample is at iso-125.I think the minimum is iso-100 , so yes it won't make any big difference.

We tried to take a photo with the cameras in daylight conditions to see if the noise we see in the studio is result of the lighting conditions there.If there was minimum noise in daylight we would throw more lights in the studio.
But as you can see , it's just a matter of low quality camera :)
Title: Re: Multi-camera setup project.
Post by: msl on 09 / October / 2014, 07:00:17
With F8.0 (A2500) you get a lower depth of field than with F2.2 (S4). There is also a difference with the ISO values, A2500 => ISO 125 and S4 => ISO50.

Use the same conditions with both devices and compare the images, preferably as raw files.

msl
Title: Re: Multi-camera setup project.
Post by: mphx on 09 / October / 2014, 07:59:46
With F8.0 (A2500) you get a lower depth of field than with F2.2 (S4). There is also a difference with the ISO values, A2500 => ISO 125 and S4 => ISO50.

Use the same conditions with both devices and compare the images, preferably as raw files.

msl

The whole point of the "experiment" wasn't to compare results with dslr or s4.We wanted to see if the noise is reducing with brighter scenes (daylight conditions).And as you can see , noise is still in high levels.
Title: Re: Multi-camera setup project.
Post by: waterwingz on 09 / October / 2014, 08:55:42
With F8.0 (A2500) you get a lower depth of field than with F2.2 (S4).
Isn't that the other way around?  Although on those little lenses, F8 might be approaching the diffraction limit?
Title: Re: Multi-camera setup project.
Post by: msl on 09 / October / 2014, 09:25:54
Isn't that the other way around?
Yes, you're right. I meant the hyperfocal distance. Regardless of this  the test should be performed with the same settings.

F8.0 is difficult for the A2500 with the small sensor.

msl
Title: Re: Multi-camera setup project.
Post by: waterwingz on 09 / October / 2014, 10:08:41
I assume the A2500 does not have an adjustable aperture so the f8.0 setting is either at the end of the zoom range or the ND filter has kicked in?
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 10 / October / 2014, 08:43:41
The whole point of the "experiment" wasn't to compare results with dslr or s4.We wanted to see if the noise is reducing with brighter scenes (daylight conditions).And as you can see , noise is still in high levels.

Don't want to hold you up mphx.

You & reyalp (and a few others) are doing a fantastic job - a genuine workable point&shoot multicam production system seems to have been born...so this is probably more for my own future record.

Maybe flash is the way to go?

I posted the following here: http://www.dreamingrobots.com/forums/viewtopic.php?f=8&t=2223&p=10855#p10849 (http://www.dreamingrobots.com/forums/viewtopic.php?f=8&t=2223&p=10855#p10849)

"Hi Maurice & folks,

I'd, maybe, like to implement a system as follows:

(i) Arduino Leonardo mouse control to initiate (via GUI or perhaps CLI) a chdkptp "shoot" command - this starts a "multicam.lua" sequence to trigger multiple point&shoot cams via ptp with, seemingly, "reasonably" high synchronisation between cams. You can see the idea in the video here:
https://www.youtube.com/watch?v=1Zt6RgxR8DI (https://www.youtube.com/watch?v=1Zt6RgxR8DI)

(ii) Subsequently use the same Leonardo to switch the room lights off with an opto-relay

and

(iii) Subsequently use the same Leonardo as a Camera-Axe sensor input to control multi-flash and perhaps trigger multi-dslr remote shutters - a hybrid.

I think i'll be able to scrape around to get (i) and (ii) done, but - can I do no. (iii) ? can you (or anyone else  ;) ) give a pointer ?

Thanks."

Maybe multicam.lua isn't quite ready for total "manual" settings? i've read this thread up to page 12 and a few of the more recent ones pages - but most seems complete.

Thanks again.

Edit: some flash duration info http://www.gock.net/2012/01/flash-durations-small-strobes/ (http://www.gock.net/2012/01/flash-durations-small-strobes/) via http://www.agisoft.com/forum/index.php?topic=2927.msg15524#msg15524 (http://www.agisoft.com/forum/index.php?topic=2927.msg15524#msg15524)
Title: Re: Multi-camera setup project.
Post by: mphx on 10 / October / 2014, 12:26:37
@andrew

First of all i am not doing anything :)

reyalp , waterwingz and the rest on this forum created/contributed everything...i am just taking "served food" and trying to make it work with my project :)

Quote
"Maybe flash is the way to go?"

We already have strong lights hitting the shooting area.."Daylight conditions" proved that they dont improve noise reduction and have in mind that walls in the shooting area are white.If we throw more lights in there...too much brightness will go to object and their color then will blend with the surroundings and will be hard to process afterwards.

We put tripods more close to the center of the shooting area and we will run some tests to see if things are getting any better...

*we had the first camera failing today..."lens error" but we came around that problem..we took out the protective plastic things of the lens..they were causing the problem somehow...all well now :P


About what you are describing for your project.

I really don't get what you are trying to do with that arduino mouse..control pc ? control lights? control dslr flashes?

How clicking something on your desktop , let's say a "shoot" button in chdkptp gui will trigger all the rest?

Do i miss something here ? probably about the arduino mouse mechanisms?
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 10 / October / 2014, 13:36:35
At the very least you have asked a lot of good questions and continued practical investigation in what, I think, is a pretty defining thread, and then reyalp etal...

...did/continues to make something that is generally useful for people working with multiple cameras   :)

I hope my observation that it mostly seems done doesn't put me off my struggle to know how this all really works - i'm finding that a great struggle but also a great general education and can recommend anyone to at least start that struggle, given time.

Syncing by flash is seen as an easy sync method by many in the 3d point cloud capture group, e.g:
http://www.agisoft.com/forum/index.php?topic=2927.msg15495#msg15495 (http://www.agisoft.com/forum/index.php?topic=2927.msg15495#msg15495)

You may wish to search for something like "Step by Step Guide to the Arduino Leonard"

Arduino Leonardo:


Title: Re: Multi-camera setup project.
Post by: reyalp on 10 / October / 2014, 22:49:43
1.With manual zoom , there is no distortion.
Coming back to this, it should be possible to work around use key presses, something like
Code: [Select]
!mc:cmdwait('call repeat click("zoom_in") until get_zoom() >= 10')

It will be somewhat slow on a camera like this with many zoom steps, but if you don't have to zoom through the whole range too often it shouldn't be a big deal. If you do, more complicated code could speed it up.

I used >= because it may be possible that the camera zooms more than one step per click. If this is true, you'll want to make sure it does it consistent ly, or add logic to make sure all the cameras end up at the same zoom.

Also note that (at least on the cameras I tested a long time ago), get_zoom doesn't update while the zoom is moving, so you cannot do something like
Code: [Select]
press('zoom_in')
repeat sleep(10) until get_zoom() == 10
release('zoom_in')

edit:
Of course, it would be great to fix thing so set_zoom doesn't mess up the distortion correction. I'm just offering this as a possible workaround.

edit #2:
On my elph130, I have found that the click method above can overshoot, e.g. if you try for get_zoom >= 50 you might get 54 instead. It isn't the same every time. If you click back and forth you can get it to end up on a specific value.

On that camera, I don't see a difference in distortion correction with set_zoom vs clicking, although there isn't a huge amount of distortion at the value (50) I was testing.

Strangely, there seems to be a slight difference in zoom level even when get_zoom() reports exactly the same value, with set_zoom being consistently wider.  This shows up in the DNG, so it's probably not related to the software correction.
Title: Re: Multi-camera setup project.
Post by: mphx on 15 / October / 2014, 14:33:15
@reyalp

I will "play" with the command and get back with feedback when i will have time...to test it :)

--

We got some miniatures today , although the guy who printed them didn't do the best job that could have done.
Although colors and surface is well done , he didn't "brush" the miniatures well , so many spots on them have a white-ish tone...

Here they are (few of them) --> https://www.dropbox.com/s/gov39ijjj9knsgk/20141015_162159.jpg?dl=0 (https://www.dropbox.com/s/gov39ijjj9knsgk/20141015_162159.jpg?dl=0)

From a medium to long range they seem fine , but in close inspection you can see the flaws...

Lets hope he will do a better job in the next ones.
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 15 / October / 2014, 17:37:35
fan-tas-tic mphx:
reyalp (in particular) and much respect to waterwingz  - will always be the enabler(s)...[thank you guys over a long period]
mphx - you have the the 3D copy, κῦδος !
Title: Re: Multi-camera setup project.
Post by: yigit on 16 / October / 2014, 17:08:22
Great Work !

Thanks everybody for sharing.
Waiting more results pictures:)
Title: Re: Multi-camera setup project.
Post by: mphx on 17 / October / 2014, 05:37:25
@yigit

I can't really publish the rest of the miniatures , since they represent some clients and they won't like their faces on the internet BUT..i can show you a 3d model ..of a girl...she is a pro model , we got her and another guy to pose and get some miniatures for ads and for the site...

For your eyes only people... https://p3d.in/rgRUw
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 17 / October / 2014, 14:18:42
Just noticed this "3D Pandoras(s)?" referred to on the Agisoft site http://www.3dpandoras.com/#section03 (http://www.3dpandoras.com/#section03)

Edit: Oh, and a placeholder for my memory:

http://www.agisoft.com/forum/index.php?topic=2654.msg14413#msg14413 (http://www.agisoft.com/forum/index.php?topic=2654.msg14413#msg14413)

"...Also very important, try to go away from auto focus. It is not as important in a constant light situation as yours compared to the flashes but still you can get a few cameras that didn't focus correctly on each session and you will loose important info for the PS process.
You should get someone with nice easy to focus clothes (jeans for example) in the center of the shooting  and manually (or automatically) focus all the cameras. When you are sure all of them are well focused (you should zoom in at least 200% to verify) then you turn them to manual focus and leave them that way."

Title: Re: Multi-camera setup project.
Post by: mphx on 18 / October / 2014, 09:10:47
Just noticed this "3D Pandoras(s)?" referred to on the Agisoft site http://www.3dpandoras.com/#section03 (http://www.3dpandoras.com/#section03)

Edit: Oh, and a placeholder for my memory:

http://www.agisoft.com/forum/index.php?topic=2654.msg14413#msg14413 (http://www.agisoft.com/forum/index.php?topic=2654.msg14413#msg14413)

"...Also very important, try to go away from auto focus. It is not as important in a constant light situation as yours compared to the flashes but still you can get a few cameras that didn't focus correctly on each session and you will loose important info for the PS process.
You should get someone with nice easy to focus clothes (jeans for example) in the center of the shooting  and manually (or automatically) focus all the cameras. When you are sure all of them are well focused (you should zoom in at least 200% to verify) then you turn them to manual focus and leave them that way."


We have all cameras in auto focus.If you setup the center of their view in the position you want..they will focus there....in the center.No need to trouble yourself with focus.We never had blurred photos...using auto focus i mean..they all focus in the center of their view..so its all about correctly positioning the cameras...
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 18 / October / 2014, 17:38:02
Thanks for comment mphx.

As I said, my comment is more a placeholder for when I get around to my own build in which i'd like to capture from darkroom blackroom using flash. I don't wish to disrupt  the "flow" of your thread but I still have too much to learn before starting my own.

I'd only dabbled in all of this this for a short time when the machine I used for chdkptp died - that is still the case - so most of what I say is not based in testing and a lot may be mere speculation. Until I realised the potential of photogrammetry for 3D  I had practically no interest in 2D photography (& still haven't).

Anyway, what i'm currently thinking is for canon point & shoot cams that natively support MANUAL setting capacity for focus / zoom / aperture:

(i) First thing each morning, in studio ambient light conditions, run a multicam.lua type routine [function] that, uniquely for each camera, sets focus / zoom / ambient aperture / ambient shutter period based on a PC  located "Ambient Light Condition Table(s)"[see later for that Table(s) description] - that script finshes with "exit-ALT" (does that even exist?) so that manual, per camera, settings (focus/zoom) can be "tweaked" (i.e. physically on each camera).

(ii) Now, with the "Tailors dummy" in the centre of the rig  (or a much bigger or smaller one, depending on that day's "chosen" clientele list), each camera is focused (tweaked) in the manner described as at post #238:
http://chdk.setepontos.com/index.php?topic=11667.msg117574#msg117574 (http://chdk.setepontos.com/index.php?topic=11667.msg117574#msg117574)

(iii) Now, another multicam.lua type routine is run. It's purpose is to GET the most recent (tweaked) focus/zoom values from each camera and to overwrite the values (for each camera) stored, on the PC, in the "Ambient Light Condition Table(s)" file(s) )

(iv) Now, another multicam.lua type routine is run. It's purpose is to OVERWRITE these most recent (tweaked) focus/zoom values (from each camera) into a separate "Flash Light Condition Table(s)" PC based file(s) [the aperture for flash condition & shutter speed for flash condition values having been pre-determined are not overwritten].

(v) Now,
(a)
another multicam.lua type routine is run. It's purpose is to SET the ambient focus/ ambient zoom/ [flash] aperture/ [flash] shutter speed values (for each camera) from the Table(s) stored on the PC at point (iv). 
(b)
another multicam.lua type routine [function] is run. It's purpose is to:

Make sense? don't ask me to repeat, i've had my first 4 glasses (Saturday night after all)
Well, do please, somebody...anybody

PS:
This post was based on this post (no replies):
http://www.agisoft.com/forum/index.php?topic=2953.0 (http://www.agisoft.com/forum/index.php?topic=2953.0)

Edit:
Cross ref - this is what I must have been thinking about all along http://chdk.setepontos.com/index.php?topic=8769.msg106040#msg106040 (http://chdk.setepontos.com/index.php?topic=8769.msg106040#msg106040)
 
Title: Re: Multi-camera setup project.
Post by: mphx on 18 / October / 2014, 18:35:27
@andrew

ok i am not ashamed to admit it. I lost you at half way :)

You want to setup focus/zoom/aperture.

Easier way is by testing values.When you find the "correct" ones for every occasion then you create some buttons in the GUI.
Right before you press shoot , you press the button you want , values are issued and then you shoot.
You make a "reset button" that resets the values of focus/zoom/aperture and you are good to go.
Also you doesn't need to manually setup focus.Leave it to autofocus...it will adjust to any new zoom level you issue.
Easy things , nothing fancy...

If i got what you want to do..if i am not...pretend you didn't see my post :)
Title: Re: Multi-camera setup project.
Post by: waterwingz on 18 / October / 2014, 18:46:29
that script finshes with "exit-ALT" (does that even exist?)
link> exit_alt() (http://chdk.wikia.com/wiki/CHDK_scripting#exit_alt)
Title: Re: Multi-camera setup project.
Post by: mphx on 24 / October / 2014, 13:17:08
@reyalp

I am messing with a new laptop these days and installed a debian-based disto on it.
So i thought to install chdkptp on it.I have two questions (not important ones :P )

1.Any good and reliable svn update/sync program (with gui if possible) for syncing lua files ?
2.I created a launcher for the program ...is there any ico to put to it ? :)

PS : I didn't like at all that i had to "install" iup and cd libs "outside" the package manager mechanism...anyways :)

I will put it on test tomorrow..to see if the linux flavor is better or the same :)
Title: Re: Multi-camera setup project.
Post by: reyalp on 24 / October / 2014, 21:23:55
1.Any good and reliable svn update/sync program (with gui if possible) for syncing lua files ?
I tend to use command line svn, probably just called 'subversion' or maybe something like 'subversion-client' in your package manager. The last time a looked (not recently) there wasn't anything remotely comparable to tortoise.
Quote
2.I created a launcher for the program ...is there any ico to put to it ? :)
Not in any normal format. The one that appears on the program at run-time is in gui_icon.lua. msl made that, I'm not sure what the source file is. I'm sure you can find the chdk logo on the wiki.
Title: Re: Multi-camera setup project.
Post by: waterwingz on 24 / October / 2014, 21:35:10
The last time a looked (not recently) there wasn't anything remotely comparable to tortoise.

http://en.wikipedia.org/wiki/RabbitVCS (http://en.wikipedia.org/wiki/RabbitVCS)  ( from http://en.wikipedia.org/wiki/Comparison_of_Subversion_clients (http://en.wikipedia.org/wiki/Comparison_of_Subversion_clients) )

Just playing with it now on Fedora.  I'll likely stick to the command line but it seems to intergrate with the default Fedora file manager pretty much like TortoiseSVN on Windows.
Title: Re: Multi-camera setup project.
Post by: novsela on 25 / October / 2014, 15:47:05
Hi All

I am using 24 X Canon A2500 P&S for 360 deg Multi camera array (you are welcome to read my thread  http://chdk.setepontos.com/index.php?topic=11583.msg113396#msg113396 (http://chdk.setepontos.com/index.php?topic=11583.msg113396#msg113396))

I also found the issue of lens distortion caused by set_zoom (object get bend in the image / fish eye)
Attached here example of set_zoom distortion (i am not sure the specific value but i assume it is around zoom=20)
higher the zoom , higher distortion (fish eye)

I am running  a2500-100a-1.3.0-3492 version (I can see that there are newer ver with zoom fix)

According to latest message, new version solved only partially the issue while
Code: [Select]
!mc:cmdwait('call repeat click("zoom_in") until get_zoom() >= 10') (http://chdk.setepontos.com/index.php?topic=11667.msg117482#msg117482 (http://chdk.setepontos.com/index.php?topic=11667.msg117482#msg117482) ) should solve it.

mphx / reyalp, Can you confirm it solved the issue ? (second, Will it work on my FW version 1.3.0-3492)?
Title: Re: Multi-camera setup project.
Post by: waterwingz on 25 / October / 2014, 17:58:28
Attached here example of set_zoom distortion (i am not sure the specific value but i assume it is around zoom=20)
higher the zoom , higher distortion (fish eye)
I see the problem now!  Somebody bent the poles & bars that hold your cameras in place.  :lol
Title: Re: Multi-camera setup project.
Post by: mphx on 25 / October / 2014, 18:00:29
@novsela

unfortunately i didn't have the time to test that command.Since manually zooming doesn't create distortion there is a good chance that command would work well...

I will try to test it in the next days...

If anyone comes to greece , visit us :) http://www.its-you.gr (http://www.its-you.gr) .Friendly prices :)
Title: Re: Multi-camera setup project.
Post by: waterwingz on 25 / October / 2014, 18:10:36
If anyone comes to greece , visit us :) http://www.its-you.gr (http://www.its-you.gr) .Friendly prices :)
Very cool!
Title: Re: Multi-camera setup project.
Post by: reyalp on 25 / October / 2014, 18:16:48
mphx / reyalp, Can you confirm it solved the issue ? (second, Will it work on my FW version 1.3.0-3492)?
Using key clicks should be exactly equivalent to using the actual controls on the camera, so it should work if doing it manually on the camera gives correct results.

However, as I noted in the earlier posts, you will need to make sure all the cameras end up on the same zoom step. On elph130 at a least, this requires additional logic, because the number of steps it moves per click does not appear to be completely deterministic. It's possible that using levent functions would be more predictable.
Title: Re: Multi-camera setup project.
Post by: waterwingz on 25 / October / 2014, 18:21:32
However, as I noted in the earlier posts, you will need to make sure all the cameras end up on the same zoom step. On elph130 at a least, this requires additional logic, because the number of steps it moves per click does not appear to be completely deterministic. It's possible that using levent functions would be more predictable.
By "additional logic" I assume you mean a small script that handles the clicks and checks the zoom position and corrects where necessary?
Title: Re: Multi-camera setup project.
Post by: reyalp on 25 / October / 2014, 18:34:58
By "additional logic" I assume you mean a small script that handles the clicks and checks the zoom position and corrects where necessary?
Right, instead of
Code: [Select]
repeat click'zoom_in' until get_zoom() >= 50
something like
Code: [Select]
repeat
if get_zoom() < 50
click'zoom_in'
elseif get_zoom() > 50
click'zoom_out'
end
until get_zoom() == 50
(edit: the above code would try indefinitely, which may not be what you want...)

You might also want a sleep in there somewhere, I noticed that get_zoom() may change after the click completes, you end up with something like
Code: [Select]
con 28> =repeat click'zoom_out' until get_zoom() <= 20 return get_zoom()
29:return:20
con 29> =return get_zoom()
30:return:19
It's possible that having a sleep would also avoid the overshoot issue.

I suspect that the cameras that only have 5-10 zoom steps are less likely suffer from these issues.
Title: Re: Multi-camera setup project.
Post by: waterwingz on 25 / October / 2014, 18:56:59
Code: [Select]
repeat
if get_zoom() < 50
click'zoom_in'
elseif get_zoom() > 50
click'zoom_out'
end
until get_zoom() == 50
Is it worth doing :

Code: [Select]
press("zoom_in")
sleep(delay)
release("zoom_in")

where delay is a small value ?

edit : fixed typo pointed out by reyalp (below)
Title: Re: Multi-camera setup project.
Post by: reyalp on 25 / October / 2014, 20:31:46
Is it worth doing :

Code: [Select]
press("zoom_in")
sleep(delay)
release("zoom_out")

where delay is a small value ?
There is already some delay built into the press/release functions. I tried using just press'zoom_in' release'zoom_in' and it didn't seem to move less than click.

There is some variation in click delay between ports, so it might make a difference on some cams.

(probably a typo, but your zoom_in/zoom_out are mismatched above).
Title: Re: Multi-camera setup project.
Post by: reyalp on 25 / October / 2014, 21:05:17
I did some more testing with elph130. The zoom definitely keeps moving for a while after a click, and sending clicks to rapidly means that some are effectively ignored.

My test code was variants of
Code: [Select]
> =i=0 repeat click'zoom_in' i=i+1 z0=get_zoom() sleep(100) z1=get_zoom() until z1 >= 50 sleep(500) return i,z0,z1,get_zoom()
15:return:22
15:return:50
15:return:53
15:return:53

> =i=0 repeat click'zoom_in' i=i+1 z0=get_zoom() sleep(1000) z1=get_zoom() until z1 >= 50 sleep(500) return i,z0,z1,get_zoom()
24:return:11
24:return:49
24:return:52
24:return:52
Note the number of iterations drops by half with the longer sleep between clicks.

I also tried using post_levent_to_ui, which wasn't obviously more consistent.
Code: [Select]
=i=0 repeat post_levent_to_ui('PressTeleButton') sleep(50) post_levent_to_ui('UnpressTeleButton') i=i+1 z0=get_zoom() sleep(250) z1=get_zoom() until z1 >= 50 sleep(500) return i,z0,z1,get_zoom()
43:return:12
43:return:52
43:return:54
43:return:54
Title: Re: Multi-camera setup project.
Post by: novsela on 26 / October / 2014, 03:57:00
Please check this info on other thread

http://chdk.setepontos.com/index.php?topic=10626.msg115862#msg115862 (http://chdk.setepontos.com/index.php?topic=10626.msg115862#msg115862)


http://chdk.setepontos.com/index.php?topic=10626.150 (http://chdk.setepontos.com/index.php?topic=10626.150)
Title: Re: Multi-camera setup project.
Post by: mphx on 13 / November / 2014, 10:25:50
Clients are starting to come...mostly because we went live on air yesterday :)

A magazine did an article about us , and since then we get TV offers from various tv channels :)

One live yesterday , one tomorrow , one at Saturday and one next week...and we don't know what else will follow :)

We are evolving into TV personas :)

PS: i can link you the footage from yesterday's live if you like people , but its a greek tv show and i don't know if you will understand anything :)
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 13 / November / 2014, 14:25:51
Great stuff mphx - this  :xmas will be better than last !

Edit:
PS: i can link you the footage from yesterday's live if you like people , but its a greek tv show and i don't know if you will understand anything :)
Please do (i'd love to see it at least: "Leonidas (the return, value)"  :D - maybe reyalp, WW (if they started to charge) & you could buy the Hellenic Republic shortly, or Santorini https://www.youtube.com/watch?v=hVkA7G33EGk (https://www.youtube.com/watch?v=hVkA7G33EGk) at least (that'd do)!!).

Other

Until today I had been thinking that programmatic ptp synch is now the way to go (and maybe it is based on mphx's latest post) - especially if tight synch is not an absolute requirement because of shooting in a black room using flash. However, it just struck me that multicam.lua (or the logic of parts of it) has been developed to a state which means the following quote may no longer be such a big deal - with respect to loss of ptp comms at a point in a usbremote enabled process which I describe, or perhaps re-describe, in more detail below:

If you want to use CHDK's USB remote "sync" feature,  you need to be able to disconnect the 5V "red" wire to all 80 cameras at exactly the same time.  If you don't want to lose USB communications, then you can't simply turn off the power to all the hubs (even supposing that causes the individual cameras to all see the power go off at exactly the same time).

If you can make reyalp's calibrated sync shooting mode in multicam.lua work acceptably then you are spared the pain of trying to switch the hubs.   Note that your earlier tests on two cameras don't tell you what will happen with 80 cameras - the sync error is not 80x(two camera sync error).   It might actually be okay for your application.
 

...i.e. maybe it no longer necessarily matters to workflow if ptp comms is lost at a point in the following sequence of steps:

USBREMOTE process

i.e with


then:

in the morning, when power is first applied via a single (mains power) switch to the hubs (&all Camera 5V USB line), wait for the 10 (or 20 seconds?) Remote Onepush timeout to occur - no shot.

then:

START:

for cameras with full "M"anual control (SX150IS - Mode Dial set to "M"), run some multicam type code to:
(i) capmode change to AUTO Mode (ii) set zoom & (iii) autofcus & then (iv) capmode change to Manual Mode and  Manual Focus (v) & finally stop any long running chdkptp initiated camera script

then:
if necessary, physically tweak focus on cameras.

then:
run some multicam type code to:
set Canon (i) shutter period (ii) aperture for correct upcoming blackroom/flash shoot exposure (iii) & finally stop any long running chdkptp initiated camera script

then:
physically disconnect the usb network connection between workstation & first powered hub --> PTP comms lost here – but no script running on camera anyway
turn off single mains switch power to hub network -->  (but no impact to camera settings – correct? since cameras in Manual mode & MF & the prior One Push remote timed out)

then:
turn on single mains switch power to hub network (shoot-half) --> but cameras have zero focus/exposure work to do(or, at least, very little work to do?)

then:
within 10 (or 20 secs?) - but preferably near instantly so not to annoy subject pose -  turn off single mains switch power to hub network (shoot-full)...also interface from the usb mains power switch the switch to turn-off room lighting / setup flash at this point (can tweek USB remote delay to fit in with this)

then:
physically connect the final usb network connection between workstation & first powered hub, turn on single mains switch power to hub network, wait 10 (or 20 seconds?) for OnePush timeout period to expire

then:
run multicam type script in order to download last image / cleanup

then goto
START

Apologies for the slightly long winded description - does the flow seem, 5V decay voltage uncertainties aside, like a possible way round "last leg" 5V switch building / programmatic ptp uncertainties ?

If this approach is feasible, perhaps "Hardware-Hackers" hacked hubs could ease the voltage decay issue? 

Or perhaps it is just a lot more hassle than switching out the last leg of the 5V with relays or  programmatic ptp shooting  ::)

All that aside,

I just downloaded a 1.3 chdk from http://mighty-hoernsche.de/trunk/ (http://mighty-hoernsche.de/trunk/) (sx150is-100a-1.3.0-3721-full) and used the multicam code in this present thread to upgrade my old, locally built, chdk i.e no kbd.c hack (SD card reader in laptop died  :( ).

Problem is, with Remote Enabled / OnePush / Synch Enabled the camera acts exactly like this:


There is one thing I don't get:
"If the Enable Sync option is set in CHDK then each camera will wait for the final transition of the USB signal ( 5V to 0V )."
It seems just to be the opposite, with Sync enabled my camera takes a shot immediately when it gets 5V on the usb port and as reslult the camera's are not in sync. (elph300hs, one push, normal control mode)

With sync disabled** it works as I would like it takes the shot as soon as the 5v is switched off, just like the inverted remote script.

**Tested  in M/ AUTO /P - even when 5V turned off after 60 secs

Any chance a kind guru could comment on or, even better, fix the "capt_seq.c", e.g. http://chdk.setepontos.com/index.php?topic=8810.msg92334#msg92334 (http://chdk.setepontos.com/index.php?topic=8810.msg92334#msg92334), if that is the problem ?

PS: if everything was sitting waiting for the shot, as described, in M mode (having got there through capmode) and in MF should the OnePush period (after reaching 5V) to attain "lock" be practically zero (since, in my mind, the camera doesn't need do much of anything) ?
Title: Re: Multi-camera setup project.
Post by: waterwingz on 13 / November / 2014, 17:23:21
Any chance a kind guru could comment on or, even better, fix the "capt_seq.c"
Whatever you are seeing, it is unrelated to the thread you linked.  The necessary code is in capt_seq.c for the SX150HS.
Title: Re: Multi-camera setup project.
Post by: mphx on 13 / November / 2014, 17:30:31
@andrew

and... santorini is overrated ...and not for sale last time i've checked :)

the footage for anyone that cares :) https://www.dropbox.com/s/1qk0t09tm8fll43/john_skai_part1-cropped.mp4?dl=0 (https://www.dropbox.com/s/1qk0t09tm8fll43/john_skai_part1-cropped.mp4?dl=0)

feel free to yell "it's all greek to me" :)
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 13 / November / 2014, 17:58:58
Whatever you are seeing, it is unrelated to the thread you linked.  The necessary code is in capt_seq.c for the SX150HS.

WW - you may notice the "e.g"  I stated before the link ?

The issue is, I suspect, an example of the same problem on a different camera !


Edit:
Cross reference to here http://chdk.setepontos.com/index.php?topic=8810.msg118513#msg118513 (http://chdk.setepontos.com/index.php?topic=8810.msg118513#msg118513)
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 13 / November / 2014, 18:06:00
@andrew

and... santorini is overrated ...and not for sale last time i've checked :)

the footage for anyone that cares :) https://www.dropbox.com/s/1qk0t09tm8fll43/john_skai_part1-cropped.mp4?dl=0 (https://www.dropbox.com/s/1qk0t09tm8fll43/john_skai_part1-cropped.mp4?dl=0)

feel free to yell "it's all greek to me" :)

No translation needed for the interviewers  :)

Edit: this should really go viral... especially since it's all Greek to me !
Title: Re: Multi-camera setup project.
Post by: rick on 23 / November / 2014, 01:45:15
I get the concept that "Default Running" means there is no script to run actually. But when this indicator is ON i have noticed that i cant run a script from pc to the camera let's say.
You can only run one script at a time on the camera. When chdkptp wants to run a script there cannot be one already running. I think that when it does run a script, it does not provide a script name to the camera so the "default script" name defaults in the CHDK code and that is what you are seeing.

Quote
At your last phrase "you won't need to worry at all about disconnecting and reconnecting". But with the "usb switch" method a disconnection occurs no matter what. At that point the two script won't lose "connectivity"?
When you used CHDKshell to build your own version using my simple patch, you bypassed that. The patch tricks the Canon PTP code into not seeing the disconnection (i.e. USB power going away) when you press the button. The PC also can't tell that the button was pressed so both the host script and the camera scripts keep running as if nothing has happened. That was the whole point of doing the patch in the first place - you could just use the stock build otherwise.

If I use bcamhost and bcamrem,should I build the special version for my A1200?
(current build info:CHDK 1.3.0 Revision:3726 a1200 100c GCC4.4.3)
If yes,could you tell me how to build the special version?
1.open CHDK GCC Compiler Shell v.3.44 trunk3661
2.choose A1200 100c option
3.click “Source Tool...”,then“Patch...”,select “shared_usb_v13.patch”
how to go on with the popup window (see 2.png)
4.Which options should I set in the “compile options...”

Another question,what is the mask script (novsela called it mask code,see 1.png)?
Thanks!
Title: Re: Multi-camera setup project.
Post by: waterwingz on 23 / November / 2014, 10:34:24
If I use bcamhost and bcamrem,should I build the special version for my A1200?
That should not be necessary (see below).
Quote
Another question,what is the mask script (novsela called it mask code,see 1.png)?
That post refers to a specially modified version of CHDK that allowed the concurrent use of USB "sync" and ptp communications on the same setup.  It was added to the autobuild some time ago and enabled on a few cameras (those that were tested with the patch and confirmed to work).   The A1200 is one of those cameras.
Title: Re: Multi-camera setup project.
Post by: rick on 23 / November / 2014, 10:57:57
Thank you so much!waterwingz
That's really  a good news to me :)

Then,I  could  go to the next work.
Is it possbile to add some commands ,such as“exec bc=require('bcamHost') bc:connect() bc:cmdwait('shoot')”, to CHDK PTP-- User Tab as a button just like what mphx did.
If it is possbile,could you give me an example?Thus I can learn from it to edit some other commands by myself.
Thanks!
Title: Re: Multi-camera setup project.
Post by: mphx on 23 / November / 2014, 11:45:06
Thank you so much!waterwingz
That's really  a good news to me :)

Then,I  could  go to the next work.
Is it possbile to add some commands ,such as“exec bc=require('bcamHost') bc:connect() bc:cmdwait('shoot')”, to CHDK PTP-- User Tab as a button just like what mphx did.
If it is possbile,could you give me an example?Thus I can learn from it to edit some other commands by myself.
Thanks!

First of all check your commands in the GUI's console to find the exact expression...
Then you can easily make a button to put your command in it.
You can use "user" tab and check gui_user.lua to see how buttons are made.Create one of your own and experiment.
It's not hard if you get familiar with the syntax.

You can create your own TAB in the GUI and put your commands in it although this requires some additions to  gui.lua file and the creation of a new lua file to hold your buttons.

In any case reyalp can be of more help or i can attach you some example files....although you'd better experiment yourself to learn things.
Title: Re: Multi-camera setup project.
Post by: rick on 28 / November / 2014, 00:05:08
With mphx‘s help,I edited some buttons of both multicam way and bcam way.
Now I can easily shoot and download images.
So I found out a old CRT and downloaded SyncTest011 to make a sync test.(see a.jpg)

I used two canon powershot A1200, set shutter speed to 1/200 sec , ISO 400 (at home night),F2.8.
The CRT is LG 775FT plus( vertical frequency 83Hz, horizontal frequency 66.4KHz, resolution 1024 x 768).
In multicam way, I used “preshoot” command which is better than shot “shoot” command.
In bcam way, I turned on the sync of each camera in the bcamrem script and shot through controlling the switch of central usb hub.
I just took ten shots in each way.

The result of multicam way:
Minimum Mis-Sync (ms):  4.80    Average Mis-Sync (ms): 12.35 (1/81 sec)
Maximum Mis-Sync (ms): 27.86   Average Deviation:       6.51
            
The result of bcam way:
Minimum Mis-Sync (ms):  0.05    Average Mis-Sync (ms):  0.54 (1/1852 sec)
Maximum Mis-Sync (ms):  2.94   Average Deviation:       0.52

The datasets and reports are as below.
https://drive.google.com/folderview?id=0B4hGaTy8v6W1amdxbDNyOHJ4UUE&usp=sharing

multicam way is more convenient.
bcam way is more stable and synchronous.

@mphx:You said the multicam way is enough for building 3D model,do you use faster shutter speed? Thus I think you must use brighter lights.

@ reyalp:Is it possible to improve the Synchronization of the multicam way?

@ waterwingz:Now I use three a1200s,I can shoot just by controlling the switch of the central usb hub to disconnect the USB 5V power without any modification(see b.jpg). Could I still use this method when using 40+ cameras?
Title: Re: Multi-camera setup project.
Post by: reyalp on 28 / November / 2014, 00:56:42
Very nice work :)
@ reyalp:Is it possible to improve the Synchronization of the multicam way?
I'm not sure which commands you used. To get the best sync you should
1) Use CHDK 1.3
2) init_sync
3) preshoot and wait for all cameras to be ready
4) ensure sync time is far enough in the future that the shoot command can be sent to all cameras.
5) shoot using the shoot_hook_sync command

If you post the exact code you used to shoot, I can probably tell you if anything is missing. The testshots function might be a useful example.

That said, ~30ms max deviation is about as good as I'd expect with the current code (and if you did enough tests I'd expect the occasional outliers to be even further off). The current system is fundamentally limited by the fact that the tick counter and sleep function only have 10ms precision at best. There is uncertainty in the initial PTP sync, and due to the whole process happening across several tasks.

In theory, using high precision timers (see http://chdk.setepontos.com/index.php?topic=11342.0 (http://chdk.setepontos.com/index.php?topic=11342.0)) and proper task synchronization objects (semaphores or eventflags) it would be possible to get substantially better sync over PTP. This would require non-trivial hacking in the core CHDK code, as well as in multicam. I suspect this could get into the <10ms range, and perhaps better.

Edit:
Some improvement should be possible just by implementing a < 10ms tick counter.

Note that another option on cameras that don't use AA batteries is to use the battery temp as the trigger instead of USB power.
Title: Re: Multi-camera setup project.
Post by: mphx on 28 / November / 2014, 04:22:41

@mphx:You said the multicam way is enough for building 3D model,do you use faster shutter speed? Thus I think you must use brighter lights.

Multicam sync times are enough for building 3d models.We have built enough so its a sure thing what i am saying :).
But we are talking about relatively motionless "objects"...i mean people taking a pose with minimum to none movement...like the poses we take when we get photographs...
If more movement is involved i believe that we will have problems :)

As far as sync times are concerned i haven't measured them.
I use the steps reyalp is mentioning (1,2,3,4,5 --see above post)
We use two buttons .. preshoot and shoot.
We issue the PRESHOOT command ....and we wait for the client to get his/her pose.And then we issue the SHOOT command.
We hear ONLY ONE sound...that in my world means almost perfect syncing :)

BUT we have noticed the following thing.If cameras are turned on for many hours..after a while ..they lose sync (although sync command is issued and in effect).And by "losing" i mean , with the same process i described above , we hear more than one SHOOT clicks when shoot command is issued.Maybe cameras' mechanisms getting warm or something..i don't know...

So we turn them on 1-2 hours before the shooting , so to be sure :)


Finally if you are thinking of making 3d models with the whole setup you are making , lets hope you have good 3d modelling skills , because the produced 3d model needs  A   L O T  O F   W  O R K  to become ready for printing or whatever...low quality of these canon series , don't produce the best images for 3d modelling...


PS: we have bright lights in the shooting area..we don't mess with shutter speed , only iso and zoom.Some photos are taken bright and few (2-3 out of 64) a bit darker...so maybe we should mess with shutter speed at some point..but we can handle the difference in light in those few photos in the 3d modelling procedure for the time being.
Title: Re: Multi-camera setup project.
Post by: rick on 28 / November / 2014, 11:16:20
Very nice work :)
@ reyalp:Is it possible to improve the Synchronization of the multicam way?
I'm not sure which commands you used. To get the best sync you should
1) Use CHDK 1.3
2) init_sync
3) preshoot and wait for all cameras to be ready
4) ensure sync time is far enough in the future that the shoot command can be sent to all cameras.
5) shoot using the shoot_hook_sync command

If you post the exact code you used to shoot, I can probably tell you if anything is missing. The testshots function might be a useful example.
I didn't run step2 init_sync. And I will replace shoot command with shoot_hook_sync command.
Do I need run step2 each shot or just sync one time before taking shots?
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 28 / November / 2014, 15:09:46
If more movement is involved i believe that we will have problems :)

...[]...

Finally if you are thinking of making 3d models with the whole setup you are making , lets hope you have good 3d modelling skills , because the produced 3d model needs  A   L O T  O F   W  O R K  to become ready for printing or whatever...low quality of these canon series , don't produce the best images for 3d modelling...
PS: we have bright lights in the shooting area..we don't mess with shutter speed , only iso and zoom.Some photos are taken bright and few (2-3 out of 64) a bit darker...so maybe we should mess with shutter speed at some point..but we can handle the difference in light in those few photos in the 3d modelling procedure for the time being.

Some related and hopefully useful info:

http://www.agisoft.com/forum/index.php?topic=1972.msg10520#msg10520 (http://www.agisoft.com/forum/index.php?topic=1972.msg10520#msg10520)
"Does the displacement noise come from movement of the person? jpg noise in the image? blurriness of photo? (I did not include images to analyze where the image was not perfectly sharp)"

=>

http://www.agisoft.com/forum/index.php?topic=963.msg4689#msg4689 (http://www.agisoft.com/forum/index.php?topic=963.msg4689#msg4689)
"...Now, what does all this tell us about using RAW or JPG in PhotoScan?
(a) The lowest possible ISO value should be used to reduce sensor noise.
(b) Underexposure and dark areas in images should be avoided because sensitivity to subtle brightness differences (and, as a result, feature detection) in dark areas is poor.
(c) RAW images suffer much less from quantisation noise and not at all from loss of image detail due to noise removal  and compression artefacts, but they contain all sensor noise (which can be severe). JPG images, on the other hand, often have less (visible) noise than raw images because of the in-camera noise removal and are much smaller files which are processed much faster. If your camera has very low sensor noise, RAW will be the better choice. For many consumer cameras, JPG may be the better choice unless you are able to apply a better sensor noise removal than the camera itself.
(d) In the end, it all comes down to SNR. You will always have some noise, and you should not only try to reduce noise but also to enhance the signal: a good lens, perfect focus, and an illumination which brings out as much fine detail as possible while not producing underexposed areas. In many cases, more photos taken closer to the subject will also help a lot...[]...Overexposure is different from underexposure in that the problem is not quantisation error but values exceeding the range of values (i.e., everything that is brighter than whatever is equivalent to a value of 255 will also have the value 255)."

&
http://www.agisoft.com/forum/index.php?topic=960.msg4692#msg4692 (http://www.agisoft.com/forum/index.php?topic=960.msg4692#msg4692)
Quote from: Infinite
Quote from: RalfH
I agree with Mr. Curious but want to stress that "bright lighting" is too simple: ideally, the lighting should be such that small detail (e.g. skin pores in this case) will be enhanced rather than subdued in the images. Visually smooth surfaces are really difficult because PhotoScan needs to be able to detect features. Experimentation with multi-directional vs. homogenous diffuse lighting might be interesting in this respect.

The reason bright light is highlighted here is because of the experimentation with continuous light. To mimic the same light levels one gets with flash light which is VERY bright but at a short burst of time, anything around 1/10,000th of a second. To match that same level of light to use similar camera settings, low ISO (very important) but high exposure speed 1/100th you need bright light just to match that same quality. Obviously not over bright as this will wash out any details. The alternative is noise projection but this introduces other problems of being able to capture a color pass quickly straight after, or using additional separate texture cameras. Multi directional lighting is possible but you need VERY fast capture if you are doing scanning of live subjects.

In summary, there's a lot of variables and avenues to explore. Since we're stuck with the lens & small sensor, flash (or perhaps even two stage flash - one stage including noise projection)  may be worth investigating.

PS:
the small sensor benefit expressed well in the same thread:
http://www.agisoft.com/forum/index.php?topic=960.msg4746#msg4746 (http://www.agisoft.com/forum/index.php?topic=960.msg4746#msg4746)

Quote from: RalfH
Hello James,

full format sensors usually have better image quality (e.g. less sensor noise and less "bleeding" between pixels). For close-range applications they are often not advantagous because at the same field of view (larger sensor in combination with a longer focal length) they have a smaller depth of focus. For facades of buildings, air photos etc., full format sensors would be preferable, for close-range applications you'd have to find a compromise between image quality and depth of focus.
Title: Re: Multi-camera setup project.
Post by: reyalp on 28 / November / 2014, 15:43:52
Do I need run step2 each shot or just sync one time before taking shots?
Just once per session. The "sync" process attempts to create a mapping between the tick counter on each camera and the PC system clock, so the you can issue a command to shoot at PC clock time X and multicam translates this into a camera tick time.

Also note that on some Windows PCs the system clock precision can also be quite low (~15ms). In this case, init_sync will not be very effective. In this case the "send" times in the init_sync output will show up alternating 0 and 15ms values.

The whole sequence should look like this
One time actions
Code: [Select]
> !mc=require'multicam'
> !mc:connect()
+ 1:Canon PowerShot D10 b=\\.\libusb0-0001--0x04a9-0x31bc d=bus-0 s=...
> !mc:start()
> !mc:cmdwait('rec')
1:rec
> !mc:init_sync()
1: send 3 diff 11 pred=53251 r=53260 delta=-8
...
1: send 6 diff 221 pred=53461 r=53470 delta=-8
1: ticks=10 min=-11 max=1 mean=-6.993300 sd=3.577292
1: sends=10 min=2 max=7 mean=4.400000 sd=1.800000
minimum sync delay 6
Note I suggest switching to rec mode before doing init_sync: The camera CPU is busier in rec mode, so the latency is higher.

The "minimum sync delay" gives you the calculated time required to send a command to each camera (this will increase linearly with the number of cameras). When you shoot, the syncat must be at least this far in the future. The value is a rough approximation, so I'd suggest adding some margin on top of that

Shoot a shot
Code: [Select]
> !mc:cmdwait('preshoot')
1:preshoot
> !mc:cmdwait('shoot_hook_sync',{syncat=100})
1:shoot_hook_sync 499081

I would be very interested to see how this compares to your previous tests, it should be significantly better.
Title: Re: Multi-camera setup project.
Post by: mphx on 28 / November / 2014, 16:20:31
@andrew

We have spent endless time and done endless tests to see how to avoid noise in the photos.

There are two solutions :

1.Use dslr cameras :)
2.Use some degree of zoom.In my case this is impossible.Because as discussed in earlier posts there is a minor distortion in the edge of the photos.
Another way to emulate "zoom" is to put cameras too close to the center , where the person will be standing.
For this to work you need let's say double the number of cameras to achieve the same result as before since now cameras will "cover" only parts of the person being shot and not the whole person.
So you need larger number of cameras to split the person into smaller groups of cameras .

Just a reminder we use the lowest possible ISO (100 if not mistaken) and a lot of strong lights...but noise still remains.

Photoscan does a good job creating models...but in some cases where the outline of the person has the same color with background...it gets messy...
I have spent endless hours "masking" photos (if you have used photoscan , you know what i am talking about :) )..to get a better result..so we won't have to sculpt and smooth the produced model a lot.


PS: Things are a bit better with dng format (raw format) because we can mass manipulate photos in photoshop and remove noise BUT jpeg photo is like ~4mb and dng photo is like ~20mb.
Transferring photos from cameras to pc take ages with dng..not very practical...so we are sticking to jpeg for the time being..since the job is done with them...
Title: Re: Multi-camera setup project.
Post by: rick on 29 / November / 2014, 04:37:19
Update the sync results:
https://drive.google.com/open?id=0B4hGaTy8v6W1amdxbDNyOHJ4UUE&authuser=0

After optimizing the codes,I tested them again and maked a comparison.It really took me some time.

In the end,I find that reducing the syncat number as far as possible can improve the results.
When I set syncat =50,I got the best result which is less ten times of the result of bcam way.
Of course,the setting is depanding on the number of your cameras.

And if you want to download last shot,you‘d better sync the cameras again before next shot.
Thus you could get better results.

Anyway,I think the multicam way is a worthy of choice method:)
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 29 / November / 2014, 10:45:35
more great ino mphx.

Re:

..but noise still remains.

mine is a note only: whatever your shutter speeds they are many multiples the length of a flash i.e. what "noise" is being referred to...is the point cloud of a stuffed dummy equally poor.

Here's a link on the off chance you are not aware of semi-automatic masking http://www.agisoft.com/forum/index.php?topic=2846.msg15090#msg15090 (http://www.agisoft.com/forum/index.php?topic=2846.msg15090#msg15090)

Title: Re: Multi-camera setup project.
Post by: mphx on 29 / November / 2014, 11:06:53

Here's a link on the off chance you are not aware of semi-automatic masking http://www.agisoft.com/forum/index.php?topic=2846.msg15090#msg15090 (http://www.agisoft.com/forum/index.php?topic=2846.msg15090#msg15090)

I was playing with semi-automatic masking in photoscan yesterday...it's not that bright news as they are discussing in that thread.

You have to align photos -- build dense cloud (the most time consuming step of all) - build mesh

then import masks from model ...and then re-do the above steps (ok you can skip align photos at this point...)

So you do almost double job...

I did a test yesterday with align photos (HIGH setting) - dense cloud (MEDIUM/MILD setting) - build mesh (HIGH setting) and then i tried importing mask from model..result was almost perfect...BUT minor adjustments were needed to all photos...not a small job either...

So in conclusion in order "semi automatic masking" to work well..u need align photos/dense cloud/mesh with high/medium/high AT LEAST and then some manually work on the masks..and then again dense cloud/mesh.

This is pointless unless someone has a good pc with a good gpu..using the latest pre-release version of photoscan (1.1.0)..which has ridiculous big improvements in dense cloud building times.

/offtopic off :)

PS : I am a bit of perfectionist , so if i mask something..i go to pixel level :) My best masking took like 1,5 day :P
Now i simply clean the "garbage" around the model after dense cloud step ...

PS2 : Best way to mask images in my opinion is "import masks from background".The idea is , you take shots of the client and then you take ONE shot in empty studio...then you import this shot as a mask to every each one of the photos...
We are thinking to implement that in future shots.Best masking ever :)
Title: Re: Multi-camera setup project.
Post by: waterwingz on 29 / November / 2014, 13:12:35
Update the sync results:
..
Anyway,I think the multicam way is a worthy of choice method:)
This conclusion confused me until I studied your attachments more carefully.  I think what this shows is that using a USB hardware sync solution (e.g.bcam)  still results in about 10x better sync precision than the best ptp sync option (e.g.multicam)?  But your conclusion is that the multicam solution is "good enough"?
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 29 / November / 2014, 14:24:46
PS2 : Best way to mask images in my opinion is "import masks from background".The idea is , you take shots of the client and then you take ONE shot in empty studio...then you import this shot as a mask to every each one of the photos...
We are thinking to implement that in future shots.Best masking ever :)

But be careful with that too e.g.

http://www.agisoft.com/forum/index.php?topic=2208.msg11686#msg11686 (http://www.agisoft.com/forum/index.php?topic=2208.msg11686#msg11686)

Quote from: tommyboy
Hi all.  We've been using PhotoScan's built-in tool to get masks from background images (i.e. a second set of clean plate/empty background images taken right after the subject is photographed).  It does quite a good job, but seems to have the following issues:

1) the edge of the mask is often too generous in letting in the background, which lets through the white background; this is particularly problematic when creating textures for hair and areas where 'webbing' is likely (fingers, armpit, crotch)
2) it often ends up masking out dark portions of the subject if they are in the same spot as a camera lens in the background image
3) due to diffuse reflection of the subject on our white floor, the contact point of their feet with often includes a significant portion of the floor around their feet

So far we have been manually cleaning up these problem features using the PhotoScan tools, which ends up taking a good 60-90 seconds per photograph on average.  Obviously I'd like to take this number down to zero, so have been looking at alternative methods for background subtraction, which I could then feed into PhotoScan.  This project looked like a good option, but ended up having its own problems, and being rather slow:

http://docs.opencv.org/trunk/doc/tutorials/video/background_subtraction/background_subtraction.html (http://docs.opencv.org/trunk/doc/tutorials/video/background_subtraction/background_subtraction.html)

Is anyone else using external programs for mask generation?  I should know the answer to this but for some reason it is eluding me...

Thanks!

but only 2) & 3) releavant:

http://www.agisoft.com/forum/index.php?topic=2208.msg11725#msg11725 (http://www.agisoft.com/forum/index.php?topic=2208.msg11725#msg11725)

Quote from: Infinite
Quote from: tommyboy

1) the edge of the mask is often too generous in letting in the background, which lets through the white background; this is particularly problematic when creating textures for hair and areas where 'webbing' is likely (fingers, armpit, crotch)


It doesn't really matter how accurate the masks are in this regard as Photoscan still doesn't take into account masks during hole fill stage. Webbing will always occur until hole fill is taking masking into account. I believe this is a complex problem to solve.

It's just as fast to do your editing after dense point cloud reconstruction. Edit / delete the points directly in 3D, then build the mesh. Photoscan will still web but it will produce better results and will be faster than manually editing each mask image by hand.

 
Title: Re: Multi-camera setup project.
Post by: mphx on 29 / November / 2014, 15:15:39
@andrew

well...

1.hair are always a problematic area...much manual work is done always there..so either with mask or not..the work needed is more or less the same...
Fingers that get really screwed up are replace by fake ones :) No client can tell the different when he/she gets their miniature in their hands :)
Everything else in the model is fixable...
2.this problem described here is occured in "import mask from model" method..aswell..so...no gain or loss here.
3.we use a colored base where people are standing to get their shot.We need this base to exist in the produced model for measuring reasons (dimensions of the model in 3ds max when we get it ready for printing).
So no problem here :)

The whole idea in "masking" is to mask photos with optimal way...and by optimal i mean..don't waste a lot of time masking since a more rough masking would lead to the same results...

At the time being...i don't mask anything..just clear the garbage after dense cloud..and see what result i get.
If the client was wearing trouble making colors or clothes..then i do manually masking.
My friend does a fast masking..a rectangle around the person , just to get the background out of the way , to decrease times when doing align and dense cloud...
Produced result is workable so...we are good :)
Title: Re: Multi-camera setup project.
Post by: reyalp on 29 / November / 2014, 16:13:16
After optimizing the codes,I tested them again and maked a comparison.It really took me some time.
Thanks for testing and reporting.
Quote
In the end,I find that reducing the syncat number as far as possible can improve the results.
When I set syncat =50,I got the best result which is less ten times of the result of bcam way.
Of course,the setting is depanding on the number of your cameras.
If this is correct, it is a bug. All syncat should do tell the cameras to fire N ms in the after the command is issued on the PC. If you set it too short, then some cameras will not have received the command. Any larger value should have the same sync accuracy, only the latency will be higher. Clock drift should be insignificant on the timescale involved.

Also note that syncat should be used with shoot as well, otherwise you are getting completely unsynchronized shooting, just firing as soon as the command arrives. With only two cameras, this may work reasonably well, since transmission time is well under 10ms for cameras after digic II.

All that said, I think ~30 ms max deviation is about the as good as the current code can do:
The 10ms tick counter means that the "same" time on two cameras could be ~20ms apart, and the handoff from kbd_task to capt_seq that uses a 10ms sleep loop.
Title: Re: Multi-camera setup project.
Post by: rick on 29 / November / 2014, 21:48:20
Update the sync results:
..
Anyway,I think the multicam way is a worthy of choice method:)
This conclusion confused me until I studied your attachments more carefully.  I think what this shows is that using a USB hardware sync solution (e.g.bcam)  still results in about 10x better sync precision than the best ptp sync option (e.g.multicam)?  But your conclusion is that the multicam solution is "good enough"?
:D
No doubt, using a USB hardware sync solution (e.g.bcam) is the best way! My description and attachments are all showed this point.
If someone receive ~30 ms max deviation of ptp sync option,the multicam way is a worthy of choice method. :)

@ waterwingz:Now I use three a1200s,I can shoot just by controlling the switch of the central usb hub to disconnect the USB 5V power without any modification(see b.jpg). Could I still use this method when using 40+ cameras?
@waterwingz 
Could you give me some advice?Thanks! :)
Title: Re: Multi-camera setup project.
Post by: rick on 29 / November / 2014, 22:00:40
@andrew

The whole idea in "masking" is to mask photos with optimal way...and by optimal i mean..don't waste a lot of time masking since a more rough masking would lead to the same results...


I agree with mphx!
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 30 / November / 2014, 10:38:35
post-processing this could be a real headache https://www.youtube.com/watch?v=kF8SYObx1Fg (https://www.youtube.com/watch?v=kF8SYObx1Fg). Wonder what's in the 5Mpix boxes.

Edit: having said that, they capture 2 frames to each camera (admittedly it takes 0.2secs). The second with noise projection with 300 ms flash (seems very long)

Edit2: same guys (I think) http://www.agisoft.com/forum/index.php?topic=1802.msg11496#msg11496 (http://www.agisoft.com/forum/index.php?topic=1802.msg11496#msg11496)
Title: Re: Multi-camera setup project.
Post by: mphx on 30 / November / 2014, 15:57:47
post-processing this could be a real headache https://www.youtube.com/watch?v=kF8SYObx1Fg (https://www.youtube.com/watch?v=kF8SYObx1Fg). Wonder what's in the 5Mpix boxes.

Edit: having said that, they capture 2 frames to each camera (admittedly it takes 0.2secs). The second with noise projection with 300 ms flash (seems very long)

Edit2: same guys (I think) http://www.agisoft.com/forum/index.php?topic=1802.msg11496#msg11496 (http://www.agisoft.com/forum/index.php?topic=1802.msg11496#msg11496)

First of all i can't imagine how crappy those camera modules of pi can be :)
I don't know if it has any point getting 100 pi or less digital compact cameras...more or less the result would be similar...
Second of all , projecting a noise on the "object" is something that we have thought..for cases where the colors of the person being shot are difficult to handle. (we are thinking some kind of projector on the roof of the studio projecting a pattern all over the place...thus all over the person too....in todo list.)
But this doesn't solve any background-problems or masking for that matter...it only helps modelling..not what will happen in the edges of the model if the colors will blend with the background...
Although i don't understand what he means by "noise on the object"..won't the noise go all over the place?
Not clear enough for me....
Title: Re: Multi-camera setup project.
Post by: ahull on 30 / November / 2014, 18:04:53
Removing or replacing the background is greatly simplified if the background is a uniform color.

http://en.wikipedia.org/wiki/Chroma_key (http://en.wikipedia.org/wiki/Chroma_key)

Shooting through small holes in a colour separation overlay screen would seem like an avenue worth exploring.

Making a suitable CSO screen should involve little more than dying some white sheets as closely as possible to the same shade with a suitable hue chosen depending on the type of modeling you are doing.

Arrange the lighting to minimise shadows on the blue/green/cyan or whatever screens (and of course take great care to ensure the screens and light are not a fire hazard).
Title: Re: Multi-camera setup project.
Post by: Hardware_Hacker on 30 / November / 2014, 19:22:16
Removing or replacing the background is greatly simplified if the background is a uniform color.

http://en.wikipedia.org/wiki/Chroma_key (http://en.wikipedia.org/wiki/Chroma_key)

Shooting through small holes in a colour separation overlay screen would seem like an avenue worth exploring.
A Studio "Bullet Time Rig -SETUP" Example is Here

http://www.timesplice.com.au/images/1.jpg (http://www.timesplice.com.au/images/1.jpg)

Camera Array - 360 Degree Rig here

http://www.timesplice.com.au/360-camera-array.html (http://www.timesplice.com.au/360-camera-array.html)

The 60 cameras is equivalent to 59 stereo pairs. The [interpolated, 1000 frame] Example link is the bottom.

H-H

Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 01 / December / 2014, 11:02:01
we are thinking some kind of projector
mphx,
 
looking at that pi setup, I don't think my previous description "The second with noise projection with 300 ms flash (seems very long) " is accurate - I don't think the projectors have been hacked for flash. It may be the first frame is captured with both led's and projectors on (the projection being washed away by the led's) and then turn the led's off for the second frame with the projectors.
 
I hadn't really thought about projection with ptp trigger in your setup - but could it be as "straightforward" as setting your shutters to, say, 20ms exposure period and then using  a syncat for the second half of your cam count (or an otherwise appropriate quantity) as 20ms+30ms+5ms = 55ms  (shutter+expected sync period across all cams + 5ms margin) greater than for the first group ?

Of course, that would need a switch to activate your gui button (edit of multicam.lua) and turn the led's off (down rather - see update below) during the "margin" time (http://chdk.setepontos.com/index.php?topic=11667.msg117463#msg117463 (http://chdk.setepontos.com/index.php?topic=11667.msg117463#msg117463))

I've seen enough pictures with normal projectors to make it feel like the split cam count for each of geometry / texture could be worth it. 

Update:
http://www.agisoft.com/forum/index.php?topic=2305.msg16448#msg16448 (http://www.agisoft.com/forum/index.php?topic=2305.msg16448#msg16448)

Quote from: 3dmij
We use LED strips, powerful ones. 19watts per meter. We have 20 poles of 2 meter, so 760 watts of LED at about 90cm away from the person.

We have dimmed the LEDs a bit, not using PWM but decreasing the voltage from 24v to 19volt. This is to allow our projection system still to be able to project over the LED light.
Title: Re: Multi-camera setup project.
Post by: mphx on 01 / December / 2014, 15:20:19
@andrew

i was talking about "projection" with my friend on this project.
The only viable solution is the following..

2-3 projectors projecting a pattern of dots from all possible angles.
Pattern not very thick..all shootings will be done with this pattern at all times...
Then the usual drill.. photoscan ..3ds max and stuff...when all is done..load the texture jpeg in photoshop and "remove" dots.Job done.
Title: Re: Multi-camera setup project.
Post by: Hardware_Hacker on 02 / December / 2014, 22:56:07
@ ahull, Reply #285, Thanks for your Post, it directly lead me to a possible additional solution, see below.

The Studio " Studio "Bullet Time Rig -SETUP" by Mark Ruff, see Post #286, is an Inwardly Pointing Camera Array of 60 Cameras
that MAXIMIZES the Parallax in the Horizontal Plane, and MINIMIZES the Parallax in the Vertical Plane.

@ CHDK Bullet Time Projects; See, Edit &1
This also applies to Zcream's now abandoned Project, Novsela and Nafraf Project's.

@ Mphx "Multi-camera setup project" is an Inwardly Pointing Camera Array of 64 Cameras
that MAXIMISES the Parallax in the Horizontal Plane, and also MAXIMIZES the Parallax in the Vertical Plane. See, Edit &1

@ Mark Ruff then in post processing, "Pictorially" recombines the Inwardly Pointing (i.e. MAXIMUM Parallax) Camera images with a separate Outwardly Pointing Camera image.
 (i.e. MINIMUM Parallax, i.e. Panoramic) For Example, see the Link in Post #286.

@ Mphx #0, in post processing, then uses Agisoft PhotoScan to extract (Inwardly Pointing) Horizontal and Vertical Parallax Image Data to then construct the PhotoScan 3D Mesh. Also see Post 269
Also, Mphx #1, could produce a Agisoft PhotoScan with NO subject (i.e. NO central observer) for the Calibration of the Multi-Camera rig. see below.

~~~~Omnipolar Camera:~~~~

A New Approach to Stereo Immersive Capture
By Vincent Chapdelaine-Couture and S´ ebastien Roy
D´ epartement d’Informatique et recherche op´ erationnelle
Universit´ e de Montr´ eal (Qu´ ebec), Canada

PDF Extract:-

"...We introduce in this paper a camera setup for stereo immersive (omnistereo) capture.
An omnistereo pair of images gives stereo information up to 360 degrees around a central observer..."

For, This post, a "central observer" is equivalent to the "Surface" of the PhotoScan 3D Mesh.

~~~~EpiPolar Geometry~~~~

2503: EpiPolar Geometry by
A.D. Jepson and D.J. Fleet, 2006, PDF, Page: 1

PDF Extract:-

"...We consider two perspective images of a scene as taken from a stereo pair of cameras
 (or equivalently, assume the scene is rigid and imaged with a single camera from two
different locations)..."

"...The relationship between such corresponding image points turns out to be both simple and useful..."

@ Mphx #2, Agisoft PhotoScan already Semi-Automatically produces the required, Outwardly Pointing Camera, 3D Mesh Data, its The 3D Position of the Cameras.

@ [AgiSoft]; Re: Bumpy Suface
« Reply #17 on: September 17, 2014, » Hello Brit,

The basic principles of image acquisitions and pre-processing are the following:-
* do not crop original images,
* do not apply geometrical transformations (rotations or deformations) to the images,
* use image frame effectively,
* provide sufficient overlap and coverage of the surface being reconstructed.

Additional recommendations:-
* use lower ISO values,
* provide good focusing and sufficient focal depth to acquire sharp images,
* avoid using flash,
* if different focal length are used, make sure that cameras are grouped correctly into calibration groups
 (in Tools Menu -> Camera Calibration window).

Masking can be performed semi-automatically [#2] - at first you can generate masks from model and then adjust them manually. [#3]
 
Best regards, Alexey Pasumansky, AgiSoft LLC

@ [AgiSoft]; Re: Improved masking options for Human Scanning
« Reply #4 on: April 05, 2014
"...It's just as fast to do your editing after dense point cloud reconstruction..."
"...Photoscan will still web but it will produce better results and will be faster than manually editing each mask image by hand..."
"...It doesn't really matter how accurate the masks are in this regard as PhotoScan still doesn't take into account masks during hole fill stage..."

@ Mphx #3, Then a further small amount of [manual] (???) post processing, of the 3D Position Mesh Data of the Cameras is then done by:-

3D Printing and Data Visualisation:-
A Technology Briefing by Paul Bourke iVEC @ UWA
Slides online here: http://paulbourke.net/3dprint2014/ (http://paulbourke.net/3dprint2014/)

PDF Extract:- "...Geometry: Thickening Surfaces..."

• Solution is called “Rolling Ball” Thickening.
• Imagine a ball rolling across the surface, form an "INTERNAL" [external] mesh along the ball path.
• Implemented in Blender as a modifier called “solidify”.
• Modifiers are elegant since they don’t permanently affect the geometry, can be changed later.

@ Andrew (A Re-post is OK), or Anyone; Confused, Comments.

@ PhotoScan Processing Summary and Valid Data:-

* PhotoScaned Images Mapped on to the Exterior Surface of PhotoScaned 3D Mesh.

* PhotoScan Mask is on Interior Surface of the Camera Position 3D Mesh.

* Optional "INTERNAL" Thick PhotoScan Mask is also on Interior Surface of Camera Position 3D Mesh.

* "...PhotoScan will still web..."

* "...PhotoScan still doesn't take into account masks during hole fill stage..." 
 
H-H

Edit &1

Automatic Disparity Control in Stereo Panoramas (OmniStereo)

By Yael Pritch Moshe Ben-Ezra Shmuel Peleg
School of Computer Science and Engineering
Hebrew University of Jerusalem 91904, ISRAEL

See:- Figure 1. No arrangement of two single viewpoint images can give stereo in all viewing directions.
For upward viewing the two cameras should be separated horizontally,
and for sideways viewing the two cameras should be separated vertically.
Title: Re: Multi-camera setup project.
Post by: mphx on 03 / December / 2014, 11:06:23
@H-H

jesus... you must be the life of the party :) ..Try human language !
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 03 / December / 2014, 12:33:11
H-H,

yours is an interesting reference to "Automatic Disparity Control in Stereo Panoramas" and related baseline.

I found this link interesting wrt camera baseline positioning in connection with 3dme data capture www.int-arch-photogramm-remote-sens-spatial-inf-sci.net/XL-5-W1/251/2013/isprsarchives-XL-5-W1-251-2013.pdf (http://www.int-arch-photogramm-remote-sens-spatial-inf-sci.net/XL-5-W1/251/2013/isprsarchives-XL-5-W1-251-2013.pdf) but not necessarily all that useful.

After reading it a few times I ultimately, unhelpfully, commented, in this post http://www.agisoft.com/forum/index.php?topic=330.0 (http://www.agisoft.com/forum/index.php?topic=330.0) as follows:

Quote from: andy_s
Wishgranter, I still get the feeling that - rather than an optimal model - the thesis of the paper is to throw everything [including the kitchen sink] at it -

"For multiple stereo models, small such measurements can be useful for the validation of measurements with strong intersection geometry. Even though small intersection angles lead to noisy results, models with small base lines should be acquired and used within the surface reconstruction. Since large baseline models have lower image similarity - which is challenging for the matching method, small baseline models are required additionally. Furthermore, highly overlapping imagery leads to high redundancy, which is beneficial for the precision in object space."

Maybe [with a supercomputer and deeeep pockets] that is the optimal model...

Having just re-read this earlier comment from the same thread maybe someone else could find it more useful http://www.agisoft.com/forum/index.php?topic=330.msg5395#msg5395 (http://www.agisoft.com/forum/index.php?topic=330.msg5395#msg5395) (but i'm still not sure since it is also a bit of a fudge):

Quote from: RalfH
Quote from: Porly
The bigger the distance between stereo-pairs, then better the results. With a short basis between pictures the angel for triangulation is small what causes errors(In object direction). I was always using all pictures because I was sure that photoscan is using more Stereo-pairs to estimate one point...

Yes, this is generally true, but only to a certain extent. If the distance (viewing angle) between images becomes too large, new problems will appear, mainly related to increasing difficulties of matching features because (a) the changes are too large between images and (b) low incidence angles (i.e. grazing view of objects). In essence, image distance should be neither to small nor too large.


Edit:
but as previously linked we know, in the end, the kitchen sink is also deployed (over 200 dslr) http://chdk.setepontos.com/index.php?topic=8810.msg118503#msg118503 (http://chdk.setepontos.com/index.php?topic=8810.msg118503#msg118503)   - thankfully not for current 3dme printing though.
Title: Re: Multi-camera setup project.
Post by: Hardware_Hacker on 03 / December / 2014, 15:18:12
@H-H
 ..Try human language !

The SIMPLE, and non technical, Version:-

#  The !dea is to Quickly create a Thick [3D Data Exclusion] mask, for easy editing in post production.
#  The Valid 3D Mesh Data is Inside the Thick Mask. (i.e Your, UN-Obstructed, Physical Work Space)
#  The In-Valid 3D Mesh Data is Outside the Thick Mask. (i.e Your, Obstructed, Physical Work Space)

Thick [3D Data Exclusion] mask Is Created By:-

*  The Floor Location; 3D Data.
*  The Ceiling Location; 3D Data.
*  The Camera Locations; 3D Data, that is already provided, by the PhotoScan Software.
*  The INTERNAL Thick Mask; A Suitable Rolling Ball Size.

For The Initial Camera Rig Setup:-

*  Once-Off, UN-Obstructed, Physical Work Space, Calibration.
*  The 3D Data Exclusion mask, is made water tight.
*  The 3D Data Exclusion mask is then re-used for all the PhotoScans.
*  Re-Calibration required when the Camera Locations are changed.

For Simple Multi-Camera Rigs that have less than 360 Degree image coverage:-

*  The Wall Locations; 3D Data. 

H-H
Title: Re: Multi-camera setup project.
Post by: mphx on 03 / December / 2014, 17:04:17
Ok people i will sum up the situation about photoscan and masking.

For those who doesn't know photoscan...photoscan can take a number of pictures and make a 3d model out of them by finding common "points" between the photos provided.

The whole process has several stages and i will write the minutes required for each one of it in my computer.

(photoscan 1.1.0 pre-release ..improved perfomance)

1. align photos - finding points and aligning cameras ~15mins
2. build dense cloud - ~8-10mins
3. build mesh - ~3-4mins
4. build texture - ~1-2mins

Now , we have mixed two things about photoscan , masking and "projection"
That things refer to different aspects apo the whole procedure.

1.Projection

In order photoscan to find common points between photos , it needs multiple designs and colors in clothes (if we are talking about a person being shot).
He doesn't like one-colored clothes or clothes with shining material.
So if we have a person wearing such kind of clothes we have problem.Photoscan won't find points and the result would be screwed up.
So what we do ?Many different things.

1.Colored stickers all over the clothes...a bit stupid if you have a client :) But it works.
2.Apply a pattern from a source (projectors let's say) ...not thick pattern so the manual removal at the end can be an easy job.
3.Apply the pattern shoot , remove it , shoot again...a bit tricky to be done if you ask me.

So ?What's the best solution?
No #1 if you shoot friends and they wont get mad with the stickers... no #2 in all other cases.

2.Masking.

Masking is the procedure where you tell photoscan to "reject" some elements of the photos from the whole procedure.
Why to do that ?Two reasons

1.Less elements in the photos , faster procedure.
2.Many times , the outline of the person being shot..the color of it ..blends with the background...and at those points the model gets ugly :)

So..what's the best way to mask ?
Depends on why you are masking...

IF you mask just to get rid the background for faster times...rough masking around the person is enough...

If you know that there is color blending..then a better masking is required...

Methods of masking

1.Go paranoid and mask person around pixel by pixel..done that...takes too many hours..not worth the trouble.
2.Get a shot of the person and then get an empty shot of the studio.
That requires to import every empty shot as mask to every photo. Thats a boring procedure :).Done that , but masking with this method isn't flawless , medium manual work is required.
3.Import mask from model...That means you have to do steps 1+2+3 (add times) and then choose import mask from model... it's like method no #2 ..good masking but not perfect..medium manual work is needed.
4.Do a fast 1+2 (align photos + dense cloud) and check what areas blend and need masking...Then manual mask only those areas...
5.Don't mask anything , just clear "garbages" after dense cloud.

What i prefer? Method #5 or no #4 if there is a lot of garbages and screwed up areas.


So in conclusion...masking can't help if the person wears one-colored clothes..and projection can't help with mixed colors ... two different things :)
Title: Re: Multi-camera setup project.
Post by: rick on 06 / December / 2014, 07:27:00
I made a experiment with a projector. I just used a excel sheet as the pattern. :P
The result was great although the surrounding light was a little weak.
Removing the “pattern points” is still a big job.  :-[
Maybe we can make a video that shows blinking points or any other patterns(such as nets ).
So is it possbile that taking two shots one time and download last two images?
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 06 / December / 2014, 16:39:08
rick - i'll defer to a guru to, perhaps, answer directly.

Two frames to the same camera and a long time between the 2 capture events ? maybe an artec scanner (or more) and some Hao Li "non-rigid registration" (Artec studio) could be a better idea https://www.youtube.com/watch?v=7vkfyCutBjY (https://www.youtube.com/watch?v=7vkfyCutBjY) ?
Title: Re: Multi-camera setup project.
Post by: rick on 07 / December / 2014, 03:15:08
rick - i'll defer to a guru to, perhaps, answer directly.

Two frames to the same camera and a long time between the 2 capture events ? maybe an artec scanner (or more) and some Hao Li "non-rigid registration" (Artec studio) could be a better idea https://www.youtube.com/watch?v=7vkfyCutBjY (https://www.youtube.com/watch?v=7vkfyCutBjY) ?
I tried to use “nshot=2”,but there were around 5 seconds between the 2 capture events.
Yes,it was too long for a living human. :(
"non-rigid registration" is great.
However,it is only for Mac. http://www.hao-li.com/Hao_Li/Hao_Li_-_software.html (http://www.hao-li.com/Hao_Li/Hao_Li_-_software.html)
And,artec scanner is too expensive to me.
Title: Re: Multi-camera setup project.
Post by: reyalp on 07 / December / 2014, 19:24:19
I tried to use “nshot=2”,but there were around 5 seconds between the 2 capture events.
Yes,it was too long for a living human. :(
It is likely possible to get this close to the "continuous shooting" spec for your cameras. Generally this is ~1 FPS on low end cameras, so likely still too long to be practical with people.
Title: Re: Multi-camera setup project.
Post by: mphx on 19 / January / 2015, 14:59:27
After a long time an update on the project :)

Things going rather well..but it was Christmas and New Years eve and people were coming to buy miniatures as presents for their loved ones.
We did 3 live interviews on 3 channels and many people saw us there and came for miniatures.
We expect work to slow down in the future..but of course we hope for the opposite.

Things out of the ordinary.

One guy asked if he could open a franchise in England...This proposition is open to discussion yet... :)

Another guy asked for 1:1 miniatures and we are researching the side-works that has to be done in order such a miniature can be created.

Also , today we did a test shooting with a projector projecting a pattern to the person being shot.
Results were veeeery good up to the point we are thinking to buy 3 projectors to cover all angles .
Since projectors are a bit expensive we put it on a "todo" list if things go well in the future.
For sure the result is very good and can save us some hours of manual modelling work ....
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 20 / January / 2015, 18:08:49
We expect work to slow down in the future..but of course we hope for the opposite.

mphx, maybe it'll slow down in a year or two - but computing/hardware & you will then be set up for video and other virtual reality opportunities  :)

Also , today we did a test shooting with a projector projecting a pattern to the person being shot.
Results were veeeery good up to the point we are thinking to buy 3 projectors to cover all angles .
Since projectors are a bit expensive we put it on a "todo" list if things go well in the future.
For sure the result is very good and can save us some hours of manual modelling work ....

would, sometime, like to hear test results/comment for a tailors dummy (static object) with:
(i) half camera count in continuous light&no projection (texture)
(ii) half camera count in continuous light & projection (geometry)

insofar as time saving is concerned (or lack of - in post processing).
Title: Re: Multi-camera setup project.
Post by: mphx on 21 / January / 2015, 05:04:09

would, sometime, like to hear test results/comment for a tailors dummy (static object) with:
(i) half camera count in continuous light&no projection (texture)
(ii) half camera count in continuous light & projection (geometry)

insofar as time saving is concerned (or lack of - in post processing).

The test , in fact , was two shootings , one with projection on and one with projection off , to compare results.
With projection on , results were better (naturally) but the real question is .. is it worth the trouble/buying the projectors?
Answer depends on the person being shot , how much skin is uncovered (hands , feet , etc) , what kind of clothes he/she wears and stuff like that.

There will be few cases that projection will help ALOT and some other cases (most of them) that projection will help A LITTLE.
In any case will save us minimum 1-2 hours of manual work.So in general , it worths the trouble..as far as we can find some money to buy them , since they are not that cheap :)
So ... todo list => find money for 3 projectors :)
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 21 / January / 2015, 07:25:04
Very informative mphx. Thanks.

The test , in fact , was two shootings , one with projection on and one with projection off , to compare results.

Was the camera count split between the two shootings (or full for both)?
Title: Re: Multi-camera setup project.
Post by: mphx on 21 / January / 2015, 10:21:37
Very informative mphx. Thanks.

Was the camera count split between the two shootings (or full for both)?

Full for both.
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 04 / August / 2015, 05:38:00
PS: Things are a bit better with dng format (raw format) because we can mass manipulate photos in photoshop and remove noise BUT jpeg photo is like ~4mb and dng photo is like ~20mb.
Transferring photos from cameras to pc take ages with dng..not very practical...so we are sticking to jpeg for the time being..since the job is done with them...

Some further related & interesting comment:

http://www.agisoft.com/forum/index.php?topic=1378.msg20787#msg20787 (http://www.agisoft.com/forum/index.php?topic=1378.msg20787#msg20787)
Quote from: bigben
Quote from: chadfx

If I am using CDHK with a Canon compact camera (A3300 IS) and shoot in DNG raw, it does not automatically correct for the lens distortion...so it appears different from the JPGs coming out of the camera. ...

On this part of the original question...  I wouldn't do any distortion correction prior to using Photoscan as you can either provide calibrated values to Photoscan or have it calculate distortion parameters for you.   If the image offset calculated by Photoscan is different to that used in the in-camera correction then you will effectively be using distorted images.

http://www.agisoft.com/forum/index.php?topic=1378.msg20814#msg20814 (http://www.agisoft.com/forum/index.php?topic=1378.msg20814#msg20814)
Quote from: chadfx
That makes sense, thanks. I know that outside perspective correction is a usually a strict no-no for Photoscan. It sounds like it will figure it all out on its own either way (camera corrected JPGs or uncorrected RAWs). I certainly haven't had poor results from the RAWs, but it would be worth a comparison at some point I suppose (if only time were more plentiful...sigh)

http://www.agisoft.com/forum/index.php?topic=1378.msg20816#msg20816 (http://www.agisoft.com/forum/index.php?topic=1378.msg20816#msg20816)
Quote from: bigben
Photoscan will figure "something" out regardless but not neces4444444sarily "it"... eg. you can feed it fisheye images and process them as rectilinear and it will figure something out.  The calculations for lens distortion are all done from the optical centre of the image.  If you in-camera correction does this on the geometric centre of the image file and the optical centre of the image is in a different position to this then the final result will be technically distorted, resulting in a mathematical best fit of all of the criteria put together. As a result, camera positions and rotations will also have small errors, compensating for the incorrect distortion correction and you'll see more noise in the sparse point cloud.

If you want a comparison, try creating unfiltered dense clouds.
Title: Re: Multi-camera setup project.
Post by: mphx on 18 / September / 2015, 05:31:47
@reyalp

Hey , after a long time :)

Need to ask you something about chdkptp.

We tried the testshot command , in order to see how it behaves because we will need multiple shots in a project we are working.
I tried it with only one camera connected (i remind i am using canon A2500).I set it up to take 2 photos.
It worked well , but there was a pause between of the two shots of around 5 secs.

For the project we want shorter pause , let's say around 2 secs max. Is this hardware related ? or it can be configured in chdkptp ?

Thanks.
Title: Re: Multi-camera setup project.
Post by: reyalp on 18 / September / 2015, 16:35:41
I tried it with only one camera connected (i remind i am using canon A2500).I set it up to take 2 photos.
It worked well , but there was a pause between of the two shots of around 5 secs.

For the project we want shorter pause , let's say around 2 secs max. Is this hardware related ? or it can be configured in chdkptp ?
testshots was not made fore speed. It does a full half shoot, wait for camera to focus and measure exposure, shoot cycle. It also prints to the screen for 1/2 second and sleeps for another 1/2 second after that.

So you should be able to do a lot better, especially if you want the same exposure and focus for each shot.

A couple possible approaches:
1) Do something like testshots, but put the preshoot outside of the main loop, and modify the shoot commands to use shoot_full_only instead of shoot full. This is probably the simplest code wise, but will slow down with large numbers of cameras, because each shot still requires enough time to trigger all the cameras. Clicking shoot_full_only repeatedly is also slower than true continuous mode on some cameras.

2) Add a camera side function that shoots multiple shots at a given interval, syncing the start and then using the interval to keep sync. This should allow shooting about as fast as a single camera can maintain a steady interval.

I'll see I can come up with code for one or both of these over the weekend.
Title: Re: Multi-camera setup project.
Post by: mphx on 18 / September / 2015, 17:28:36
@reyalp

We did a test with testshots with all the cameras (64 in number) and the delay was huge...we are talking about like 15secs between the two shots.

I've checked the structure of "testshots" in multicam.lua and i see it uses preshoot + shoot for the shots.
Its logic but at the same time , every preshoot..takes time..plus everything else that the command itself does that take their own time.

We did some manual shooting.. preshoot + shoot...1st shot , plain shoot...2nd shot...2nd shot was messy...so as i said its logic that preshoot is needed before every shot.But it consumes time...

The project we are trying to implement is simple.We need to take two shots in very few secs.. 2-3..5 max.

So we need something that will do the preshoot/set focus/exposure whatever (on one button all of these lets say)...and in a second button a command that takes two shots..as fast as its possible.Something like this..if its possible.

I am trying to figure out what do you mean exactly with the (1) approach..You mean i will make a new command in multicam.lua ?A variation of testshots?Something like this?And put the preshoot thing out of the main loop of this command ?
I remind again , that triggering 64 cameras needs like ~2 secs , secs starting adding up fast...



Its a project we need it done in like 2 months (if we can't manage it no big deal , but it will help us alot in our work)..so take your time :)
Title: Re: Multi-camera setup project.
Post by: reyalp on 18 / September / 2015, 21:07:42
We did some manual shooting.. preshoot + shoot...1st shot , plain shoot...2nd shot...2nd shot was messy...so as i said its logic that preshoot is needed before every shot.But it consumes time...
You need to us continuous mode, or keep shoot_half held down between the shots.

Quote
I am trying to figure out what do you mean exactly with the (1) approach..You mean i will make a new command in multicam.lua ?A variation of testshots?Something like this?And put the preshoot thing out of the main loop of this command ?
You would need a variation of testshots, but also new camera side code like shoot or shoot_hook_sync, because the current versions of these do release('shoot_full') which also releases half shoot.

Quote
Its a project we need it done in like 2 months (if we can't manage it no big deal , but it will help us alot in our work)..so take your time
I think this will be fairly simple, and a shooting function more optimized for real use than testshots would be good.
Title: Re: Multi-camera setup project.
Post by: mphx on 19 / September / 2015, 08:03:39
@reyalp

ok lets see what i understand.

I was reading here http://chdk.wikia.com/wiki/CHDK_scripting#shoot (http://chdk.wikia.com/wiki/CHDK_scripting#shoot)

and i understand that.

1.shoot_half must be issued and held.
2.use shoot_full_only so it will go back to shoot_half and not go to off position.

So what you are saying is , that shoot_hook_sync that i am using (or even the simple shoot) , issues shoot_full and not shoot_full_only that will do the trick.
So it needs some change in the structure of these commands , am i getting it right ? :)

PS : By the way whats the difference of shoot_half and preshoot i am using ?
Title: Re: Multi-camera setup project.
Post by: reyalp on 19 / September / 2015, 14:07:13
1.shoot_half must be issued and held.
2.use shoot_full_only so it will go back to shoot_half and not go to off position.
right
Quote
So what you are saying is , that shoot_hook_sync that i am using (or even the simple shoot) , issues shoot_full and not shoot_full_only that will do the trick.
So it needs some change in the structure of these commands , am i getting it right ? :)
Yes, although I was looking at the code last night and there are some other complications, so it's not quite as simple as just replacing shoot_full with shoot_full_only.

Quote
PS : By the way whats the difference of shoot_half and preshoot i am using ?
What you send with mc:cmd or mc:cmdwait are messages to the camera side multicam script. The script reads these messages and uses them call functions in the cmds table. When you send "preshoot" it calls cmds.preshoot, which presses the shoot_half button, waits for get_shooting() to become true (meaning the focus, auto exposure etc has finished) or time out, and the returns a status.
Title: Re: Multi-camera setup project.
Post by: mphx on 19 / September / 2015, 18:34:06
@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.
Title: Re: Multi-camera setup project.
Post by: reyalp 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')
Title: Re: Multi-camera setup project.
Post by: mphx 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)
Title: Re: Multi-camera setup project.
Post by: reyalp 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.
Title: Re: Multi-camera setup project.
Post by: mphx 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.
Title: Re: Multi-camera setup project.
Post by: mphx 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 (https://www.dropbox.com/s/2plwzifj37s8aya/multicam.lua?dl=0) -- multicam.lua
https://www.dropbox.com/s/hyg71nbsv2nh02k/20150922_151731.jpg?dl=0 (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...
Title: Re: Multi-camera setup project.
Post by: reyalp 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.
Title: Re: Multi-camera setup project.
Post by: mphx 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?
Title: Re: Multi-camera setup project.
Post by: reyalp 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.
Title: Re: Multi-camera setup project.
Post by: mphx 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.

Title: Re: Multi-camera setup project.
Post by: reyalp on 22 / September / 2015, 22:14:29
As far as "entire CHDK folder" ..you probably mean take all folders in there..from the full zip right?
Unzip the zip to a directory, like c:\temp
Upload everything that was in the zip to the camera, like
mup c:/temp A/

Note this will overwrite existing files without prompting. Your CHDK cfg files will not be affected, because none are included in the zip.
Title: Re: Multi-camera setup project.
Post by: mphx on 23 / September / 2015, 07:57:52
@reyalp

Ok , thanks for the instructions.
Thing will go down tomorrow , since today there is a shooting scheduled.

I will come back with news tomorrow.
Title: Re: Multi-camera setup project.
Post by: reyalp on 23 / September / 2015, 16:50:32
@reyalp

Ok , thanks for the instructions.
Thing will go down tomorrow , since today there is a shooting scheduled.

I will come back with news tomorrow.
This is probably obvious, but just in case: I'd strongly recommend making sure you have a copy of the build you are currently using saved somewhere, and making sure the update works as expected on one or a few cameras before updating them all.

You can use mdl A/ c:/some/path to download everything on the card if you don't have the original zip somewhere.
Title: Re: Multi-camera setup project.
Post by: mphx on 24 / September / 2015, 07:49:25
@reyalp

Ok , things went well.

Update went without issues.

We did some test shots with the new command (shoot_burst).

With 64 cameras we cant "play" with interval lower of 4000ms.Second shot is going all over the place.
Probably hardware cant catch up or something...dont know .
With interval of 4000ms ..shots are seemed to be synced (first and second) although in 2nd shot there are some errors in console (unexpected error from cmd "shoot_burst" blablah , failed=true etc etc)..and its repeated for some or even all cameras.Despite the fact that the second shot is "heard" to be synced on all cameras.


As far as synctime is concerned..we set it up to 800ms , because we have seen min sync delay ranging from 300ish up to 700ish...i saw that if synctime < min sync delay , command adjusts it..but we set it up to 800ms to be safe.
Title: Re: Multi-camera setup project.
Post by: reyalp on 24 / September / 2015, 17:03:53
With 64 cameras we cant "play" with interval lower of 4000ms.Second shot is going all over the place.
Are you shooting raw? The interval should be similar to what you can get on one camera, which I would normally expect to be under 2 sec if you aren't using raw.

Have you tried with just one or two cameras?

Quote
With interval of 4000ms ..shots are seemed to be synced (first and second) although in 2nd shot there are some errors in console (unexpected error from cmd "shoot_burst" blablah , failed=true etc etc)..and its repeated for some or even all cameras.Despite the fact that the second shot is "heard" to be synced on all cameras.
Example output for one camera might be helpful. blahblah doesn't help me much with debugging ;)

Quote
As far as synctime is concerned..we set it up to 800ms , because we have seen min sync delay ranging from 300ish up to 700ish...i saw that if synctime < min sync delay , command adjusts it..but we set it up to 800ms to be safe.
Since just sending to each cam takes takes several ms, this sounds fairly reasonable.
Title: Re: Multi-camera setup project.
Post by: mphx on 24 / September / 2015, 18:01:10
@reyalp

Nope no raw shooting. jpeg.

If i remember well , when we tested 2-3 cameras , we had synced shoots..both times.i mean shot1 and shot2 (we set it up to shoot 2 shots)

But with 64 cameras , things change.

If we set interval to 2000 or 3000 and synctime something high...shooting goes like this.
 preshoot...everything getting ready as supposed....shooting #1 , all synced (judging by the click sounds) , after 2000msec (or 3000msec...same behavior)...shooting #2 and shouting clicks are random.

With the same settings BUT interval of 4000msec , second shooting "sounds" synced.

In both cases after the second shooting , there are the aforementioned "error messages" that as you understand i don't remember them exactly :)

I remember that the line was beginning with the id of the camera and the rest were inside { }.

"unexpected error from cmd "shoot_burst"" and then some boolean status messages.

I scrolled a bit the console output , it was this message for almost every camera id.

So in the case of 4000 msec , thing is working..two shots are taken correctly (despite the error messages)but we really could use a smaller interval number...why second shoot doesnt sync with smaller interval...i dont know.

And something else , irrelevant to this matter.

I noticed some changes to some commands output ...less messages , doing the job hard to monitor.

I remember when i was issuing the commands to set focus and zoom...i was seeing the id of the cameras and the commands applying to them.
Now i see the two commands...being executed..one by one..no information...no cameras ids...no ending message.
Turned on the cameras to update to the latest chdk , i was seeing the files being copied..never knew when it was done :)
Same thing when dowloading images from cameras , or deleting..never know when the command its done :)
I just see gui getting "not responding" and i know its "working"..when it "comes back" , i know that its done.But that way is way too lame...

Is it possible to get some more output on commands ?:)

And an another issue we were talking some months ago.We have 64 cameras...sometimes , a cable is loose and some camera loses connection...if this happens it fcks up the whole connection...and  i have to reconnect them all.
Since we can work with 1-2 cameras less ,and during a shooting is bad to say to client...wait a moment..technical issues...etc etc... is there a way when a camera loses connection , chdkptp will ignore this camera and keep working with the rest?It will be very handy if this can be done.

Thanks again for all your efforts :)
Title: Re: Multi-camera setup project.
Post by: reyalp on 24 / September / 2015, 22:22:29
In both cases after the second shooting , there are the aforementioned "error messages" that as you understand i don't remember them exactly :)
In the future, I suggest you copy and paste a sample somewhere. I don't have 64 cams, if I am going to debug the problem, I need some better idea of what is happening.

Quote
I noticed some changes to some commands output ...less messages , doing the job hard to monitor.
I reduce the output because even with 3 cameras the flood of messages was difficult to follow. With 64, it's probably enough to slow things down noticeably...

If you are using mc:cmd() or mc:cmdwait() you can pass the option printcmd=true, like
 !mc:cmdwait('rec',{printcmd=true})
If you only want to print once for each command rather than each camera you can use
 !mc:cmdwait('rec',{printcmd='once'})

It the moment there is no way to do this with other functions like shoot that call cmdwait(). I will add a way to change the defaults for this at some point.

Some kind of status in the download command would be good.
edit:
Actually, you should be able to pass verbose=true in the mc:download_images options to see whats being downloaded.

Quote
Since we can work with 1-2 cameras less ,and during a shooting is bad to say to client...wait a moment..technical issues...etc etc... is there a way when a camera loses connection , chdkptp will ignore this camera and keep working with the rest?It will be very handy if this can be done.
Yes, being able to ignore failed cams is something I would like to add, but it will take some work.
Title: Re: Multi-camera setup project.
Post by: mphx on 25 / September / 2015, 08:09:05
@reyalp

As far as the error messages , i will try to reproduce the whole thing tomorrow that i will be at studio and try to copy/paste the messages for you to check them out.

About commands output.

You are right , with 64 cameras there is too much flooding and some time delay with too much detailed output.
But you could put some message indicating that the command(s) are done.

For example , when i issued the commands for focus and zoom yesterday (lets call them command1 and command2 for the example) it was like this in the console output

command1....(~1 sec pause , probably as command was applying to all cameras)...command2.....

for command1 i had an indication that it was over since there was command2 starting after the first one.
But for command2 , i had no indication..i GUESSED that after 1-2 secs , it was done.

Same thing with dowload/delete images from cameras..i get an estimated guess when its done when i see gui getting back from "not responding" state or when stop scrolling in console.

A "Done" , "Download complete" "Delete complete" "Command successful" or whatever would have been enough for me ...to know things are over..that i can issue the next command , without the fear that the previous one is still executing...

I don't care if the output will show all cameras or the command once..i just need to see a fail or complete message to know that the command ended (successfully or not).

Anyway , you know better how and if it can be done... :)

As far the "ignore failed cams" , its not that big/vital thing right now..so take your time..if it can be done..it would be nice...since when a cam fails..we waste some secs to find out which cam failed since it can't be seen right away.
We found out that issuing a "delete" command , reveals the failed cam ....so imagine the whole scene :

failed cam...delete image (bad thing if there was some shooting already) ..find out which cam failed...check cam's cables...reboot cam , re-connect cams..sync..set focus/zoom again....we just spent around 1 min (with the client standing in the stand..waiting)..instead of "ignoring" the failed cam and working with the rest.


Thanks again.
Title: Re: Multi-camera setup project.
Post by: reyalp on 28 / September / 2015, 16:12:44
FWIW, the problems with the chdkptp svn are resolved, and the multicam patch posted earlier is checked in.
Title: Re: Multi-camera setup project.
Post by: mphx on 29 / September / 2015, 10:26:00
Roger that , i just synced my copy.

Thanks.
Title: Re: Multi-camera setup project.
Post by: mphx on 16 / November / 2015, 18:19:48
Some news about the project.

There was a convention last weekend , about comics/games/movies/miniatures/collectables.

We participated and we moved the whole camera setup to the place of the convention , shooting people on site.

Well , it didn't go as good as we expected but many people came and saw us and were very interested about the whole concept and many people from the 3d printing industry came to offer partnership and stuff..

I saw that many people aren't very familiar with the whole 3d printing technology yet..they were very confused and amazed about the whole project...

Overall it was a very good experience and we were a lot advertised.

Some pictures from the convention can be seen in our FB page -> https://www.facebook.com/media/set/?set=a.1702480719987064.1073741847.1437202486514890&type=3 (https://www.facebook.com/media/set/?set=a.1702480719987064.1073741847.1437202486514890&type=3)

We were shooting full-painted people (the first 6  free of charge) , cosplayers ( 20% discount) , and casual dressed people.
Title: Re: Multi-camera setup project.
Post by: mphx on 21 / December / 2015, 13:17:01
@reyalp

Code: [Select]
chdkptp-r658-win32\lua\main.lua:225: incompatible chdkptp binary version
Imagine a folder where i just mess around with my custom lua file , i dont touch anything else and i just "svn update" once a while , when i remember to do so.

Today , i had this message , i updated to revision 694 , but it keeps popping the same error.

Any ideas?

thanks
Title: Re: Multi-camera setup project.
Post by: reyalp on 21 / December / 2015, 13:44:07
@reyalp

Code: [Select]
chdkptp-r658-win32\lua\main.lua:225: incompatible chdkptp binary version
Imagine a folder where i just mess around with my custom lua file , i dont touch anything else and i just "svn update" once a while , when i remember to do so.

Today , i had this message , i updated to revision 694 , but it keeps popping the same error.

Any ideas?

thanks
You need to download the lastest chdkptp.exe from the file area. See the compatibility warning on  https://www.assembla.com/spaces/chdkptp/wiki/Changelog (https://www.assembla.com/spaces/chdkptp/wiki/Changelog)
Title: Re: Multi-camera setup project.
Post by: mphx on 21 / December / 2015, 14:56:15
Well , that would have been my next move , to get a newer version of the executable.

Problem solved , thanks reyalp.
Title: Re: Multi-camera setup project.
Post by: mphx on 26 / December / 2015, 15:24:15
@reyalp


I was messing around with two linux installations in my vmware.

I thought to try to "install" chdkptp..to see how it works.

I failed miserably. :)

I don't know what is going on with IUP and CD , but i dont really like them :)

I installed the necessary libs..and i was forced to install lua 5.2 since thats the version chdkptp is supporting right?(Installations had lua 5.3 installed)
And in both cases i ended up to this

Code: [Select]
chdkptp_gui: symbol lookup error: /usr/lib64/libiuplua52.so: undefined symbol: luaL_setfuncs
I know it probably isnt a chdkptp problem..just saying my story here :)

So what i want to say after all these

1.Can't you not implement the linux version using some other "tools"?Qt?Gtk?I am not programmer..i dont know what is needed..
IUP and CD arent even in the official repos :) Atleast in two distros i was messing around.
2.Maybe support lua 5.3?So no need to install the older version..maybe to avoid errors or whatever?

Not requests..just chatting here ...i think i made it work some time long ago...but today it was a complete NO-GO :)
Maybe newer versions of the packages involved...screwed things up?
Anyone using linux version of it ?

Thanks
Title: Multi-camera setup project.
Post by: waterwingz on 26 / December / 2015, 15:51:00
Anyone using linux version of it ?
FWIW, I was recently able to build it all on the latest Fedora release and Lua 5.3.
Title: Re: Multi-camera setup project.
Post by: reyalp on 26 / December / 2015, 16:16:59
I don't know what is going on with IUP and CD , but i dont really like them :)

I installed the necessary libs..and i was forced to install lua 5.2 since thats the version chdkptp is supporting right?(Installations had lua 5.3 installed)
Are you trying to use the pre-compiled binary, or build your own?

If building your own, I suggest downloading and building the Lua 5.2 source, and then specifying that Lua build for chdkptp in your config.mk. This removes any dependence on the distro's stock lua configuration. The recent binaries are built this way, with Lua statically linked to chdkptp.

If you are using the pre-built binaries, then you need to use the exact libraries listed on https://www.assembla.com/spaces/chdkptp/wiki/Changelog (https://www.assembla.com/spaces/chdkptp/wiki/Changelog) (in the r658 section) and you need to ensure they are on your LD_LIBRARY_PATH when you run chdkptp.

Quote
And in both cases i ended up to this

Code: [Select]
chdkptp_gui: symbol lookup error: /usr/lib64/libiuplua52.so: undefined symbol: luaL_setfuncs
I'm not really sure the exact cause of this, but incorrect libraries or bad  LD_LIBRARY_PATH seems likely.

ldd is a useful tool for diagnosing these kinds of issues. You can use something like

LD_LIBRARY_PATH=/path/to/iup:/path/to/cd ldd chdkptp_gui


Quote
1.Can't you not implement the linux version using some other "tools"?Qt?Gtk?I am not programmer..i dont know what is needed..
IUP and CD arent even in the official repos :) Atleast in two distros i was messing around.
I haven't had time to improve the existing GUI much, let alone switch to a new framework. I chose IUP and and CD because they make it easy to implement the GUI in Lua, and it is easy to make a GUI that works on both Linux and windows.

You are welcome to implement your own tool, using whatever GUI framework you prefer, re-using as much of chdkptp as you want ;)

Quote
2.Maybe support lua 5.3?So no need to install the older version..maybe to avoid errors or whatever?
I will add official support for this eventually, but again it's a matter of time. I still haven't removed support for 5.1. Every permutation makes things harder to maintain and test.

Waterwingz has reported that 5.3 works, but I wouldn't be surprised if there are some corner cases that behave differently.
Title: Re: Multi-camera setup project.
Post by: mphx on 26 / December / 2015, 20:41:07
Ok i give up :)

I removed ever trace of cd,im,iup
And the system uses lua 5.3

So i did the following (just for the fun).The whole point is to compile everything against lua 5.3

1.Download sources of cd/im/iup.
2.Download sources of chdkptp.
3. CD and IM compiled nicely.IUP had issues..was trying to find lua5.1 despite i tried to "fix" the references in the config files.
4.I installed the above three suckers.
5.Tried to compile chdkptp.Issues all over , mainly with searching the wrong lua version in cd/im/iup.

So i thought to go the easy way.

1. Download binaries of cd/im/iup for lua 5.3 and installed them
2. Tried again to compile chdkptp for lua 5.3 ...no-go.

Somewhere there , i gave up :) Too much effort !

The installation was openSUSE Tumbleweed ..maybe it is a matter of libs version or anything..i cant say..

My thoughts.

1. I believe that creators of im/cd/iup don't give a fck about these anymore.
They are created (pre-built binaries) in very few and specific distros that they are outdated by now.
So if someone wants to compile them from source , he must change some configuration files to make them "look" for newer versions of libs/headers/lua.

In my efforts,  i had to install A WHOLE BUNCH of libs/headers and some of them old versions...because the compiler configuration of these softwares wanted the specific versions.

2.As i said i am not a programmer...so i can't help you at changing framework or anything..i have alot of free time and i can test stuff..but i cant create something :)

I mentioned if it was possible to change framework at some point , because i was messing around with Agisoft Photoscan today...it has win/linux/macos builds.
I checked out the linux version..and it needed like zero libs/headers...pre-built binary..u click it...it works.
Same interface/gui with the windows version.
And from the little things i can understand it uses QT libs for the GUI...
Just throwing ideas here...
Surely photoscan has nothing to do with lua...entirely different program...but just saying :)

3. Another idea that just popped up in my head.

We know that chdkptp needs lua/cd/im/iup .

Is it possible to use a rather updated distro... compile locally lua/cd/im/iup..compile locally chdkptp using locally built lua/cd/im/iup and fix the config files..so the chdkptp binary will use these locally built dependencies ?(dependencies = lua/cd/im/iup)
Wrap all up into a tar.gz and pass it to the people...

So when someone will untar it and tries to use it..there is no need to have all these installed..chdkptp will use them from the same tallbar folders.

You can tell me that maybe this wont work..different compilers/libs and stuff..but if the distro on which the compile was made is pretty good updated..like a bleeding edge distro , maybe then things might work well :)

Just an idea :)


Title: Multi-camera setup project.
Post by: waterwingz on 26 / December / 2015, 22:05:44
FWIW, I seem to recall that there are multiple versions of CD and IUP source available.  Are you sure you are using the same ones that CHDKPTP expects?
Title: Re: Multi-camera setup project.
Post by: reyalp on 26 / December / 2015, 22:25:05
Ok i give up :)

I removed ever trace of cd,im,iup
And the system uses lua 5.3

So i did the following (just for the fun).The whole point is to compile everything against lua 5.3
This is exactly the opposite of what I suggested. Lua is easy to build, and self contained. The other things are not. Therefore, you are much better of using a locally built copy of Lua, and not worrying about what your particular distro decides to provide.

Quote
3. CD and IM compiled nicely.IUP had issues..was trying to find lua5.1 despite i tried to "fix" the references in the config files.
FWIW, I strongly recommend against trying to compile any of the libraries other than Lua yourself. I do it for the raspberry pi builds because there are no precompiled binaries available, but otherwise, I stick to the pre-built ones.

I also strongly suggest using the library versions listed on the changelog.

Quote
1. Download binaries of cd/im/iup for lua 5.3 and installed them
2. Tried again to compile chdkptp for lua 5.3 ...no-go.
#2 should only minor config.mk changes (though as noted before, I won't promise that it actually runs correctly.) So if you can provide more information about what specifically went wrong, I could probably help.

Note you don't really need to "install" the cd and IUP libraries either. Just unzip them somewhere and adjust config.mk (for compiling) and chdkptp.sh (for running)

With the pre-built binaries, did you try downloading the exact versions of IUP listed in the changelog, extracting them, and setting the LD_LIBRARY_PATH in chkdptp.sh to point to where they are extracted?

Quote
2.As i said i am not a programmer...so i can't help you at changing framework or anything..i have alot of free time and i can test stuff..but i cant create something :)
Yeah, and if someone wants to build me a hot-rod, I'll be happy to test drive it ;)
Quote
I mentioned if it was possible to change framework at some point , because i was messing around with Agisoft Photoscan today...it has win/linux/macos builds.
I checked out the linux version..and it needed like zero libs/headers...pre-built binary..u click it...it works.
Same interface/gui with the windows version.
And from the little things i can understand it uses QT libs for the GUI...
Just throwing ideas here...
That's nice. Agisoft has full time employees who are paid to make this kind of thing happen.
Quote
Surely photoscan has nothing to do with lua...entirely different program...but just saying :)
chdkptp is already written in Lua, with a GUI written in Lua and IUP. That may have been the wrong decision, but changing it would be a lot of work. Personally, I have a lot of things I'd rather do than re-write stuff that already works just because you couldn't get it to run on some particular distro.
Quote
Is it possible to use a rather updated distro... compile locally lua/cd/im/iup..compile locally chdkptp using locally built lua/cd/im/iup and fix the config files..so the chdkptp binary will use these locally built dependencies ?(dependencies = lua/cd/im/iup)
...
You can tell me that maybe this wont work..different compilers/libs and stuff..but if the distro on which the compile was made is pretty good updated..like a bleeding edge distro , maybe then things might work well :)
The whole problem is without a lot of research and testing, I can't say what will or will not work.  In general though, stuff built on older distros is more likely to run on newer ones than the reverse. IIRC, the binaries I built on ubuntu 10.04 still ran on 14.04.

I have thought about trying to make a stand-alone binary for the Linux builds. The windows binaries are statically linked, so everything is in the exe. This may be possible on linux too, but I'm not sure how portable the resulting binaries would be.

I know this is frustrating and I would like to make this easier, but my time is limited.
Title: Re: Multi-camera setup project.
Post by: mphx on 27 / December / 2015, 09:07:11
@waterwingz

As i can see , there is only one version of the sources (of im/cd/iup)..and thats logic

For example
http://sourceforge.net/projects/canvasdraw/files/5.9/Docs%20and%20Sources/ (http://sourceforge.net/projects/canvasdraw/files/5.9/Docs%20and%20Sources/)

You see actually only one source package.
On the other hand , there are several pre-built binaries of these packages..and i hope i am picking the right one :)

@reyalp

First of all , just to clear things ...i am not using chdkptp on some linux distro..or want/wish to change the linux version of it.
I am just getting bored from times to times and mess around with "things". :)

After yesterday's failure , i thought to try my luck with Manjaro (Arch-based) since many packages that dont exist on official repos..exist in the community repo (aka https://aur.archlinux.org/ (https://aur.archlinux.org/))

As expected all packages were there

iup -> https://aur.archlinux.org/packages/iup-gtk/ (https://aur.archlinux.org/packages/iup-gtk/)
im ->https://aur.archlinux.org/packages/im/ (https://aur.archlinux.org/packages/im/)
cd -> https://aur.archlinux.org/packages/cd/ (https://aur.archlinux.org/packages/cd/)

with all the necessary dependencies in place and pre-recorded compile/installation steps in the PKGBUILD file.

im and cd compiled and installed correctly...no dramas there.

iup , was a mess..every time iup is the messy one.It uses packages that now are newer versions and different names..and it ends up to some unresolved errors .

So the whole project was once , a fail :)


So i thought to try the other thing i was thinking yesterday...a locally compiled chdkptp with everything in local files.

1. I compiled lua 5.3 locally.
2. I used pre-built binaries of iup/cd/im locally (i dont even know if im is ever used in this scenario...but..its there if needed)
3.Tried to mess around with chdkptp config files..to use lua 5.3 and the local libs/headers of lua/cd/iup.

So after all these..i ended up here

Code: [Select]
gcc -o chdkptp lfs/lfs.o properties.o ptp.o chdkptp.o lbuf.o liveimg.o rawimg.o luautil.o sockutil.o  -g -L./lua-5.3.2/src/ -L./iup-3.17/ -L./cd-5.9/ -liuplua53 -liupluacd53 -lcdlua53 -llua -liupcd -lcd -liup -lusb -lfreetype -lz -lm -ldl -lreadline -lhistory
/usr/bin/ld: cannot find -liupcd
/usr/bin/ld: cannot find -liup
collect2: error: ld returned 1 exit status
Makefile:125: recipe for target 'chdkptp' failed

I am missing something in the config files...i guess...with the name declaration of libs...or something....


Just to mention once again , i am simply messing around with this..no need to lose your sleep over it...:)


EDIT : That link created that really big blank space..can't help it..sorry.
Title: Re: Multi-camera setup project.
Post by: mphx on 27 / December / 2015, 15:12:15
Here again :)

Today , i played with another installation (Ubuntu 15.10)

The whole compiling process was problematic.

So , after alot of tries and alot of "dirty" fixes in the configuration files of almost every package involved (cd/im/iup/chdkptp) i managed to compile a standalone chdkptp.

You can find it in the following link https://www.dropbox.com/s/9wvpk4r905vx70h/chdkptp-r690-standalone.tar.gz?dl=0 (https://www.dropbox.com/s/9wvpk4r905vx70h/chdkptp-r690-standalone.tar.gz?dl=0)

It contains locally compiled im/cd/iup (latest versions) and lua 5.2.
Chdkptp is r690 and it is working well (in a first glance).

I tested it in another linux installation (Manjaro) to check if it is indeed standalone..if it can work in another environment and it worked.

Give it a try :)

Someone could keep the same folders and just use the next versions as they come from reyalp (binary or source)..and it can be transferred and work anywhere ..theoretically.

Compiling all the involved packages was a nightmare..fixes over fixes...so in case someone would like to compile the next version of chdkptp against these pre-compiled packages (cd/im/iup) , it might not be that easy :)
Title: Re: Multi-camera setup project.
Post by: reyalp on 27 / December / 2015, 15:16:06
On the other hand , there are several pre-built binaries of these packages..and i hope i am picking the right one :)
If you go to the file downloads for each project, pretty much every previous version is available, e.g. http://sourceforge.net/projects/iup/files/ (http://sourceforge.net/projects/iup/files/) there is both source and binaries in each version directory. The directory you linked to was the 5.9 subdirectory, so it only has one source.

Quote
After yesterday's failure , i thought to try my luck with Manjaro (Arch-based) since many packages that dont exist on official repos..exist in the community repo (aka https://aur.archlinux.org/ (https://aur.archlinux.org/))
Personally, I'd suggest picking one distro, and working methodically through each problem/error rather than trying stuff and hoping it works.

If you are willing to switch distros, just use ubuntu 14.04 64 bit (later versions and other debian based distros have a good chance of working too), download the pre-built chdkptp binary I provide and the exact libraries listed in the change log. Then all you have to do is edit chdkptp-sample.sh

You should also be able to build with the libraries.

Quote
So i thought to try the other thing i was thinking yesterday...a locally compiled chdkptp with everything in local files.

1. I compiled lua 5.3 locally.
How many times did I advise against using Lua 5.3?!

Quote
Code: [Select]
gcc -o chdkptp lfs/lfs.o properties.o ptp.o chdkptp.o lbuf.o liveimg.o rawimg.o luautil.o sockutil.o  -g -L./lua-5.3.2/src/ -L./iup-3.17/ -L./cd-5.9/ -liuplua53 -liupluacd53 -lcdlua53 -llua -liupcd -lcd -liup -lusb -lfreetype -lz -lm -ldl -lreadline -lhistory
/usr/bin/ld: cannot find -liupcd
/usr/bin/ld: cannot find -liup
collect2: error: ld returned 1 exit status
Makefile:125: recipe for target 'chdkptp' failed
This error means the compiler didn't find those libraries. The most likely causes are:
1) The directories (*_LIB_DIR) are not correct
2) the library names have changed in the version of the libraries you are using. AFAIK recent versions have switched to making seperate libraries for Lua 5.2 and 5.3, which may involve name changes. This kind of thing is the reason I recommend using specific Lua and library versions.

You find out which is the cause by looking for e.g. libiup.so (or maybe libiup.a) in the directories specified by IUP_LIB_DIR etc in config.mk.

FWIW, although it will probably work in this case I would generally avoid using relatives paths (like ./foo) when specifying the library paths, since it will break if the build process uses multiple directories.

edit:
Glad to see you got it working :)

Title: Re: Multi-camera setup project.
Post by: mphx on 27 / December / 2015, 17:09:39
@reyalp

waterwingz said (if i remember well) if i am picking the right source file...

I am just saying , there is only one source file for each package (either im , cd , iup) and multiple pre-built binaries.
I just linked the "cd" source subdirectory to point out exactly this.
Same thing applies to iup and im file list...

About distros..

I am not using linux for primary o/s (i have weird laptop hardware...) , i just have some of them in vmware.
I like trying several , finding the "best" one , the most organized one ..for future use :)
Thats why i am trying things in several distros...just for messing around :)

About lua 5.3

You advised against that alot of times..but i have bleeding edge hardcoded in my dna..its a bad thing sometimes..but...i cant help it :)

About the whole project

I dont think its im/cd/iup 's fault..i think as i said before..the creators of them...dont like to organize things better somehow..
They could easily distribute pre-built binaries packages (rpm,deb etc) , so at some point distros can put them in official repos.
If you try to compile them from source , you see that even if these packages can be compiled for lua5.3 , config files are still written to search previous versions.
Maybe for someone who knows his way around config files its easy task..i was lost at some point..going for one config file to another..searching the spots to change .
Anyways...

About chdkptp

I know you dont have the time to change/optimize something (GUI i mean) that does its job rather well ..or probably you have better things to do..
but i was looking around , and there are several gt/gtk/whaterver with lua extensions out there (e.g. http://wxlua.sourceforge.net/ (http://wxlua.sourceforge.net/)) with  "normal" dependencies than im/cd/iup.
Wish i knew stuff and how to do something about this , but i have no clue about these things :)

Just saying..

About standalone package.

This package i made , probably will work in different environments , although some subfolders there ,are messy..just throwing the files in the places programs were expecting to find them...
But in bottom line..maybe at some point , you can try standalone packages for more flexibility :)
Title: Re: Multi-camera setup project.
Post by: reyalp on 27 / December / 2015, 18:07:40
I am just saying , there is only one source file for each package (either im , cd , iup) and multiple pre-built binaries.
I don't understand the point then? Of course there is only one source package per release ???

What I think waterwingz was trying to say is that you might avoid some problems by using library versions that are already known to work, e.g. IUP 3.10.1 and CD 5.7. You are welcome to try to use newer versions, but you are a far more likely to run into problems.
Quote
You advised against that alot of times..but i have bleeding edge hardcoded in my dna..its a bad thing sometimes..but...i cant help it :)
OK. It's more than a little frustrating for me that you come here and complain about how difficult it is, and then repeatedly ignore advice on how to minimize the difficulty.

I know you've said you are just messing around, but at the same time you keep suggesting I redo the GUI from scratch, which would probably be hundreds of hours of work :blink:
Quote
They could easily distribute pre-built binaries packages (rpm,deb etc) , so at some point distros can put them in official repos.
If you try to compile them from source , you see that even if these packages can be compiled for lua5.3 , config files are still written to search previous versions.
Maybe for someone who knows his way around config files its easy task..i was lost at some point..going for one config file to another..searching the spots to change .
Again, I specifically recommended against trying to build them yourself.

Maybe I've just been lucky, but all I've ever had to do with the IUP/CD pre-built binaries is download, unpack, and adjust the chdkptp makefile and LD_LIBRARY_PATH to point at them. Sometimes adjustments are needed between versions, which is why I recommend using specific versions I've tested.

I will consider making full packages for future releases.
Title: Re: Multi-camera setup project.
Post by: Kam_mim on 03 / March / 2016, 07:06:10
@reyalp

1. Zoom -
So an idea popped to issue a set_aflock(1) before set_zoom..and TAAA-DAAA ..lens moved!
And i created another button in the GUI , with exactly what you said.. !mc:cmd('call ... your lua code').Worked like a charm.

I've been following this thread but I can't understand this...
can you tell me what you did step by step for this zoom command, I really dont understand how to zoom all cameras with chdkptp multicam



Hi elizabeth.m
Can you share the lua scripts for CHDKPTP GUI and if possible, how to create buttons and link them to commands.


I'm testing multiple camera setup through command line (Windows) and would be happy if I can create a GUI.
Title: Re: Multi-camera setup project.
Post by: mphx on 19 / June / 2016, 20:40:32
Hey all ,


@reyalp


We are facing a tiny problem in our project..not exactly a problem but we'd like something to be done differently and i'd like your input on it.


We have set the cameras to shoot twice in a 5sec time frame with the command


Code: [Select]
mc:shoot{shots=2,interval=5000,synctime=100}

We tried to lower the time as much as possible , but from a point and beyond cameras are losing their sync.So the lower it can go is 5 secs (for the Canon A2500)


We are experiencing with some Canon ixus 160 , and while we dont have many , so we cant be sure about our test results -one thing to test times in 2-3 cameras and another in >60)..we noticed that ixus 160 can shoot "faster"


So my question is , how can we lower the multiple shooting times ?
I am guessing that at some point its all about hardware...but i noticed and correct me if i am wrong that the above command , does a "preshoot" before every shoot...so maybe somewhere there time is lost.


Is it possible to issue only one preshoot to all cameras and a "shoot" command that does simply that...shooting..without checking anything...just...shoots?
Can it be done by putting cameras into continuous mode and do something like :


1. preshoot
2. shoot_pressed_on (continuous mode will force cameras to shoot as fast as possible as this state is on)
3. shoot_pressed_off (cameras stops shooting)


We just want multiple shoots..synced in as little possible time...


Thanks in advanced for any input on this matter.
Title: Re: Multi-camera setup project.
Post by: reyalp on 19 / June / 2016, 21:55:15
We have set the cameras to shoot twice in a 5sec time frame with the command

Code: [Select]
mc:shoot{shots=2,interval=5000,synctime=100}
We tried to lower the time as much as possible , but from a point and beyond cameras are losing their sync.So the lower it can go is 5 secs (for the Canon A2500)


We are experiencing with some Canon ixus 160 , and while we dont have many , so we cant be sure about our test results -one thing to test times in 2-3 cameras and another in >60)..we noticed that ixus 160 can shoot "faster"


So my question is , how can we lower the multiple shooting times ?
I am guessing that at some point its all about hardware...but i noticed and correct me if i am wrong that the above command , does a "preshoot" before every shoot...so maybe somewhere there time is lost.
If it's working correctly, the mc:shoot() command should only pre-shoot once, not for every exposure. If shots is more than 1, it should keep half shoot held down and click shoot_full_only for each shot.

It could be modified to use continuous mode (holding down shoot_full_only and using hooks to control interval), but on low end cameras like a2500 I suspect this would not make much difference.

5 seconds seems very slow, unless you are shooting raw.

It really shouldn't matter how many cameras there are, because after the first shot each camera is just running on it's own: The first shot is synced, the remaining shots are just at the previous shot time +interval

It seems like we had a discussion like this before https://chdk.setepontos.com/index.php?topic=11667.msg124809#msg124809 without any real solution.

It's possible there are bugs in the shoot_burst logic. It seems to work for me with one camera, but really testing it probably requires adding some debug code.
Title: Re: Multi-camera setup project.
Post by: mphx on 19 / June / 2016, 22:20:28
@reyalp


First of all we are not shooting raw.
5secs is slow...and if we lower it , we hear the shooting clicks getting out of sync.At 5secs the "clicks" are all synced.Someone could think that "hearing" isn't a sure confirmation.But it is..photos are not synced judging from the result since in some of them the person has moved....so the photos were not synced.


Thing is that in between the two shots we project a pattern to the person being shot (pattern from projectors).And i wonder if the change in brightness produced by this pattern causes the cameras to re-focus or re-adjust iso/exposure and stuff like this (although we setup these values before every shoot)..so it wastes time..I may saying stupid things here...


And as i mentioned  before , ixus 160 shoots faster than a2500 ..maybe its partially a hardware limitation...of how fast can the camera shoot.


Anyways if we can't find a solution to lead us to shoot only once (not going to happen any time soon as long as we have cheap compact cameras) , fast multiple shooting will be always an issue.


EDIT : now that i am thinking of it , you are right ...preshoots only once and then shoots as many times as it has been set up.I have seen that camera struggles during multiple shots.What i mean by struggle is that shoots-photo taken remains for msecs in display-it goes back to rec mode display-shoots the next one.Something like that.
So its all going down to how fast the 2 steps (photo taken remains-go back to rec mode display) are happening.
I saw that in ixus 160 , this whole thing goes down faster than a2500 , thats why i said that partially maybe its a hardware thing/limitation since as you said after the first shot camera is running on its own...
Title: Re: Multi-camera setup project.
Post by: reyalp on 19 / June / 2016, 22:52:21
Thing is that in between the two shots we project a pattern to the person being shot (pattern from projectors).And i wonder if the change in brightness produced by this pattern causes the cameras to re-focus or re-adjust iso/exposure and stuff like this (although we setup these values before every shoot)..so it wastes time..I may saying stupid things here...
If the script is working, half press is held down and none of these things should be updated between shots.

Quote
And as i mentioned  before , ixus 160 shoots faster than a2500 ..maybe its partially a hardware limitation...of how fast can the camera shoot.
It is extremely unlikely that a2500 can only sustain 1 shot every 5 seconds.
According to the specs, it can do 0.8 FPS in continuous mode. On most low end cams, holding half shoot and clicking full gives similar performance. It might be a bit slower, but should not be ~4x worse.

As I mentioned before, having multiple cameras should not affect performance. Testing what rate a single a2500 can sustain would be a good place to start. I'll see if I can come up with a simple script to check this.

Quote
I have seen that camera struggles during multiple shots.What i mean by struggle is that shoots-photo taken remains for msecs in display-it goes back to rec mode display-shoots the next one.Something like that.
Is "review" enabled in the canon menu?

Title: Re: Multi-camera setup project.
Post by: mphx on 19 / June / 2016, 23:14:57


As I mentioned before, having multiple cameras should not affect performance. Testing what rate a single a2500 can sustain would be a good place to start. I'll see if I can come up with a simple script to check this.

That would be an interesting script.

Quote
Is "review" enabled in the canon menu?


I am not following you here..when you say canon menu you mean the menu camera has or some chdk menu ?


The operation of the cameras is straightforward to be honest... connect-sync-getting them to rec mode-setting exposure/iso values-shooting
At the end of the day downloading/deleting files/shutdown.


We haven't messed with any menus of the cameras or chdk menus..except for some power saving setting..you know retract lens off  , display always on and flash off.
Things i dont think will have to do anything with our "little problem" here.



Title: Re: Multi-camera setup project.
Post by: reyalp on 20 / June / 2016, 00:12:38
Quote
Is "review" enabled in the canon menu?


I am not following you here..when you say canon menu you mean the menu camera has or some chdk menu ?
In the regular canon settings menu, when you press the menu key in shooting mode, there's an option called "review" which keeps the last shot image on screen for some time. It should be "off" for your purposes.
Title: Re: Multi-camera setup project.
Post by: mphx on 20 / June / 2016, 05:24:39
Quote
Is "review" enabled in the canon menu?


I am not following you here..when you say canon menu you mean the menu camera has or some chdk menu ?
In the regular canon settings menu, when you press the menu key in shooting mode, there's an option called "review" which keeps the last shot image on screen for some time. It should be "off" for your purposes.


I found that menu in a ixus 160 i have in my house .I set it to off and set the camera to shoot 2 shots in like 1000msecs , even 500msecs....No problems.


As you said , after the first synced shot , next one , is irrelevant of the number of the cameras , since each camera is shooting by itself.I have no argument here , but still i don't understand why A2500s are losing "sync" at the second shot if i lower msecs.Since first shot is synced , second one should be too.


Anyways i have to check A2500s' menu at studio to see what's the setting of "review" ..that would be a pain in the [admin: avoid swearing please] to change the setting to all of them :)
Title: Re: Multi-camera setup project.
Post by: reyalp on 20 / June / 2016, 16:27:56
Anyways i have to check A2500s' menu at studio to see what's the setting of "review" ..that would be a pain in the [admin: avoid swearing please] to change the setting to all of them :)
You may be able to set this from script using http://chdk.wikia.com/wiki/User:Srsa_4c/UI_properties
Title: Re: Multi-camera setup project.
Post by: mphx on 21 / June / 2016, 17:47:59
@reyalp


Update on the situation :


We did a test with four A2500...we disable anything that could interfere while shooting... review image while shooting and/or any power saving setting.


We set the time between the 2 shots around to 1500 msecs (0.8 shots/sec in continuous mode is around 1 shot every 1.25 sec)


First "double shot" was spot on.Both synced..then hell got loosed.Shots were all over the place..it never worked again.


We did the same test with two ixus 160 , same result.First 1-2 "double" shots were accurate as hell.Then they got lost..not as much as A2500 , but u could hear the clicks not "hitting" at the exact same time (i am always referring to "second shots")...ofc every "first" shot was synced .


As we were increasing the msecs...from 1500 to up 5000 , sync of the second shots was getting more and more synced.


Since as you said second shot is being "run" independently and not influenced by  the numbers of the cameras...and since the first shots were always synced...results of the above tests can be considered at least weird :)


I am sensing we are missing some factor that interferes to shooting...
Title: Re: Multi-camera setup project.
Post by: reyalp on 21 / June / 2016, 22:17:48
We set the time between the 2 shots around to 1500 msecs (0.8 shots/sec in continuous mode is around 1 shot every 1.25 sec)

First "double shot" was spot on.Both synced..then hell got loosed.Shots were all over the place..it never worked again.
This sounds like a bug of some kind, but I really have no idea what could cause it. There really shouldn't be much difference between the first call to mc:shoot() and subsequent calls. Knowing the exact sequence of commands you used might help.
Title: Re: Multi-camera setup project.
Post by: mphx on 21 / June / 2016, 22:34:21
@reyalp


After the initial connect


Code: [Select]
     mc=require('multicam')
      mc:connect({list=true})
      mc:start()
      mc:cmd('id')
      return mc:cmdwait('rec')


and sync


Code: [Select]
mc:init_sync()

we just execute


Code: [Select]
mc:shoot{shots=2,interval=5000,synctime=100}

for a double shot


nothing fancy..rest functions are "preshoot" and "shoot_hook_sync" in various combinations for single shots...no problem there.Shots (when are single ones are always synced).


Maybe there is something to do with "synctime"?or the shoot() command itself?


Ixus 160 lost sync in second shot after 2-3 double shots..and i had to raise to around 3000msecs...below that de-syncing was starting.
As i was told since i wasnt present in A2500 testing , cameras there were too messy..clicks were all over the place..ixus 160 were losing sync..but the clicks were close to each other (maybe if they were more than two , would behave like A2500...who knows..we dont have more ixus unfortunately)
The test with A2500 were with 4 cameras.



PS : Whats wrong with "code" button ..when i press it , it goes in reverse ..slash in the first bracketed code..not the second...just saying...
Title: Re: Multi-camera setup project.
Post by: mphx on 23 / June / 2016, 03:39:30
@reyalp


Another thing i wanted to ask , not related with the issue we are discussing in the last few posts.


Imagine the following scenario.


PC1 - camera rig - chdkptp , PC2-chdkptp


User on PC1 , operates the rig.At the end of the day downloads photos from the camera.So far so good.
Scenario wants this user to NOT be able to manipulate downloaded photos.
Photos are being transferred to PC2 and this user now can do whatever he wants with the photos.


So the question is , can chdkptp implement an encrypt/decrypt function?Encrypt somehow the photos when it copies them to disk and decrypt them with some command in order to be "readable" from windows.
Or some kind of different levels of use of the program with the use of "users"?Login to program with different users with different "privileges"?Or something like that...


Just asking if there is the capability to implement such things ...


Thing is that we are about to set up a new rig for a client , and the deal will be that he will send us the photos of every shoot for "modelling"...for some period of time.
We don't want him to have direct access to photos so he can get into the temptation to send the photos to someone else and not us.He will be in another country so we cant "control" what he will do with the photos if he has access to them.


Thanks in advance...again.
Title: Re: Multi-camera setup project.
Post by: reyalp on 23 / June / 2016, 16:48:35
So the question is , can chdkptp implement an encrypt/decrypt function?Encrypt somehow the photos when it copies them to disk and decrypt them with some command in order to be "readable" from windows.
This is certainly not something I would spend time implementing. There's enough DRM in the world already, and I have other more fun things I'd prefer to work on ;)

A secure solution would be difficult if not impossible, since they still control the cameras. You might be able to implement something outside of chdkptp that makes it slightly less easy for a person without much knowledge to access the images, but I'm not going to spend time thinking about how one would do that.

One could theoretically modify chdkptp to encrypt the files on download, but please remember that chkdptp is licensed under the GPL, so if you modify it, you must make the source available to anyone you provide your modified program to.

Regarding your problem with burst shooting:
I'm still thinking about it, I just had some stuff come up that doesn't leave me with much time for CHDK. Maybe after the weekend I'll have something to test.

Quote
PS : Whats wrong with "code" button ..when i press it , it goes in reverse ..slash in the first bracketed code..not the second...just saying...
I have the WYSIWYG editor turned off in my profile and just type the code tags manually.
Title: Re: Multi-camera setup project.
Post by: mphx on 23 / June / 2016, 19:55:44

A secure solution would be difficult if not impossible, since they still control the cameras.
True , the solution of lets say securing the use of photos wont be entirely bulletproof..because as you said , they will still control the cameras...BUT , what will be left to do?Pull out around 80-100 sd cards and copy the photos?I don't think they will go into such trouble.
I am thinking about downloading photos directly to some cloud directory or ftp server or something...still working on that ...

Quote
One could theoretically modify chdkptp to encrypt the files on download, but please remember that chkdptp is licensed under the GPL, so if you modify it, you must make the source available to anyone you provide your modified program to.


I dont think we have the knowledge to mess around with source , but if we will do , we will respect GPL license..i dont think the client will sit and search the source of chdkptp :)

Quote
Regarding your problem with burst shooting:
I'm still thinking about it, I just had some stuff come up that doesn't leave me with much time for CHDK. Maybe after the weekend I'll have something to test.


Any input on it will be much appreciated and useful.



Another thing that came up.Between the two shots we are issuing , we manually turn on and off a pattern projected from a series of projectors (projectors that are linked together and the last one is connected to a second pc).


I recently found out that someone can issue commands through the serial port of these projectors..either with python scripts or simply by creating plain text files with the desired commands and "copying" these texts over the serial port of the projector.


Question is , can we use some way and issue these commands (with any way i dont really care which one) through chdkptp ?


To get an idea how these commands are look like check pages 65-68 in the following file https://www.dropbox.com/s/m6fruwfiwsbotln/GT760-M-en.pdf?dl=0 (https://www.dropbox.com/s/m6fruwfiwsbotln/GT760-M-en.pdf?dl=0)




Thanks again
Title: Re: Multi-camera setup project.
Post by: reyalp on 23 / June / 2016, 20:32:34
I recently found out that someone can issue commands through the serial port of these projectors..either with python scripts or simply by creating plain text files with the desired commands and "copying" these texts over the serial port of the projector.

Question is , can we use some way and issue these commands (with any way i dont really care which one) through chdkptp ?
chdkptp can execute external commands with the normal lua os.execute function (http://www.lua.org/manual/5.2/manual.html#6.9). So if you have a python script or whatever that sends the commands, you could just run that.
On some OSes you might also be able to write to the serial port using regular lua IO calls.
Title: Re: Multi-camera setup project.
Post by: reyalp on 26 / June / 2016, 20:28:05
Quote
Regarding your problem with burst shooting:
I'm still thinking about it, I just had some stuff come up that doesn't leave me with much time for CHDK. Maybe after the weekend I'll have something to test.
Any input on it will be much appreciated and useful.
To test shooting rate using on a single camera without involving PTP, you can use my fixedint.lua script
http://chdk.wikia.com/wiki/Lua/Scripts:_Fixed_Exposure_Intervalometer

Doing this should give a good idea what your cameras are capable of sustaining. If the result is much different from what you see with multicam burst, there is likely a bug somewhere.

To test, upload the script and run it on the camera without PTP connect, using the following settings in the script menu
Shots 10
Interval 0
User raw no
Tv 1/64 (not 64)
Use cont mode if set (unchecked)
Log mode Append

Other settings can be left on default values.

Run the script again with "use cont mode if set" and continuous mode enabled in the Canon UI.

When you run the script, it will create (or append to) a log file called fixedint.csv in the root of the SD card. With interval set to 0, the "sleep" column will give you the negative of the time between shots. Please upload the log here.

Title: Re: Multi-camera setup project.
Post by: mphx on 26 / June / 2016, 23:12:47
Hey ,


Right now i have 2 x ixus 160 in my home and i can test it. Theoritically under the same setup , A2500 should perfom more or less the same since they have the same specs (0.8 shoots per second).


So (in theory) the two ixus i have here , must perform (when they are in ptp connection and having the same setup) with the times that the one of them did with this script...riiiiight?


The results are .. https://www.dropbox.com/s/bq9r95xoqdhdd4d/fixedint.csv?dl=0 (https://www.dropbox.com/s/bq9r95xoqdhdd4d/fixedint.csv?dl=0)


So if i get this right.. a rig of x ixus can go as low as ~1.7-1.8 secs between shots regardless the number of them ?(of the cameras)
Always in theory...
Title: Re: Multi-camera setup project.
Post by: reyalp on 26 / June / 2016, 23:45:30
Right now i have 2 x ixus 160 in my home and i can test it. Theoritically under the same setup , A2500 should perfom more or less the same since they have the same specs (0.8 shoots per second).
In theory, but I would highly recommend testing using the actual camera and cards used in the rig
Quote
So if i get this right.. a rig of x ixus can go as low as ~1.7-1.8 secs between shots regardless the number of them ?(of the cameras)
Always in theory...
If you want sync, the interval has to be longer than the longest time, so in practice you'd want some margin. I'd guess 2 seconds should be achievable, though you might find there are longer outliers with a bigger sample size than 10. It may also depend on the SD card, beyond just the "class" speed, they have wear leveling and garbage collection logic that can cause unpredictable performance.

It looks like adding continuous mode saves roughly 200ms, so adding support for that in multicam would let you go a bit shorter on this camera. I'm working on this along with some other changes that will give us timing information.
Title: Re: Multi-camera setup project.
Post by: reyalp on 27 / June / 2016, 02:10:46
I checked in some changes to multicam.lua

It now records timing information. To see this, use
!mc.verbose=true
before sending !mc:shoot
For each camera, there will be a line in the status
  msg="1 w:368 i=0, 2 w:1068 i=2000, 3 w:1048 i=2000, 4 w:1058 i=2000",
The first number is the shot number
w is the amount of time waited for the shot. i is the amount of time between shots.

If w is negative for the first shot it means synctime was too low. For subsequent shots, it means the interval is too low. If everything is working, i should be within a few 10s of ms of the interval.

I also added support for continuous mode. It will be used by default if continuous shooting is enabled in the Canon UI. To turn it off, you can send cont=false in the mc:shoot options.

Testing with 4 cameras (a540, d10, elph130 and sx160) an interval of 2 seconds seemed to work fine for me, although I only used a online stopwatch page to check sync so it wasn't very rigorous.
Title: Re: Multi-camera setup project.
Post by: mphx on 27 / June / 2016, 04:14:41
ok i did a test with 2x ixus 160 (continuous mode off / interval 2000msecs)


msg="1 w:45 i=0, 2 w:115 i=2000" (camera #1)


msg="1 w:50 i=0, 2 w:130 i=2000" (camera #2)


These numbers change very little during the shooting .Shots "sound" synced .I used like 20-30 shots to test it extensively.


I can say that 2000msecs is a safe interval.How sure we are that this interval will work the same way with more cameras (with the same configuration apparently)?
Theoritically it should work..right?


EDIT:


Lets say i want to change "review image after shooting" parameter to all cameras in the studio.
Reading http://chdk.wikia.com/wiki/User:Srsa_4c/UI_properties (http://chdk.wikia.com/wiki/User:Srsa_4c/UI_properties) and the thread , i cant say i understood everything :)


As far as i can tell i need two things :

1. Address of the function i need to change.
2. The actual command to do the change.

For ixus 160 i found the address , someone in that thread had mapped ixus 160 functions.So how do i change function's values through chdkptp?Just to test that it works.

If i want to do the same for A2500s in the studio how can i find the address of the function , since i assume it would be different from the one , ixus 160 has.

Thanks
Title: Re: Multi-camera setup project.
Post by: reyalp on 27 / June / 2016, 22:57:19
I can say that 2000msecs is a safe interval.How sure we are that this interval will work the same way with more cameras (with the same configuration apparently)?
Theoritically it should work..right?
In theory.

Quote
1. Address of the function i need to change.
2. The actual command to do the change.
You need the ID of the UI property, and the values. To change it, you can use the eventprocs mentioned in the forum thread.

To find the ID and values
In the debug menu, set the "ALT +/- debug action" to CmpUIP
enter alt and press the debug key
leave alt and change the setting
enter alt and press the debug key again
The differences in UI prop values will be displayed

The debug key is port specific. It should be shown in the alt help screen.

However, on D10, review time doesn't appear to be a UI prop. It does appear to be one (ID 129) on ixus140_elph130, which was released much closer to a2500.
Title: Re: Multi-camera setup project.
Post by: mphx on 28 / June / 2016, 04:31:25
I can say that 2000msecs is a safe interval.How sure we are that this interval will work the same way with more cameras (with the same configuration apparently)?
Theoritically it should work..right?
In theory.

Quote
1. Address of the function i need to change.
2. The actual command to do the change.
You need the ID of the UI property, and the values. To change it, you can use the eventprocs mentioned in the forum thread.

To find the ID and values
In the debug menu, set the "ALT +/- debug action" to CmpUIP
enter alt and press the debug key
leave alt and change the setting
enter alt and press the debug key again
The differences in UI prop values will be displayed

The debug key is port specific. It should be shown in the alt help screen.

However, on D10, review time doesn't appear to be a UI prop. It does appear to be one (ID 129) on ixus140_elph130, which was released much closer to a2500.


call_event_proc("PTM_SetCurrentItem",0x800c,0) didn't work with the 2 ixus at home (where 0x800c and value i put the correct ones ofc).Unless the syntax is different than the above and i don't know it :)
(And by "didn't work" i mean the command produced error , it didnt get through to the cameras , i can copy/paste the error when i get back home and repeat it)

I will follow the steps u mention for finding out the exact address in A2500s (if the specific function  has an address in this camera) and see what happens.

EDIT : it seems i am losing something as far as A2500 is concerned.I dont find any reference about "debug key" in alt help menu.Check the photo below (not the best but u can see what it displays :P )

https://www.dropbox.com/s/hl05ycl3mhazrih/20160628_121350.jpg?dl=0 (https://www.dropbox.com/s/hl05ycl3mhazrih/20160628_121350.jpg?dl=0)

Maybe its chdk-version related?A2500s run chdk 1.3.0

EDIT 2 :

I changed manually the settings of 8x A2500s to "play" with the intervals.At 2000msecs 1-2 double shots were synced , the rest not.At 2500msecs , same result.Some synced , some not.
Title: Re: Multi-camera setup project.
Post by: reyalp on 28 / June / 2016, 13:46:17
call_event_proc("PTM_SetCurrentItem",0x800c,0) didn't work with the 2 ixus at home (where 0x800c and value i put the correct ones ofc).Unless the syntax is different than the above and i don't know it :)
(And by "didn't work" i mean the command produced error , it didnt get through to the cameras , i can copy/paste the error when i get back home and repeat it)
If there was an error message, that probably means you didn't use the correct syntax to send the command. Assuming you doing this with regular chdkptp (not through multicam) you should use something like
Code: [Select]
=return call_event_proc("PTM_SetCurrentItem",0x800c,0)
Note that you have to call the eventproc registration function first (once after startup, not before every PTM_* call), like
Code: [Select]
=return call_event_proc("UI.CreatePublic")
For both of these, if the return value is -1, the function doesn't exist or isn't registered.

Quote
it seems i am losing something as far as A2500 is concerned.I dont find any reference about "debug key" in alt help menu.Check the photo below (not the best but u can see what it displays :P )
It's there in your photo: DISP Alt +/- Debug action

Quote
I changed manually the settings of 8x A2500s to "play" with the intervals.
I would suggest starting with just one or two. As I've said before, there really shouldn't be a difference, and it will be easier to keep track of the results.
Quote
At 2000msecs 1-2 double shots were synced , the rest not.At 2500msecs , same result.Some synced , some not.
Were you using the most recent multicam.lua?
What were the status values?
Have you run fixedint.lua on one of these cameras?
Title: Re: Multi-camera setup project.
Post by: mphx on 28 / June / 2016, 15:39:18
Code: [Select]
=return call_event_proc("UI.CreatePublic")
and

Code: [Select]
=return call_event_proc("PTM_SetCurrentItem",0x800c,0)
did the trick AFTER

1.I enabled "native lua calls" on the cameras .

2.I single-connected the camera to chdkptp (not using multicam).


But the idea was , to change the setting on all A2500s at the same time.If i have to connect each one of them , one by one , is pointless :)


[quote]It's there in your photo: DISP Alt +/- Debug action
Ok , seriously i feel dumb , what is the debug key according to this ? :)

Quote
I would suggest starting with just one or two. As I've said before, there really shouldn't be a difference, and it will be easier to keep track of the results.
We had tested 4 of them , and the results were more or less the same.
One thing i noticed today when i was testing the 8 A2500s was that , if the cameras were idle for some minutes , shots were synced (i am always referring to second shots).
When i was doing some other action e.g. deleting photos and then issuing double shot right after ,shots were out of sync...
Maybe my imagination maybe not.Like , cameras were occupied from previous "job" and when i was issuing shooting commands they weren't able to execute them correctly...
Cameras (those 8 )  had the exact same settings (i set them up manually).

Quote

Were you using the most recent multicam.lua?
What were the status values?Have you run fixedint.lua on one of these cameras?


Nope , there were some shootings the last days , didn't want to mess up with multicam or any other file.
So for your next 2 questions the answers are obvious...no status values , no running fixedint.lua.

Thing is that we are about to setup a rig with ixus 160.So we are more concerned about ixus and the lowest times they can achieve , than A2500s.
Achieving a lower time than the current 5secs with A2500s is secondary thing ..but ofc we'd like to lower their time too at some point.Testing with them is a bit delicate matter since its "production" rig and i wouldn't like to fck it up while shooting is pending
:)
Title: Re: Multi-camera setup project.
Post by: reyalp on 28 / June / 2016, 15:56:32
Code: [Select]
=return call_event_proc("UI.CreatePublic")and
Code: [Select]
=return call_event_proc("PTM_SetCurrentItem",0x800c,0)did the trick AFTER
1.I enabled "native lua calls" on the cameras
2.I single-connected the camera to chdkptp (not using multicam)


But the idea was , to change the setting on all A2500s at the same time.If i have to connect each one of them , one by one , is pointless :)
I didn't say this was the *only* way to do this.
To enable native calls, you will probably have to set it on one camera through the UI, then upload the CFG to the remaining cameras.

To call the event procs using multicam, you can use the the regular mc:cmd('call ...')
Once you know the right sequence, you don't need to check the return values.

Quote
Quote
It's there in your photo: DISP Alt +/- Debug action
Ok , seriously i feel dumb , what is the debug key according to this ? :)
The DISP key.
However, from the internet it appears DISP is not a standlone key, but instead is on the down arrow. So the "debug shortcut" may not be accessible (I'm not certain, it's possible DOWN works). This is a bug, if true.

Quote
Nope , there were some shootings the last days , didn't want to mess up with multicam or any other file.
So for your next 2 questions the answers are obvious...no status values , no running fixedint.lua.
Then this test didn't really tell you much, except that the problem wasn't all due to the review setting. If you want to *fix* the problem, you need to do the testing.

Quote
Testing with them is a bit delicate matter since its "production" rig and i wouldn't like to fck it up while shooting is pending :)
Hence my suggestion to use only one or two cameras...

Anyway:

fixedint is a standalone script, so will have no impact on multicam usage.

multicam.lua is purely client side, you can leave your existing chdkptp setup alone, and run an entirely new install from a different directory.

edit:
I do understand the desire not to mess with production system.
Title: Re: Multi-camera setup project.
Post by: mphx on 28 / June / 2016, 16:26:58
Yeap , i know , i need to run fixedint script to alteast 1-2 A2500s , to see their times.


Then i can mess up with "review picture after shooting" , native lua calls or any other setting.


Theory says A2500s *must* have more or less the same times with ixus 160 , since they have the same specs regarding *shots/per sec*.But having different hardware/firmware times may vary.
Will try to do some tests tomorrow.

EDIT : i am all about messing with the rig , my friend who really owns it  , is not :P
Title: Re: Multi-camera setup project.
Post by: reyalp on 28 / June / 2016, 17:17:30
Theory says A2500s *must* have more or less the same times with ixus 160 , since they have the same specs regarding *shots/per sec*.But having different hardware/firmware times may vary.
It should be in the same ballpark if the specs are the same, but there might be other factors like SD card or camera settings. ISO is one setting to watch out for, high ISOs can add a significant amount of processing time. (I'd guess you use low ISO for the rig anyway?)

Quote
EDIT : i am all about messing with the rig , my friend who really owns it  , is not :P
Seems like it would be worth having a couple of "spare" cameras of the same type used in the rig.
Title: Re: Multi-camera setup project.
Post by: mphx on 28 / June / 2016, 19:17:50
As i check my multicam "buttons" i see that we set exposure time and we leave ISO "free".
Checking a couple of old shots , ISO never gets high , its either 100 or 200.
Maybe its time we set it in a fixed number...we will think about it..


Well , plan was to get some spare A2500s , in case some cameras needed replacement or just for testing purposes.
But market here is ridiculous..we had to get most of them from amazon/ebay. Whole country didn't have more than ~20 pieces.It was end of line for A2500s too and was very difficult to find any more.
Same thing is happening now with ixus 160.I wonder how we are gonna get them for the new rig we are going to set up.That would be fun :)
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 29 / June / 2016, 05:21:34
To enable native calls, you will probably have to set it on one camera through the UI, then upload the CFG to the remaining cameras.

In case it could be useful, I used Dave Mitchell's (Zeno's) CFG editor last year - found a little glitch which he quickly fixed. Situation specific it's a super little tool http://zenoshrdlu.com/cfgedit/chdkcfgedit.html (http://zenoshrdlu.com/cfgedit/chdkcfgedit.html)
Title: Re: Multi-camera setup project.
Post by: cdg on 28 / September / 2016, 22:53:49
@reyalp


First of all we are not shooting raw.
5secs is slow...and if we lower it , we hear the shooting clicks getting out of sync.At 5secs the "clicks" are all synced.Someone could think that "hearing" isn't a sure confirmation.But it is..photos are not synced judging from the result since in some of them the person has moved....so the photos were not synced.


Thing is that in between the two shots we project a pattern to the person being shot (pattern from projectors).And i wonder if the change in brightness produced by this pattern causes the cameras to re-focus or re-adjust iso/exposure and stuff like this (although we setup these values before every shoot)..so it wastes time..I may saying stupid things here...


And as i mentioned  before , ixus 160 shoots faster than a2500 ..maybe its partially a hardware limitation...of how fast can the camera shoot.


Anyways if we can't find a solution to lead us to shoot only once (not going to happen any time soon as long as we have cheap compact cameras) , fast multiple shooting will be always an issue.


EDIT : now that i am thinking of it , you are right ...preshoots only once and then shoots as many times as it has been set up.I have seen that camera struggles during multiple shots.What i mean by struggle is that shoots-photo taken remains for msecs in display-it goes back to rec mode display-shoots the next one.Something like that.
So its all going down to how fast the 2 steps (photo taken remains-go back to rec mode display) are happening.
I saw that in ixus 160 , this whole thing goes down faster than a2500 , thats why i said that partially maybe its a hardware thing/limitation since as you said after the first shot camera is running on its own...
@mphx
Why you need to project a pattern to the person being shot ?
Title: Re: Multi-camera setup project.
Post by: waterwingz on 28 / September / 2016, 23:35:59
Why you need to ...

@cdg  : if looks like you formatted part of  your response with very small font that makes it unreadable for most of us.  I think what you were trying to say was :

Quote
Why you need to project a pattern to the person being shot ?

Edit : in case you don't get a response as the formatting of your questions made it unreadable,  the pattern is projected to allow post processing of any resulting 3D image. How that post processing is done is complicated - more so than than my response implies.
Title: Re: Multi-camera setup project.
Post by: mphx on 29 / September / 2016, 07:55:54
Its all about how Agisoft Photoscan (or any other software of this kind) works.


Photoscan produces a rough 3d model from a series of images.In order to do so , it tries to find common "points" in the images so it can calculate/guess the depth of the things in the images.
So , by projecting a pattern into the thing/person we are shooting , we just put more "points" for the Photoscan to find.
As a result , the produced 3d model , is very smooth , and the post-3d-processing is minimal.


Believe me when i say , if someone wears black/white/one-colored clothes or something that shines ...the model is a real mess...gaps everywhere , gaps we have to "close" by hand..not good.



Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 30 / September / 2016, 02:54:21
@cdg
For DSLR  & DLP projector combination - details were provided by Magnus in this thread:


http://www.agisoft.com/forum/index.php?topic=1324.0 (http://www.agisoft.com/forum/index.php?topic=1324.0)


With his multiple DLP projectors continuously running, he:


simultaneously triggered a group of Canon DSLR and Nikon DSLR. He took advantage of the shorter shutter lag of the Nikons to get all their shutters open & closed in 5ms and fire multiple off camera flash before the Canons' had opened their shutters:


Simultaneously he

My memory is he had all camera remote shutter release wires (Canon & Nikon) simply connected together with splitters and a radio transmitter on one of the D3200 to trigger several off camera flash.


The benefits were impressive and described here:
http://www.agisoft.com/forum/index.php?topic=1324.msg6668#msg6668 (http://www.agisoft.com/forum/index.php?topic=1324.msg6668#msg6668)


"This first one was shot just with flash and as you can see it got 15877 points."

Then
"This next one we used the projectors too and this is what we got, 45733 points"

Based on this https://chdk.setepontos.com/index.php?topic=8312.msg107601#msg107601 (https://chdk.setepontos.com/index.php?topic=8312.msg107601#msg107601), it seems very unlikely to get all the "shutters" on a large bank of chdk cameras open and closed in a 5ms period - maybe 40ms, but that amount of dlp projected noise would probably adversely affect the flash texture capture.


To do this somewhere nearly as quickly (Edit1: maybe around 80ms across two separate banks of cameras) as the process that Magnus described using chdk cameras it therefore seems likely that the noise pattern must be projected using flash e.g. http://www.agisoft.com/forum/index.php?topic=1542.msg7960#msg7960 (http://www.agisoft.com/forum/index.php?topic=1542.msg7960#msg7960)


Edit2: I don't know how long the period was between the last Nikon shutter closing and the last Canon shutter opening so I don't know how long Magnus's 2 stage capture took from start to finish.
Title: Re: Multi-camera setup project.
Post by: cdg on 11 / October / 2016, 20:51:46
Why you need to ...

@cdg  : if looks like you formatted part of  your response with very small font that makes it unreadable for most of us.  I think what you were trying to say was :

Quote
Why you need to project a pattern to the person being shot ?

Edit : in case you don't get a response as the formatting of your questions made it unreadable,  the pattern is projected to allow post processing of any resulting 3D image. How that post processing is done is complicated - more so than than my response implies.
Sorry for the unreadable trouble :lol :lol [size=78%]. [/size]
Title: Re: Multi-camera setup project.
Post by: cdg on 11 / October / 2016, 20:56:04
Its all about how Agisoft Photoscan (or any other software of this kind) works.


Photoscan produces a rough 3d model from a series of images.In order to do so , it tries to find common "points" in the images so it can calculate/guess the depth of the things in the images.
So , by projecting a pattern into the thing/person we are shooting , we just put more "points" for the Photoscan to find.
As a result , the produced 3d model , is very smooth , and the post-3d-processing is minimal.


Believe me when i say , if someone wears black/white/one-colored clothes or something that shines ...the model is a real mess...gaps everywhere , gaps we have to "close" by hand..not good.
I am kind of understand now.more points more details
Title: Re: Multi-camera setup project.
Post by: cdg on 11 / October / 2016, 21:33:05
@cdg
For DSLR  & DLP projector combination - details were provided by Magnus in this thread:


http://www.agisoft.com/forum/index.php?topic=1324.0 (http://www.agisoft.com/forum/index.php?topic=1324.0)


With his multiple DLP projectors continuously running, he:


simultaneously triggered a group of Canon DSLR and Nikon DSLR. He took advantage of the shorter shutter lag of the Nikons to get all their shutters open & closed in 5ms and fire multiple off camera flash before the Canons' had opened their shutters:

  • ran 18 Canons (2 of 600D + 16 of 1100D) at  "long" 20ms shutter to pick up the projected noise for geometry

Simultaneously he

  • ran 4 cameras (Nikon D3200) at "short" 5ms shutter to pick up for texture only (i.e. not "drowned" by the continuous, relatively low intensity projected noise.
My memory is he had all camera remote shutter release wires (Canon & Nikon) simply connected together with splitters and a radio transmitter on one of the D3200 to trigger several off camera flash.


The benefits were impressive and described here:
http://www.agisoft.com/forum/index.php?topic=1324.msg6668#msg6668 (http://www.agisoft.com/forum/index.php?topic=1324.msg6668#msg6668)


"This first one was shot just with flash and as you can see it got 15877 points."

Then
"This next one we used the projectors too and this is what we got, 45733 points"

Based on this https://chdk.setepontos.com/index.php?topic=8312.msg107601#msg107601 (https://chdk.setepontos.com/index.php?topic=8312.msg107601#msg107601), it seems very unlikely to get all the "shutters" on a large bank of chdk cameras open and closed in a 5ms period - maybe 40ms, but that amount of dlp projected noise would probably adversely affect the flash texture capture.


To do this somewhere nearly as quickly (Edit1: maybe around 80ms across two separate banks of cameras) as the process that Magnus described using chdk cameras it therefore seems likely that the noise pattern must be projected using flash e.g. http://www.agisoft.com/forum/index.php?topic=1542.msg7960#msg7960 (http://www.agisoft.com/forum/index.php?topic=1542.msg7960#msg7960)


Edit2: I don't know how long the period was between the last Nikon shutter closing and the last Canon shutter opening so I don't know how long Magnus's 2 stage capture took from start to finish.
Thank you very much with such many information !!Yes for CHDK cameras ,it's looks two separate banks of  cameras could be a  easy way.
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 13 / October / 2016, 07:34:12
for CHDK cameras ,it's looks two separate banks of  cameras could be a  easy way.

Not necessarily easy & obviously expensive compared to  image capture on the same cameras (if you can live with a second or two between the 2 capture events).

Fyi - this comment refers to the 2 bank approach and either flash or DLP pattern projection
http://www.agisoft.com/forum/index.php?topic=1798.msg9565#msg9565 (http://www.agisoft.com/forum/index.php?topic=1798.msg9565#msg9565)

"Regarding the washing out of your diffuse textures, the solution to this is to have your system fire twice.  What I mean by this is that you can first take a shot with the speckle pattern being projected and then a split second later, take another this time with the projection muted. The second shot will NOT have patterns projected and this can be used for your texture.  Provided that the subject doesn't move much it will work. The key to this is to have the 2nd shot fire as fast after the first as possible. To do this you will need to use some sort of flash delay control device (such as the camera axe or pocketwizard max). This can also be done with dlp projectors, but a custom shutter system will have to be constructed, either electronic or mechanical."
Title: Re: Multi-camera setup project.
Post by: cdg on 23 / October / 2016, 23:49:23
for CHDK cameras ,it's looks two separate banks of  cameras could be a  easy way.

Not necessarily easy & obviously expensive compared to  image capture on the same cameras (if you can live with a second or two between the 2 capture events).
I will avoid this situation.
Title: Re: Multi-camera setup project.
Post by: cdg on 24 / October / 2016, 00:28:50
Not a big problem...power up the cameras..check what id each one is taking and then just start editing the file with ids to the desired physical order... :)
In changes through r624, I added a function set_id(old_id,new_id). If the script is running, the IDs on the camera will be updated immediately so you can see it on the ID display.

Once you are satisfied with the ID order, you can save the list.

If the new id is already in use they will be swapped. You can pass an optional third parameter 'error' to generate an error in this case instead.

Additionally, you can now select a range of cameras with mc:sel{min=number, max=number}

save_list works on the selected cameras, so this should make it easy to make subset lists.

I also fixed some bugs, see the svn log for details.
Hi  @reyalp
I am tried with this "set_id(old_id,new_id)",but still not know how to make it work.
old_id
old_id could be found by itself right? we don't need to set.
new_id
For multi-cam, how to give the IDs? one by one(i don't think so)?should be a list right?
Thank for you help !
Title: Re: Multi-camera setup project.
Post by: reyalp on 24 / October / 2016, 02:20:09
I am tried with this "set_id(old_id,new_id)",but still not know how to make it work.
I don't really know what you are trying to do. I would suggest referring to the posts before that, where I added the list features, starting around https://chdk.setepontos.com/index.php?topic=11667.msg114745#msg114745 or referring to the source  https://app.assembla.com/spaces/chdkptp/subversion/source/HEAD/trunk/lua/multicam.lua#ln197

Beware some of the code may have changed since those posts were written.

Quote
For multi-cam, how to give the IDs? one by one(i don't think so)?should be a list right?
IDs are assigned when you connect, in whatever order the USB library gives them. The set_id function is only needed if you want to change them, for example if you want a subset of cameras to have a particular ID range.

You can toggle display of the ID on the cameras screens using
Code: [Select]
!mc:cmd('id')

Note that mc:connect{add=true} will add new cameras with sequential IDs. So if you wanted IDs in a particular order, you could power on one, call connect, power on the next, call connect{add=true} and so on. If you save the id mapping when you are done, you only have to do this once.
Title: Re: Multi-camera setup project.
Post by: cdg on 22 / November / 2016, 03:29:30
In both cases after the second shooting , there are the aforementioned "error messages" that as you understand i don't remember them exactly :)
In the future, I suggest you copy and paste a sample somewhere. I don't have 64 cams, if I am going to debug the problem, I need some better idea of what is happening.

Quote
I noticed some changes to some commands output ...less messages , doing the job hard to monitor.
I reduce the output because even with 3 cameras the flood of messages was difficult to follow. With 64, it's probably enough to slow things down noticeably...

If you are using mc:cmd() or mc:cmdwait() you can pass the option printcmd=true, like
 !mc:cmdwait('rec',{printcmd=true})
If you only want to print once for each command rather than each camera you can use
 !mc:cmdwait('rec',{printcmd='once'})

It the moment there is no way to do this with other functions like shoot that call cmdwait(). I will add a way to change the defaults for this at some point.

Some kind of status in the download command would be good.
edit:
Actually, you should be able to pass verbose=true in the mc:download_images options to see whats being downloaded.

Quote
Since we can work with 1-2 cameras less ,and during a shooting is bad to say to client...wait a moment..technical issues...etc etc... is there a way when a camera loses connection , chdkptp will ignore this camera and keep working with the rest?It will be very handy if this can be done.
Yes, being able to ignore failed cams is something I would like to add, but it will take some work.
@reyalp
Hi reyalp:     how about the "ignore failed cams" function ?     when i try to connect my cameras,some times i could get one or two cameras failed,and it's takes me some time to find out which one :( :(  ,maybe the problem comes from the USB hub, i am think about changing it,but i think this "ignore failed cams" function will be helpful  .
Title: Re: Multi-camera setup project.
Post by: mphx on 22 / November / 2016, 07:24:53
@cdg


If you are talking about the failed cameras , 99% the problem is the loose usb connection.


When a camera fails , we pull out / put in the usb cable on the camera side , we reconnect the cameras and the failed camera is working fine , until the end of shooting.


Probably after so many months/years of shooting the connection on the usb slot is not firm anymore.


But yes a feature tha could ignore the failed cameras would be very helpful.Reconnecting and re-syncing 64 cameras , is a bit of delay during a shooting.
Title: Re: Multi-camera setup project.
Post by: mphx on 22 / November / 2016, 11:14:57
@reyalp


I can't find how the burst mode shooting is working .Can you provide a sample of the command?


Thanks

Title: Re: Multi-camera setup project.
Post by: reyalp on 22 / November / 2016, 16:02:07
@reyalp


I can't find how the burst mode shooting is working .Can you provide a sample of the command?


Thanks
https://chdk.setepontos.com/index.php?topic=11667.msg128954#msg128954 ?
Title: Re: Multi-camera setup project.
Post by: mphx on 23 / November / 2016, 08:36:31
@reyalp


Ah , yes , we had discussed it earlier..tried to solve the same problem as i had back then (it still remains) and i had a crazy idea that "shoot_burst" was command at its own.
But i had the feeling that it was a camera-side command , triggered by the "shoot" command...and the link reminded me that fact.

Anyway , something irrelevant.Is there a way to reload "lua" config files without closing/re-opening the program?
I am testing some things , trying to solve the problem with the "2 shots" , and i have to close/re-open the program after every change i make to the files.
Can it be somehow to reload them on-the-fly?
Its not important , just saying :)




Thanks
Title: Re: Multi-camera setup project.
Post by: reyalp on 23 / November / 2016, 21:10:33
Ah , yes , we had discussed it earlier..tried to solve the same problem as i had back then (it still remains) and i had a crazy idea that "shoot_burst" was command at its own.
But i had the feeling that it was a camera-side command , triggered by the "shoot" command...and the link reminded me that fact.
I admit I don't recall what exact details of the problem you were having, but burst shooting works for me, so if you want to make any further progress, you'd probably need to do debugging on your end.
Quote
Anyway , something irrelevant.Is there a way to reload "lua" config files without closing/re-opening the program?
Lua files are not config files, they are code that runs in chdkptp. So whether reloading makes sense depends on how the code you are loading interacts with the rest of the code.

When you use !require... to load something, it only loads the source code the first time. If you call require again, it just returns the same thing that was loaded before, without re-loading the source code.

You can force the code to be loaded again by using !forcerequire... instead, but again, whether this makes sense or not depends on what the code does. It often works, but modules that interact with other modules could break in unexpected ways.
Title: Re: Multi-camera setup project.
Post by: mphx on 23 / November / 2016, 21:52:15
@reyalp


Yes , bad choice of words..not configs.I have created a tab in the GUI , and put my buttons , to control the camera rig.
So i was changing things in the lua file i have created for this "new tab" , to play with the shoot command.Thing is that for every change i make to the lua file...i close the program..and re-open it so it will re-read the file and the changes.
After a while is tiring :)
I will play with "!forcerequire".Will make a new button just for it , to avoid the whole fuzz i mentioned above.


The problem is that for our shooting needs , we shoot 2 shots , 5 secs apart.5 secs is something we wish to reduce..at about 2secs max.
Thing is , that the second shot at 2secs or below is out of sync.
At this point i am down to the following command:
Code: [Select]
mc:shoot{shots=2,interval=2000,synctime=100,cont=true}where interval value is something i change for testing.
Testing with 2 ixus 160 at home , things go smoothly...testing with  x number of canon a2500 at the studio , same problem , 2nd shot out of sync.
I'm gonna do some more tests next days , re-check that all cameras have the same settings (mostly review image off , continuous mode on ) and see what'll happen .
Title: Re: Multi-camera setup project.
Post by: reyalp on 24 / November / 2016, 16:13:14
So i was changing things in the lua file i have created for this "new tab" , to play with the shoot command.Thing is that for every change i make to the lua file...i close the program..and re-open it so it will re-read the file and the changes.
In this case, your file is probably changing global state (IUP controls and so on)  that doesn't get reset when you re-load the file. E.g. if your module creates a tab, it might create a new tab every time you load it instead of changing the behavior.

I wouldn't really expect forcerequire work well in this case, but if what you are actually working on is e.g. functions that are called when certain buttons are pressed, then you could make a lua file that just defines those functions, and load that every time you edit.

Quote
The problem is that for our shooting needs , we shoot 2 shots , 5 secs apart.5 secs is something we wish to reduce..at about 2secs max.
Thing is , that the second shot at 2secs or below is out of sync.
At this point i am down to the following command:
Code: [Select]
mc:shoot{shots=2,interval=2000,synctime=100,cont=true}where interval value is something i change for testing.
Testing with 2 ixus 160 at home , things go smoothly...testing with  x number of canon a2500 at the studio , same problem , 2nd shot out of sync.
I'm gonna do some more tests next days , re-check that all cameras have the same settings (mostly review image off , continuous mode on ) and see what'll happen .
One thing I would suggest is testing what shooting rate you can get with a single a2500, and whether it maintains an accurate interval. If there isn't some configuration error (review mode, raw enabled, etc.) figuring out the real cause will probably require recording timing information in the camera code to figure out where it's getting out of sync.
Title: Re: Multi-camera setup project.
Post by: mphx on 25 / November / 2016, 09:36:32
@reyalp


I did some testings with the cameras at the studio.I came to a conclusion about what causes the problem.
You are more experienced from me , so you can tell me if my conclusion can be right or wrong.


I noticed that cameras that were out of sync , were the ones with the slow sd cards (there is a mixed of class 4 & class 6 sd cards in the cameras).
I noticed that the cameras with the slow sd cards , were "busy" longer than the others during the time period between the first and second shoot.
We switched sd cards among the cameras and the conclusion was served .
Is this something that could be affecting the shooting ? Meaning that some cameras would take longer to save the first image and so to be out-of-sync for the second shoot?


Something else we noticed.If we press the shutter button continuously (without chdk involved) , camera is shooting as supposed...display stays always on and just shoots.
When we are shooting through chdk/chdkptp , after every shot display flashes on/off + probably saves the photo before shoot the next image.
Why this difference in behavior?Something to do with the shoot command or chdk in general?


How can we emulate the "press continuously the shutter button" through commands?


Thanks again
Title: Re: Multi-camera setup project.
Post by: reyalp on 25 / November / 2016, 16:33:55
@reyalp
Is this something that could be affecting the shooting ? Meaning that some cameras would take longer to save the first image and so to be out-of-sync for the second shoot?
Yes, absolutely. Whether it makes a difference depends on how long saving the image takes relative to other parts of the process, but I'm not surprised card speed has an impact. I'd suggest using class 10 cards everywhere. There's no point going to the higher UHS levels, because the camera hardware doesn't support them.

One thing I have noticed is that the first shot after booting tends to be a lot more variable than later shots. So it might help to have a single "warm up" shot before you try to take a synced burst.

Quote
Something else we noticed.If we press the shutter button continuously (without chdk involved) , camera is shooting as supposed...display stays always on and just shoots.
When we are shooting through chdk/chdkptp , after every shot display flashes on/off + probably saves the photo before shoot the next image.
Why this difference in behavior?Something to do with the shoot command or chdk in general?
Generally, the camera keeps the image on the screen in continuous mode, and blinks black if you use the "hold down half shoot, click full shoot" approach.

Assuming you are using the latest multicam.lua, mc:shoot should use continuous mode if it's enabled in the canon UI, unless you pass cont=false. So the fact it's going black suggests it might not be using continuous mode, but it could also just be a side effect of the hook used to synchronize continuous shooting on this particular camera.

Title: Re: Multi-camera setup project.
Post by: mphx on 25 / November / 2016, 16:59:36
@reyalp

Quote
Yes, absolutely. Whether it makes a difference depends on how long saving the image takes relative to other parts of the process, but I'm not surprised card speed has an impact. I'd suggest using class 10 cards everywhere. There's no point going to the higher UHS levels, because the camera hardware doesn't support them.


Well , i counted all the sd cards today on all cameras  27x class 6 , 37x  class4. So there is an issue now.Replacing atleast all 37x class4 is a bit of a cost.
We , either decide to replace them or go on another approach.Thinking of reducing the mpixels of photos being taken.
Less mpixels , less image size , less data to be written on the card.So the card speed would have less impact on this part of the process.
We will think it.Best solution for me is replacing the cards..but its not my call :)


Quote
One thing I have noticed is that the first shot after booting tends to be a lot more variable than later shots. So it might help to have a single "warm up" shot before you try to take a synced burst.


Yes we have noticed that too.We take 3-4 double shots for "warm up" before we start the real testing or shooting or whatever.


Quote
Generally, the camera keeps the image on the screen in continuous mode, and blinks black if you use the "hold down half shoot, click full shoot" approach.
Assuming you are using the latest multicam.lua, mc:shoot should use continuous mode if it's enabled in the canon UI, unless you pass cont=false. So the fact it's going black suggests it might not be using continuous mode, but it could also just be a side effect of the hook used to synchronize continuous shooting on this particular camera.


We enabled continuous mode on all cameras today and turned off "review image after shooting".
Shooting command had "cont=true" , so i suppose , continuous mode was enabled.
During double shooting , it was like "shoot 1st photo--display black--display on again---small busy time for saving photo i presume--shooting the second photo"
All these quickly in a time window of ~2secs.
When i tried "continuous mode" in a single camera , as i said , without chdk involved..it was like....shooting photos at a steady rate...display always on and no obvious signs of saving anything.


I wonder , what is happening in this case...doesnt it save the photos?I dont care about the display going on and off or not...in single-continuous-mode it seemed that it was no delay for saving anything...


Black screen doenst bother me , doesnt delay anything , i noticed at some times , that shooting was happening during the time display was black...i mean display truning on and off doesnt delay the shooting..it happens no matter what the display does.But saving photos obviously delays the procedure.


Bottom line , we achieved a nice 2 sec time during the double shooting.Lower times were out of sync.Probably that was the minimum time we could achieve with these cameras and these cards.
Thats more than satisfied for us (from a previous 5secs time).Now its up to us to decide the replacement of the cards...or the other option i mentioned above.


PS: yes , tests were done with latest multicam.lua.Revision 729 if i am not mistaken.
Title: Re: Multi-camera setup project.
Post by: reyalp on 25 / November / 2016, 19:25:50
We , either decide to replace them or go on another approach.Thinking of reducing the mpixels of photos being taken.
Less mpixels , less image size , less data to be written on the card.So the card speed would have less impact on this part of the process.
It's worth trying, but beware that on some cameras smaller images require noticeably more processing time, so it can actually be slower. I think this mostly affected older cameras, but you should test to be sure. You could also try lower jpeg quality.

Low light mode shoots at lower resolution (M size) and should be much faster than other modes, but quality will be lower than normal M size. You can use CHDK to use lower ISO values in this mode, but you would have to control the exposure yourself.
Quote
When i tried "continuous mode" in a single camera , as i said , without chdk involved..it was like....shooting photos at a steady rate...display always on and no obvious signs of saving anything.
I don't understand what you mean by "obvious sign of saving anything". As far as I know, the only indication of saving is the LED blinking, which might happen other reasons (especially when using CHDK). The "Busy" message you sometimes see does not specifically indicate saving to SD.

The way the synchronized shooting in continuous mode works is by stopping the firmware deep in the shooting process where the Canon firmware wouldn't normally spend much time. It's hack, so weird behavior and differences between ports are not unexpected. It doesn't intentionally change saving behavior, but again side unforeseen side effects wouldn't be a surprise.

I started writing a script specifically to time this kind of shooting, but it's ended up being a lot more than a quick thing to throw into chdkptp, so I don't know when I'll have something to post. You could use fixedint http://chdk.wikia.com/wiki/Lua/Scripts:_Fixed_Exposure_Intervalometer in cont mode.

edit:
I forgot that I added some timing information to multicam at some point. If you use
!mc.verbose=true
and then run mc:shoot it will will return lines like

 msg="1 w:143 i=0, 2 w:83 i=2000, 3 w:83 i=2000"

Each sequence like "1 w:143 i=0" is a shot, with the fist number being the shot number.

w is the time between the camera being ready to shoot, and the time the shot needs to start to maintain the given interval and sync. i is the actual interval achieved. So in the example above, I had a 2 second interval, and on the second and third shot had 83ms to spare. If w is negative or interval larger than the interval option, the camera isn't able to keep up.
Title: Re: Multi-camera setup project.
Post by: reyalp on 25 / November / 2016, 23:03:59
Here's the test script: https://chdk.setepontos.com/index.php?topic=13004.0
Title: Re: Multi-camera setup project.
Post by: mphx on 26 / November / 2016, 08:29:41
@reyalp


There is a chance , my first conclusion might not be exactly the suspect.


First of all , i must say , that by testing with ixus 160 i cant get exactly correct results concerning the A2500s , but i get a rough idea of what is going on.
So i did some testings , with 2x ixus 160 and the use of "mc:verbose=true".Ixus cameras have some low capacity and i presume low speed sd cards (there is no indication of what class they are , but cards of 512mb and 128mb bought many years ago are not expected to be class 10 or something :P )



So i played around with the shoot command , and changing the interval value until i get as low as it can go positive "w" value .
Cameras achieved an interval value of around 1590-1600msecs.Canon A2500 at studio with class6 sd cards , couldnt go lower than 1800msecs.
Specs refer the same image rate per second (continuous mode) for both models.
So if the writing speed of sd cards was the suspect , then ixus 160 should must have achieved larger interval times since they had to write bigger image files (20mp vs 16mp) and the sd cards are not that speedy as class6 cards of A2500s...


So i come down to what you said , that "busy" time between shots is not necessarily meaning "saving to sd card" .Maybe means "i process the image , wait a bit" thing?
And maybe ixus 160 cameras have faster image processor than A2500s and thats why they achieve lower interval times?
I see at google that they have the same processor though , maybe its different hardware somehow?different implementation? I cant really say.


Anyways , i must check the interval times with that "verbose" thing on A2500s to see practically what interval times are achieved.


Thanks again for your infos.


PS : its a bit of big trouble to upload your script to every mounted camera and single-test it on each one of them...i am sure that the results would be enlightening though.

Title: Re: Multi-camera setup project.
Post by: reyalp on 26 / November / 2016, 15:40:04
PS : its a bit of big trouble to upload your script to every mounted camera and single-test it on each one of them...
There is no reason whatsoever to upload it to every camera.

Just running it on one camera/sd card combo, you could use to quickly test the effect of different settings, like image size and so on.

You can also use it on a few cameras (or the same camera with a few different cards) to verify that the SD card accounts for the difference.

Running it should also give you good idea of maximum practical shooting rate for a given combination of camera/card/settings.

Because it's a separate, much simpler implementation, it also gives us a check whether the problems you are seeing with multicam are really the limit of the camera, or some bug in multicam.

Quote
So if the writing speed of sd cards was the suspect , then ixus 160 should must have achieved larger interval times since they had to write bigger image files (20mp vs 16mp) and the sd cards are not that speedy as class6 cards of A2500s...
I would not assume this, because there are other significant hardware differences, and the byte size of the file depends on the scene and jpeg quality too. Test and let the data tell the story.

Quote
So i come down to what you said , that "busy" time between shots is not necessarily meaning "saving to sd card" .Maybe means "i process the image , wait a bit" thing?
Most often, it's shown when doing noise reduction at high ISO or dark frame subtraction for long exposures, but it might show up for other reasons. It's possible it could even show up as a side effect of CHDK blocking the shooting process.

Quote
And maybe ixus 160 cameras have faster image processor than A2500s and thats why they achieve lower interval times?
I can confirm that having the same Digic number does not mean identical performance. Newer Digic IV definitely have faster SD and USB performance than old ones, and I wouldn't be surprised if they have faster image processing too. Different cameras can have different amounts of memory, and different image quality settings too.
Title: Re: Multi-camera setup project.
Post by: mphx on 26 / November / 2016, 18:46:22
@reyalp


Since i wont be to the studio until late next week , i will upload the script to ixus cameras i have here at home and do some tests.
Results will be different from A2500 , but i can get an idea , what (sd,image size,settings,etc) affect the shooting times.
Title: Re: Multi-camera setup project.
Post by: mphx on 27 / November / 2016, 10:00:33
@reyalp


I did some tests today with ixus 160 and your script .Lets sum up the parameters of the experiment :)


1.Camera : Canon ixus 160
2.SD card 128mb Class 4 (?) : write (raw) : 4116 kb/s , write (mem) : 4096 kb/s , write (64k) : 3947 kb/s (chdk benchmark)
I tested a known class 4 and had similar results , so i consider this SD card to be a class 4.
3. SD card 16gb Class 10 : write (raw) : 18952 kb/s , write (mem) : 18070 kb/s , write (64k) : 9416 kb/s (chdk benchmark)


So the two cards have significant difference at write speed.

Test #1

SD card 128mb Class 4
tv96 = 672
ISO = 1600
image size = L (average of 5mb file size)
interval = 1000msec (i know that camera cant get this time , so it will shoot as fast as possible.)

Test #2


SD card 16gb class 10
tv96 = 672
ISO = 1600
image size = L (average of 5mb file size)
interval = 1000msec (i know that camera cant get this time , so it will shoot as fast as possible.)

Test #3

SD card 128mb Class 4
tv96 = 512
ISO = 100
image size = L(average of 1mb file size)
interval = 1000msec (i know that camera cant get this time , so it will shoot as fast as possible.)

Test #3 settings are the settings we use at studio , where we have strong lights , but at my house where lights are lower , images were darkish and so i dont know if this test has any meaning at all.Results are here ->
https://www.dropbox.com/s/86n4d6ulc2e5qlp/ixus160_benchmarks.xls?dl=0 (https://www.dropbox.com/s/86n4d6ulc2e5qlp/ixus160_benchmarks.xls?dl=0)
I made an xls with formatted cells , because the produced csv file is a bit messy :)
Have a look if you like to make any remarks and comments.

What i noticed is that apparently different sd cards , dont have any impact on shooting speeds if i read the results correctly.
Also in test #3 , a lower interval time (comparing to tests #1 and #2) is achieved , although as i said i dont know if this test has any practical meaning.

You made the script , you can "read" the results better than me , any comments will be helpful.

EDIT : i made 2 new tests..configuration is Test #1 and i changed the image size (m1 = 10mp , m2 = 3mp) , to see if there is some delay due to image processing.
I updated the xls file ( https://www.dropbox.com/s/86n4d6ulc2e5qlp/ixus160_benchmarks.xls?dl=0 (https://www.dropbox.com/s/86n4d6ulc2e5qlp/ixus160_benchmarks.xls?dl=0) ) (link as i see is identical with the one above...)

I noticed something interesting , interval achieved when going to M2 image size is identical with the interval achieved with L image size.At M1 size , interval increases , not much , but increases.
Title: Re: Multi-camera setup project.
Post by: reyalp on 27 / November / 2016, 14:35:09
Test #3 settings are the settings we use at studio , where we have strong lights , but at my house where lights are lower , images were darkish and so i dont know if this test has any meaning at all.
We're not interested in the images, that's why the shutter speed is fixed (I guess you edited it to 1/40th for test 3) Otherwise, if you shoot in dim lighting, the camera might choose say, 1/2 sec exposure which would throw off the results.

The content of the image may affect the result, because the file size can change a lot depending how much detail there is.

Quote
I made an xls with formatted cells , because the produced csv file is a bit messy :)
In general, I'd rather have the original data, but no need to re-post it for this run.

Quote
interval = 1000msec (i know that camera cant get this time , so it will shoot as fast as possible.)
It looks like this was actually 0, but that has the same effect. The code where it says "for PTP testing" is only used if you didn't run the script from the script menu.

Quote
What i noticed is that apparently different sd cards , dont have any impact on shooting speeds if i read the results correctly.
This does seem to be true in this case, the total variation is only ~200ms and most of that does not seem to depend on the card.

Some observations:
The CHDK benchmark "write (64k)" speeds are quite close to the nominal speed class. The class 10 card does much better with larger writes (raw and mem)

The first class 4  L results are slightly odd: If the image is ~5 MB, it should take > 1s at 4 MB/s. But the ready_time - raw_time is only 660ms. So maybe there is buffering going on, with the actual write finishing in parallel to the next shot.

You are right that test 3 is a bit faster, even though the exposure time is ~25 ms rather than ~0.8ms. You can see the longer shutter shutter in raw_time (910 vs ~880-890 in most other runs). I expect this difference is due to the ISO, because ISO1600 usually adds some processing for noise reduction, but the file size is also lower (likely due to lower noise and maybe also being very underexposed) so that could be a factor too.

I agree test 4 is a bit slower than the equivalent L shots. This matches previous experience that resizing has some performance penalty. In test 5 (M2) the smaller amount of data might compensate for the overhead of resizing. But in any case, the differences aren't large. IIRC, the impact of resizing was much larger on Digic II cameras.

So overall conclusion is none of this make much difference on this camera. I wouldn't assume that A2500 behaves exactly the same.
Title: Re: Multi-camera setup project.
Post by: mphx on 27 / November / 2016, 15:13:21
@reyalp

Quote

We're not interested in the images, that's why the shutter speed is fixed (I guess you edited it to 1/40th for test 3) Otherwise, if you shoot in dim lighting, the camera might choose say, 1/2 sec exposure which would throw off the results.The content of the image may affect the result, because the file size can change a lot depending how much detail there is.


That's my point , with the fixed shutter speed and my low lights at home , images were darkish , less details , less size.
I wanted full image size (as much details as possible) , so we can see how the write speed affects the process.
If the image size is some kilobytes , then no conclusion can be safely exported.
Thats why i picked high iso at the first tests.
Lowering shutter speed and iso even more at test3 , i had to turn every available light in the house , and again images were a bit darkish...

Quote

It looks like this was actually 0, but that has the same effect.

Yes i figured it out at the end :)


Quote

(I guess you edited it to 1/40th for test 3)


Yes i edited the lua.

Quote

So overall conclusion is none of this make much difference on this camera. I wouldn't assume that A2500 behaves exactly the same.


Yes i need to repeat the tests with A2500s (test one A2500 with class4 card and one with class 6) , with the settings we are using at the studio , all lights turned on.
Title: Re: Multi-camera setup project.
Post by: aluminumwelder on 23 / January / 2017, 16:28:39
I did not read all 41 pages of this thread, but am working on it. Will take a week probably.
Anyways. what software is best for quickly post processing the images and outputting to a big 55" tv?
I want to make a 12 or more camera array for events where people jump or do other cool action moves and them within a few minutes the results are displayed for them to see.
I have seen optical flow and adobe after effects mentioned, but after searching google for a few days dont' see a single tutorial. Thanks in advance for any ideas.
Title: Re: Multi-camera setup project.
Post by: mphx on 23 / January / 2017, 18:59:33
I did not read all 41 pages of this thread, but am working on it. Will take a week probably.
Anyways. what software is best for quickly post processing the images and outputting to a big 55" tv?
I want to make a 12 or more camera array for events where people jump or do other cool action moves and them within a few minutes the results are displayed for them to see.
I have seen optical flow and adobe after effects mentioned, but after searching google for a few days dont' see a single tutorial. Thanks in advance for any ideas.

I can't say that i understood what you are trying to do.
What's your endgame?Create 3d model for some use?If yes consider the following.

1.You can't produce any "serious" 3d model with 12 cameras.You need...MANY. Like 60+
2.People must be STILL..not moving.They can take any pose they like..but keep it STILL during the shooting.

If you are not going to create 3d model from all this thing..desribe it better and i will try to be of any help :)
Title: Re: Multi-camera setup project.
Post by: aluminumwelder on 23 / January / 2017, 19:13:32
thanks for the response. I do not want to make 3d models I want to make a time slice bullet time effect video/gif.
Title: Re: Multi-camera setup project.
Post by: mphx on 23 / January / 2017, 19:22:55
I have no experience with bullet time effect things.
But 12 cameras seem awfully few for such a project too...we are talking about a very thin..slice :)
You will have either position them far from each other so the video will be lacking frames..or too close to each other and you will have a very smooth but very small duration video.
Anyway i have no idea about these things..your problem is how to produce the video to display in a matter of few mins...
No idea..sorry..probably some video editing software?
Title: Re: Multi-camera setup project.
Post by: aluminumwelder on 23 / January / 2017, 20:31:47
yes it will be a very small slice, thanks for trying.
Title: Re: Multi-camera setup project.
Post by: Hardware_Hacker on 24 / January / 2017, 00:13:53
"...I want to make a 12 or more camera array for events where people jump or do other cool action moves ..."
.... I do not want to make 3d models I want to make a time slice bullet time effect video/gif.
There are about 70 Canon a450 and a460 camera's located in Sydney Australia if you are interested in them.
Old Post is here https://chdk.setepontos.com/index.php?topic=4103.msg117749#msg117749 (https://chdk.setepontos.com/index.php?topic=4103.msg117749#msg117749)

Also there about 18 a480, a490 and a495 camera's located in Sydney Australia if you are interested in them.

These cameras have been used, by others with CHDK, for time slice bullet time effect video's. see an example here:-
http://hackaday.com/2011/06/29/tesla-coil-bullet-time-photography/ (http://hackaday.com/2011/06/29/tesla-coil-bullet-time-photography/)

H-H
Edit #1
And just to be clear I took over zcream's project:-
"CHDK matrix bullet-time rig with Powershot A450 and A460 cameras"
Title: Re: Multi-camera setup project.
Post by: aluminumwelder on 25 / January / 2017, 08:13:15
thanks but most of those posts are several years old and since I"m in USA, shipping would cost more than the cameras which I can easily get off ebay. what I really need help with is downloading the images and quickly making them into a video clip. I've emailed several companies, no response, guess I will slowly figgure it out on my own. Hopefully I can make a tutorial because all the information is so spread out and it will take days/weeks to figgure it all out.
Title: Multi-camera setup project.
Post by: waterwingz on 25 / January / 2017, 08:48:42
what I really need help with is downloading the images and quickly making them into a video clip. I've emailed several companies, no response, guess I will slowly figgure it out on my own. Hopefully I can make a tutorial because all the information is so spread out and it will take days/weeks to figgure it all out.
You could start by updating this page with what your learn?

 Multiple Cameras using CHDK (http://chdk.wikia.com/wiki/Multiple_Cameras_using_CHDK)

Is the help you need more related to the download part or the video creation part?
Title: Re: Multi-camera setup project.
Post by: aluminumwelder on 25 / January / 2017, 10:35:45
I am just starting and can probably figgure out the download part if I spend enough time reading the past threads, mainly want help on the video creation part. If someone can tell me one or two softwares I can research and learn it. I've read after effects and final cut pro are good, mainly want to find an editor that can add extra frames and auto correct for alignment so footage is smooth.
Title: Re: Multi-camera setup project.
Post by: Hardware_Hacker on 27 / January / 2017, 19:52:59
....but after searching google for a few days dont' see a single tutorial. Thanks in advance for any ideas....
....video creation part....
... If someone can tell me one or two softwares I can research and learn it....
...auto correct for alignment so footage is smooth....
Try Hugin's   "align image stack" here
http://hugin.sourceforge.net/docs/manual/Align_image_stack.html (http://hugin.sourceforge.net/docs/manual/Align_image_stack.html)
This will, probably, work best for pairs of images so Align image in pair's such as (#1 and #2) then (#2 and #3) etc.

Also see some older post's here:-
ShockWave 'Wiggle Movies' 3 Replies 1328 Views Reply #3 on: 13/July/2009
See Attached file acrobat.gif (Using his synchronised nine-camera TX1 rig)

https://chdk.setepontos.com/index.php?topic=3915.0 (https://chdk.setepontos.com/index.php?topic=3915.0)
https://chdk.setepontos.com/index.php/topic,3430.msg32271.html#msg32271 (https://chdk.setepontos.com/index.php/topic,3430.msg32271.html#msg32271)

More stuff, for mediavr, is here
https://www.youtube.com/user/mediavr (https://www.youtube.com/user/mediavr)

And the Newer mediavr's stuff and methods used, in more detail, here:-
"mediavr" try googling [panovrx PanoToolsNG]
The Result:- "Posts in PanoTools NG [Total: 417 items]"

H-H
Edit #1
The older CHDK capable cameras are capable of some good results
for the "video creation part".
Title: Re: Multi-camera setup project.
Post by: mphx on 04 / February / 2017, 08:37:58
@reyalp


We are facing a rather stupid problem lately.Sometimes cameras are disconnected during photo shooting , most of the times because some cable is moved and lost connection to the camera.
Chdkptp popups a message and we undestand that some camera has lost connection.
So far so good...we re-connect cameras and we continue.
Lately we have noticed that some cameras when they lost connection ..they turn off by themselves for some strange/unknown reason.
And when we have customers waiting for us to re-connect them , we dont notice that some cameras are missing during re-connection since they are off entirely.

My question is , is there a command or a way , to "report" the number of connected cameras.Issue the command and the command will return the number of connected devices.
So after re-connecting cameras , i would know if 64 cameras are connected or less..if less then i will check if some camera is turned off.
I know i could walk around the camera rig and check all of them visually and see if some camera is turned off but as i said, during photoshooting with customers and/or children running around and stuff , we try to be quick with such actions (connect,sync , etc etc) so some things might be overlooked during shooting.
That happened today and we tried to make a model from 35-40 cameras out of 64...the rest cameras for a strange reason turned off at some point of the shooting process!!!

Thanks in advance.
Title: Re: Multi-camera setup project.
Post by: reyalp on 04 / February / 2017, 14:40:37
My question is , is there a command or a way , to "report" the number of connected cameras.Issue the command and the command will return the number of connected devices.
Something like
Code: [Select]
for lcon in mc:icams() do
 if not lcon:is_connected() then
  printf('%s not connected\n',lcon.mc_id)
 end
end
should do it.

I should probably add connection status to mc:describe
Title: Re: Multi-camera setup project.
Post by: mphx on 04 / February / 2017, 15:09:37
@reyalp


Gonna try it at Monday before the shooting.


mc:describe ? what this command does ?Never heard of it :)
Title: Re: Multi-camera setup project.
Post by: reyalp on 04 / February / 2017, 15:24:13
mc:describe ? what this command does ?Never heard of it :)
You can find it in the source ;)

It's what generates the output for mc:list_sel and mc:list_all
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 05 / February / 2017, 07:11:59
Gonna try it at Monday before the shooting.

(my understanding - haven't tested this) If you just want the disconnected id's - put that code in a PC-side function, by itself:

e.g.
Code: [Select]
function mc:which_cams_are_not_connected()
 for lcon in mc:icams() do
  if not lcon:is_connected() then
  printf('%s not connected\n',lcon.mc_id)
 end
end

e.g. somewhere after function mc:connect(opts)

and run as:
!mc:which_cams_are_not_connected()

mc:describe ? what this command does ?Never heard of it :)

Adding the equivalent "is_connected" logic to mc:describe would, as it stands, include the display of the additional fields described there in one go (although they probably wouldn't help you much it means the multicam code doesn't bloat) & passing in table options would allow display of only what is wanted.
Title: Re: Multi-camera setup project.
Post by: Hardware_Hacker on 05 / February / 2017, 19:24:22
We are facing a rather stupid problem lately.
Sometimes cameras are disconnected during photo shooting , most of the times because some cable is moved and lost connection to the camera.
Lately we have noticed that some cameras when they lost connection ..they turn off by themselves for some strange/unknown reason.

My question is , is there ..... a way , to "report" the number of connected cameras.
...

Thanks in advance.
If you are using windows.
Try using the latest version of Nirsoft's USB Device Viewer and USB Log Viewer.
Also try using the latest version of Uwe Sieber's USB Tree Viewer.

My guess this is something related to post's that I have, very unsuccessfully, posted about else were.

Windows has a way of driver ranking. i.e. "Windows has determined that .....",  "Windows ... Re-Format... SD-Card" etc.
So it may be that windows "Trusted Platform" management modules are the source of this problem.

Another issue might be that effectively you are continuously plugging and un-plugging the Cameras SD-Cards.
So problems such as SD-Card wear leveling might also be a cause, after a year or more of use.
What SD-Card type's are you using.

H-H

Edit #1 Some examples  are now attached

Edit #1a There was a recent CHDK post regarding the use of mix of USB-3 and USB-2 Hubs
               that suggested that this approach had some advantages.

General Ref #1a:- Electronic Design 2013-03-12 D.W. Johnson, Renasas "Whats The Difference Between USB-2 & USB-3 Hubs"

Continued, see H-H post 422
Title: Re: Multi-camera setup project.
Post by: mphx on 05 / February / 2017, 21:03:37
@H-H


I don't think windows are involved in all this.Cameras tend to turn off since day one.
I had noticed that when running chdkptp and connect all cameras , if i issued an "exit" command , meaning disconnecting and stop running camera-side script,
then a random number of cameras would turn off.
So i never use "exit" in chdkptp.And i had never problems with cameras turning off.
Maybe its a chdk-firmware bug or problem.I don't know.
Lately (and by lately i mean last months) i upgraded chdk on cameras and after that upgrade i started having random turn offs.
So i always have to keep an eye for turned off cameras now.
Last shooting we had like 20 cameras off and we didn't notice a thing..we were busy with the customers.Thank god we were able to produce a 3d model out of the remaining working cameras.


Thing is that if a camera loses connection during shooting , we can see it.There is an error popup and we just know that some camera lost connection.
So we just re-connect everything and we continue...but if one or more cameras turn off RIGHT BEFORE the re-connect command..there would be no error..only less cameras connecting...
If we don't see it that moment for various reasons (we didnt pay attention on the console output in chdkptp , or/and the camera that is turned off is in the "back" of the rig) , then we just operate with less cameras and we dont know it :)


Thats why i want a command in chdkptp so i can check during shootings how many cameras are connected...anything lower than 64 means something is going on.


I will test tomorrow the commands of reyalp/andrew and see if they work the way i am guessing they work.


As far as sd cards are concerned..they never leave the camera slot.There is no reason.Downloading of images is done through chdkptp , and future chdk upgrade , through chdkptp again.
Title: Re: Multi-camera setup project.
Post by: Hardware_Hacker on 05 / February / 2017, 21:37:32
Continued from H-H post 420

Edit #2 some examples  are now attached

"....but if one or more cameras turn off RIGHT BEFORE the re-connect command..there would be no error..only less cameras connecting..."

USB Device View has several options  that may be useful for additional USB Monitoring:-

a/ Display a Tray Balloon when a USB Device is Disconnected.
b/ Execute the following command when you unplug a USB device. (In Advanced Options.)
    "You can use the following variables in the command string:- "...................."

"...As far as sd cards are concerned..they never leave the camera slot..."

The SD-Cards have limited number of "Guaranteed" Read-Write cycles.
This is why wear leveling is used on the SD-Cards.
So may be there approaching "Old Age".

Originally you had  some problems with the USB-2 Hubs, Edit #1a in post #420 might be of some interest.

H-H
Title: Re: Multi-camera setup project.
Post by: waterwingz on 05 / February / 2017, 23:01:43
The SD-Cards have limited number of "Guaranteed" Read-Write cycles. This is why wear leveling is used on the SD-Cards. So may be there approaching "Old Age".
Very unlikely.  All modern SD cards can stand 100,000 Program/Erase Cycles per memory cell and many can do 10x that. With wear leveling enabled and a small 4G card, if you were to shoot a 4MB picture every minute in an eight hour day,  it would take you about 136 years to hit that limit


Even if we pretend I'm off by a factor of 10x,  that's still 13.6 years of shooting.
Title: Re: Multi-camera setup project.
Post by: reyalp on 06 / February / 2017, 00:31:11
I don't think windows are involved in all this.Cameras tend to turn off since day one.
I had noticed that when running chdkptp and connect all cameras , if i issued an "exit" command , meaning disconnecting and stop running camera-side script,
then a random number of cameras would turn off.
This may or may not be your problem, but make sure "disable display off" is set in your CHDK settings. For your situation, "always" is probably the best choice. You can use multicam call and set_config_value to set it on all cameras.

Background:
When the screen goes off for power saving, you can still wake the camera up with a  key press sent through chdkptp, but if it's not woken up in a certain time it will shut down completely.
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 06 / February / 2017, 03:53:10
USB Device View has several options  that may be useful for additional USB Monitoring:-

a/ Display a Tray Balloon when a USB Device is Disconnected.
b/ Execute the following command when you unplug a USB device. (In Advanced Options.)
    "You can use the following variables in the command string:- "...................."


I just read that USBDeview has "all kinds of snazzy, user-callable command line capabilities as well as the basic GUI"  - hadn't realised that...potentially useful for further (e.g. AutoIt) automatic analysis.

Thanks.
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 06 / February / 2017, 04:22:48
All modern SD cards can stand 100,000 Program/Erase Cycles per memory cell

Interesting - I have very little idea about how SD works.

If shoot/download/delete were used could the same cell/s (theoretically, at least) just be subject to the cycle?

If one cell becomes defunct is another simply used (i.e. does the card gradually wear out)?

Edit:
SD cards are designed to mask initial manufacturing bad blocks and those which appear with use. As blocks wearout spare blocks are transparently substituted. The SD's built-in controller uses error correction to prevent the errors from corrupting data as they occur (on cheaper cards the error correction may not be as good).

Wear levelling  -
writes are spread across all cells, not just always using the same area over and over.
Title: Re: Multi-camera setup project.
Post by: mphx on 06 / February / 2017, 04:24:39
Quote
This may or may not be your problem, but make sure "disable display off" is set in your CHDK settings. For your situation, "always" is probably the best choice. You can use multicam call and set_config_value to set it on all cameras.

Background:
When the screen goes off for power saving, you can still wake the camera up with a  key press sent through chdkptp, but if it's not woken up in a certain time it will shut down completely.

Last time i was "playing" with cameras was when i was trying to find out why cameras don't shoot fast enough in a 2-shot scenario.i believe you remember that.
At that point , i manually set the EXACT SAME settings in canon menu and chdk menu on each one of the cameras so there would be nothing to affect shooting times and cameras would have different shooting times.Took me like an hour to do it.
So i am pretty sure (99.9999%) that i set disable display off to every camera.
But for the sake of conversation , lets say that , this is the case.I can't accept that i left this setting on  to like 20-25 cameras....out of 64...because there were like 20-25 cameras turned off in the last shooting.
After all , there were times that we had two shootings few hours apart in the past and we left the cameras turned on and they stay on and connected for hours....

Anyways i am satisfied with a command that will show me the connected devices so i can check them during shooting..i will test the command later today...

@all

Get over the thing with sd cards wear level.We operate studio maximum 2 years now..and obviously we are not taking photos every day.
So cameras should have taken like 1000 photos maximum during these 2 years..and the number could be easily less than 1000...
I dont think sd cards hit their maximum life span yet...
I have sd cards older than the ones in the cameras , from some pdas i had bought years ago and they still operate in peak perfomance...
Title: Re: Multi-camera setup project.
Post by: mphx on 06 / February / 2017, 08:45:29
@reyalp @andrew

I've tested the commands and here is what i noticed.

Code: [Select]
function mc:which_cams_are_not_connected()
 for lcon in mc:icams() do
  if not lcon:is_connected() then
  printf('%s not connected\n',lcon.mc_id)
 end
end

1.First of all it is one "end" missing.Otherwise it produces an error.3x "ends" are required.
2.It doesnt work the way i'd like it to work.

Example :
I power on 2 cameras , lets say id 101 , 102.
The  "command" doesn't produce any result.If i turn off lets say camera id 102 , the "command" reports that camera with id 102 is not connected.
I don't need that. I would know that one camera (of the two connected , and i don't really care which one) is disconnected the moment i will issue the next command in chdkptp (preview mode , rec mode , set focus/zoom , preshoot , shoot , whatever).
An error popup will be displayed.

What i need from the "command" is to report which ids are not connected at all by reading the file with the serial/ids of all cameras and comparing them with the connected ids/cameras.
If i accidentally don't turn on the cameras of 2 poles  , with this "command" i will never know it.Since this command is checking only the connected cameras and if someone of them will be disconnected after the initial connection.

But i need the command to tell me that ids with number bla bla bla bla bla are not connected , or even the count number of them is equally helpful. For example "20 ids/cameras are not connected"
Probably at some point must read the file with the ids and do some more calculations...
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 06 / February / 2017, 13:45:32
Probably at some point must read the file with the ids and do some more calculations...

Not currently near a chdkptp computer - perhaps something like this:

Code: [Select]
function mc:which_cams_are_not_connected()
 for lcon in mc:icams() do
   if not lcon:is_connected() then
      printf('%s NOT connected\n',lcon.mc_id)
   else
      printf('%s connected\n',lcon.mc_id)
   end
  end
end

?
Title: Re: Multi-camera setup project.
Post by: mphx on 06 / February / 2017, 15:04:08
@andrew

Not at the studio either , will test it tomorrow. :)

The previous command syntax worked at 80% percentage of the cases.

Example (true story , happened today) :

I turn on all the cameras .At some point one camera lost connection.The "command" worked , reported the id of the "lost" camera.
So far so good.
I reconnect everything.At some point another camera lost connection.And at the same time some other cameras TURNED OFF completely (wtf!).
The "command" reported all the missing cameras.The one that lost connection (but stayed on) plus all the other cameras tha were turned off.
Command worked here because all the "missing cameras" (by either losing connection and stayed on or turned off) were connected at the first place.In this case "command" does the job.

But as i said before , if i forget to power on a whole tripod , lets say 8 cameras...and these 8 cameras never get connected or some cameras lose connection during shooting ,turn off and i will never notice for any reason...so they will stay turned off during next reconnection...at these 2 cases this command will miss these cameras.
Title: Re: Multi-camera setup project.
Post by: Hardware_Hacker on 06 / February / 2017, 19:26:25
USB Device View has several options  that may be useful for additional USB Monitoring:-

a/ Display a Tray Balloon when a USB Device is Disconnected.
b/ Execute the following command when you unplug a USB device. (In Advanced Options.)
    "You can use the following variables in the command string:- "...................."


I just read that USBDeview has "all kinds of snazzy, user-callable command line capabilities as well as the basic GUI"  - hadn't realised that...potentially useful for further (e.g. AutoIt) automatic analysis.

Thanks.
Just to be clear my multi-camera arrays have a customized setup that is standardized even when using different camera models.
So even when I change to another windows computer, or a new Windows OS version, the cameras will then exhibit the same behavior.
This has been detailed in some older post's and I am still using the same basic method with a few improvements.

I something goes wrong I can then do a soft-reset back to the standard. Windows then dose its "normal-thing" and the
windows registry will then contain the, new, relevant details of Hubs, Connections, Times, Events, "JUNK", Data used for Logs. etc. etc. (example's in posts 420 &422)

There are additional options regarding, AutoIt Automatic Analysis, it can access the windows registry (i.e. "Database")
and then look at the three most important windows registry will then contain the new relevant details of the cameras in the array.

a/ Windows registry key (HKLM_CS001_Control_Class-Key)
b/ Windows registry key (HKLM_CS001_Enum_USB_(Canon Camera)-Key)
c/ Windows registry key  (HKLM_CS001_Services_LibUSB0-Key)

See the Examples in the attached Files.
Note #0 Only the, necessary,  basic CAMERA-DEPENDENT details are used, BLANK KEYS are used for the other Windows OS Stuff.
Note #1 Caution is needed when editing the registry files.
Note #2 As per Older Post's The customized setup was developed and tested using a Windows-PE (i.e. A RAM based) system using the "REAL HARDWARE".

H-H
Title: Re: Multi-camera setup project.
Post by: srsa_4c on 06 / February / 2017, 19:44:40
Something like this?
Code: [Select]
function mc:camstatus()
local cn=0
local nc=0
    for lcon in mc:icams() do
        if not lcon:is_connected() then
            nc=nc+1
            printf('#%s NOT connected\n',lcon.mc_id)
        else
            cn=cn+1
            printf('#%s connected\n',lcon.mc_id)
        end
    end
    printf('\nSummary: %d cameras (%d connected, %d disconnected)\n',cn+nc,cn,nc)
end
Cameras that turn off: do they turn off properly (including retracting the lens)?
Title: Re: Multi-camera setup project.
Post by: mphx on 06 / February / 2017, 20:02:41
Something like this?
Code: [Select]
function mc:camstatus()
local cn=0
local nc=0
    for lcon in mc:icams() do
        if not lcon:is_connected() then
            nc=nc+1
            printf('#%s NOT connected\n',lcon.mc_id)
        else
            cn=cn+1
            printf('#%s connected\n',lcon.mc_id)
        end
    end
    printf('\nSummary: %d cameras (%d connected, %d disconnected)\n',cn+nc,cn,nc)
end
Cameras that turn off: do they turn off properly (including retracting the lens)?

Will test this tomorrow at studio.

About cameras that turn off.I can't answer for sure because i didn't pay attention at that moment.But i believe that they retract lens because i remember turning them on and lens going out..so they were retracted.
Cameras losing connection is something common to our rig.usb slots on cameras getting loosed sometimes , someone kicking a cable , its ok , we are used to it.
And we see it fast , since chdkptp throw out an error popup.
But turned off cameras is a mystery ...Since connecting and syncing takes some seconds we don't keep looking to chdkptp console output..so if a camera is missing and reported there..half of the times we wont see it.
There is a suspicion that during shooting , when cameras are connected , some cameras will turn off and chdkptp wont throw an error...and we keep working like nothing happened..with less cameras...
I believe the most probable scenario is that some camera(s) are losing connection and some (other) cameras turn off at the same time.
So during reconnection of the cameras , we miss the turned off ones if we are not paying attention to chdkptp output that says that cameras xx ,yy ,zz are missing (turned off).

To be honest we cannot pinpoint the exact time the turning off of the cameras is occured.During shooting ?during when some cameras losing connection and that affects the turning off of some other cameras?We cant really say.
I wasn't even shooting today..just had the cameras turned on and connected to chdkptp...noone was touching the cameras , noone was touching the cables...and had cameras failing connection..turning off...
And i am 99.99999% sure i have disable any powersaving setting...

I will do some more tests tomorrow.
Title: Re: Multi-camera setup project.
Post by: srsa_4c on 06 / February / 2017, 20:29:05
I believe the most probable scenario is that some camera(s) are losing connection and some (other) cameras turn off at the same time.
This is IMHO unlikely to be a software issue. If things worsen gradually, it might be that the camera power supplies deteriorate (especially if they are cheap Chinese ones). It's also possible that you have ground loop (https://en.wikipedia.org/wiki/Ground_loop_(electricity)) issues (computer / usb hubs and camera power supplies are not on the same ground).
Title: Re: Multi-camera setup project.
Post by: mphx on 06 / February / 2017, 21:39:36
I believe the most probable scenario is that some camera(s) are losing connection and some (other) cameras turn off at the same time.
This is IMHO unlikely to be a software issue. If things worsen gradually, it might be that the camera power supplies deteriorate (especially if they are cheap Chinese ones). It's also possible that you have ground loop (https://en.wikipedia.org/wiki/Ground_loop_(electricity)) issues (computer / usb hubs and camera power supplies are not on the same ground).


Well , hardware and setup hasnt change from day one.And this mysterious turn offs started only recently. What you said about camera power supplies makes me worry...because they are indeed chinese ones and not original canon power supplies.
I will investigate this angle too.
Title: Re: Multi-camera setup project.
Post by: andrew.stephens.754365 on 07 / February / 2017, 04:55:53
I something goes wrong I can then do a soft-reset back to the standard.

Nice.

I recently considered simply installing a known good disk image (using a freeware PE) every morning from a remote script over the newtwork - not so elegant as yours.
Title: Re: Multi-camera setup project.
Post by: mphx on 07 / February / 2017, 15:59:05
UPDATE

I think we found the cause of the problem (of random cameras turning off).

A little background so everyone can follow the story.

We have 3 shooting modes.

1.Single shooting (for kids and pets)
2.Double shooting (for adults)
3.Preshoot + shoot (for kids and pets)

Single shooting , just preshoots and shoots. Mode number #3 , has preshoot and shoot seperated , so we preshoot and then issue shoots at will.

Few months ago , i was searching a way to shoot multiple shots in short time , like 2-3 secs.At that point reyalp introduced shoot_burst command.
I modified the "shoot" button of the mode #3 shooting just to make some tests.
After i was done , i left that button to use shoot_burst and just shoot one shoot at a time.
Good thing about shoot_burst is that it "keeps" preshoot during shooting.So i issue preshoot once and then issue "shoot_burst" at my will multiple times without issue preshoot anymore.

Today after many tests and experiments we found out what was causing the problem .

Shoot_burst + preview mode.


We did MANY MANY tests doing "preshoot" + shoot_burst x multiple times...the moment we pressed preview mode , cameras were turning off (90% of the turned off cameras were the same every time).
And i was wrong before when i said lens were retracted when they turn off.They don't retract.

I edited the button and instead of shoot_burst i put shoot_hook_sync...did the same thing....clicked preview mode button...none of the cameras turned off.

So i want to believe that this was the problem.

Using shoot_burst may be overkill but it offered "preshoot pressed constantly" and we could only press shoot ...very useful when u have kids and they move all the time.
Now i modified the button to use shoot_hook_sync but we have to press preshoot before every shot...2-3 secs will be lost there..and kids are hard to be kept still.
Anyways....i dont know if shoot_burst has a bug or anything , or its the combination of shoot_burst , preview mode and the specific cameras that were affected...
Title: Re: Multi-camera setup project.
Post by: reyalp on 07 / February / 2017, 16:31:43

Shoot_burst + preview mode.


We did MANY MANY tests doing "preshoot" + shoot_burst x multiple times...the moment we pressed preview mode , cameras were turning off (90% of the turned off cameras were the same every time).
I don't understand what you mean by "preview mode".

I also don't really get from your post which specific sequence of calls causes the problem or not. I would like to fix or at least understand crashes, but I do not have enough information to do anything.
Title: Re: Multi-camera setup project.
Post by: mphx on 07 / February / 2017, 16:46:50
I don't understand what you mean by "preview mode".

I also don't really get from your post which specific sequence of calls causes the problem or not. I would like to fix or at least understand crashes, but I do not have enough information to do anything.


Ah yes my bad , when i say "preview mode" , i mean the "play" mode. Atleast in chdkptp the command is "play" .When camera's display , shows the last photo taken.
So the sequence of calls is "preshoot" + "shoot_burst" (the number of shoot_burst used is irrelevant , the problem occurs even with one shoot_burst) and then issuing "play" command (you know so you can review the photo taken on camera's display).
Title: Re: Multi-camera setup project.
Post by: reyalp on 07 / February / 2017, 22:13:26
Ah yes my bad , when i say "preview mode", i mean the "play" mode.
Thanks, I understand now.
Quote
So the sequence of calls is "preshoot" + "shoot_burst" (the number of shoot_burst used is irrelevant , the problem occurs even with one shoot_burst) and then issuing "play" command (you know so you can review the photo taken on camera's display).
Does the camera crash (shut down) or just stop responding to chdkptp?
At what point does the problem happen, immediately after switching to play mode, or subsequently when you try to switch back to rec or try to shoot again?
If it crashes, please get a ROMLOG from one camera. See http://chdk.wikia.com/wiki/Debugging#Camera_crash_logs_.28romlog.29
Title: Re: Multi-camera setup project.
Post by: mphx on 08 / February / 2017, 05:11:26
Does the camera crash (shut down) or just stop responding to chdkptp?
At what point does the problem happen, immediately after switching to play mode, or subsequently when you try to switch back to rec or try to shoot again?
If it crashes, please get a ROMLOG from one camera. See http://chdk.wikia.com/wiki/Debugging#Camera_crash_logs_.28romlog.29 (http://chdk.wikia.com/wiki/Debugging#Camera_crash_logs_.28romlog.29)

I believe they shut down.If i reconnect cameras , the turned off cameras dont show up anymore...i have to power them on again .
So i guess they are shutting down.

The problem happens when i issue play command (after preshoot+shoot_burst) .Camera tries to go into play mode ...display turns off and stays off..never displays the last photo taken.Display off , led off..The End :)

I will try to get a crash log later today...
Title: Re: Multi-camera setup project.
Post by: mphx on 08 / February / 2017, 06:20:08
@reyalp

Ok , i turned on one camera i know it crashes.I repeated the steps (preshoot+2x shoot_burst+play mode).
It turned off as expected (the bus id on chdkptp dissapeared...i believe that means camera is off for sure :) )
I then turned it on again , went to chdk menu , misc-debugging-save romlog , download it to pc and here it is.

https://www.dropbox.com/s/pz7filk9y2d0ezx/ROMLOG.LOG?dl=0 (https://www.dropbox.com/s/pz7filk9y2d0ezx/ROMLOG.LOG?dl=0)

Have in mind , that some cameras are not affected or it seems that they are not affected...maybe cameras turn off randomly .
So maybe there is a hardware incompatibility or something..
All cameras are running chdk 1.5.0 4740
Title: Re: Multi-camera setup project.
Post by: reyalp on 08 / February / 2017, 23:11:00
Can you check if the clock is approximately correct on the camera?
The romlog says
Quote
Occured Time  2015:06:21 23:08:31
So unless the clock is a couple years off, it's not related to the crash.
Title: Re: Multi-camera setup project.
Post by: mphx on 09 / February / 2017, 07:56:02
Can you check if the clock is approximately correct on the camera?
The romlog says
Quote
Occured Time  2015:06:21 23:08:31
So unless the clock is a couple years off, it's not related to the crash.

Some cameras (if not all) don't have the correct date and we know that.When we first set up the whole thing , some cameras kept losing the date setting (probably something to do with the fact that they operate with dummy battery-external power source or something like that).
So we got tired setting up date every time and we left it as is.It didn't bother us so we left it be.

The romlog i attached was created exactly after the crash.I don't know if it contains anything related to the crash but having a past date is normal.
Title: Re: Multi-camera setup project.
Post by: reyalp on 09 / February / 2017, 13:13:46
The romlog i attached was created exactly after the crash.I don't know if it contains anything related to the crash but having a past date is normal.
The romlog is saved to internal flash memory by the canon firmware when the crash occurs. The CHDK romlog just copies the most recent saved romlog to the SD card so you can download it. It is possible that the problem you have with switching to playback doesn't generate a romlog.

I am asking whether that specific cameras clock is set to 2015. YES or NO. I don't want to spend time trying to debug a log that has nothing to do with the problem you reported.

Also, please tell me which camera model and firmware version this came from.
Title: Re: Multi-camera setup project.
Post by: mphx on 09 / February / 2017, 19:02:56
The romlog is saved to internal flash memory by the canon firmware when the crash occurs. The CHDK romlog just copies the most recent saved romlog to the SD card so you can download it. It is possible that the problem you have with switching to playback doesn't generate a romlog.

I am asking whether that specific cameras clock is set to 2015. YES or NO. I don't want to spend time trying to debug a log that has nothing to do with the problem you reported.

Also, please tell me which camera model and firmware version this came from.

This specific camera is one of many that when is turned on drops you to date/time set up screen...so its very possible that this specific camera's clock is set to 2015.
As i said we stopped setting up date/time to some cameras from very beginning and the beginning was like 1-1,5 years ago.So yes date of 2015 is very very possible.
I can't check it out for sure right now. I will be at studio Saturday and check then to be sure.

But what you said and i put in bold is what i suspected from the beginning (after checking romlog with my near to zero knowledge of these things).That maybe this problem isn't actually a crash and no romlog is generated at all.

Camera is Canon A2500 , firmware : 100a , chdk : 1.5.0 4740

EDIT : An easy way to find out if a romlog is generated by the problem is to set date to current date , repeat the process , use chdk romlog thing and see what date is referred in that log.If chdk copies the latest and the romlog still has 2015 in it , then no romlog was generated.But if it has 2016 on it , its a newly generated one.
Gonna do it when i will be at studio.
Title: Re: Multi-camera setup project.
Post by: wasd on 02 / April / 2017, 04:46:02
Hi mphx:
     I have 8 cameras and it's make me crazy to charger them everytime,so i bought a DC 12V power supplies and some DC-DC converters tried to power the cameras,but it's failed at the beginning with one camera,when i try to zoom in ,camera died, i think maybe because of the length of the DC12 power and the camera.The length I need is 4 meters.
Could you help me with your experience?
Thanks.

通过我的 MX5 上的 Tapatalk发言

Title: Re: Multi-camera setup project.
Post by: waterwingz on 02 / April / 2017, 07:01:54
so i bought a DC 12V power supplies and some DC-DC converters
Digital cameras need a lot of current when running motors, charging flash capacitors, and writing to the SD card. So your power supplies need to be able to handle high current bursts.  What are the ratings of your 12 V supply and the DC-DC converters? Did you mount a converter at each camera so that the lowest voltage / highest current wire runs are the shortest?

A wiring diagram and photos showing your complete setup would be useful to see here.
Title: Re: Multi-camera setup project.
Post by: cdg on 02 / April / 2017, 07:29:14
A wiring diagram and photos showing your complete setup would be useful to see here.
Here is the diagram.
Title: Re: Multi-camera setup project.
Post by: cdg on 02 / April / 2017, 07:49:36

The supply is DC 12V 12.5A
and i tried to add two 2200uf capacitors,still not working.
Title: Re: Multi-camera setup project.
Post by: srsa_4c on 02 / April / 2017, 08:14:35
Here is the diagram.
If your DC-DC converter really only has a 800mA rating, that might not be sufficient for supplying the camera. Choose a converter that can handle the camera's peak currents (which could probably exceed 2A). Take a look at the specs (output current) of the original Canon power supply to get an idea.

late edit:
Found a picture of a genuine looking CA-DC10 power supply on the 'net. It says:
Output: 4.3V 1.5A
Title: Re: Multi-camera setup project.
Post by: cdg on 02 / April / 2017, 08:48:14
Take a look at the specs (output current) of the original Canon power supply to get an idea.
Thank you ! i will try to find out that current.
Title: Multi-camera setup project.
Post by: waterwingz on 02 / April / 2017, 12:54:27
Take a look at the specs (output current) of the original Canon power supply to get an idea.
Thank you ! i will try to find out that current.
As srsa_4c suggests, your DC-DC converter is almost certainly too small. The moment the camera starts to zoom, the current draw needed will overload it.  As you have already observed.  There are several posts on this forum documenting measured brief current draws of about 1.5 amps IIRC!  Those extra capacitors you added will not help enough to overcome that.

You need something that can source at least 1.5 amps for several seconds without overloading.
Title: Re: Multi-camera setup project.
Post by: mphx on 02 / April / 2017, 22:37:58
Hi mphx:
     I have 8 cameras and it's make me crazy to charger them everytime,so i bought a DC 12V power supplies and some DC-DC converters tried to power the cameras,but it's failed at the beginning with one camera,when i try to zoom in ,camera died, i think maybe because of the length of the DC12 power and the camera.The length I need is 4 meters.
Could you help me with your experience?
Thanks.

通过我的 MX5 上的 Tapatalk发言

Why not use a dummy battery pack ?Many cameras have one for situations like this where , getting batteries out , charge them , put them back in , is not practical at all.

You don't mention your camera model , but you can look it up and see if there is one.
And you can "cut" the distance down by using a long power cord and a multi-power-outlet thing (don't know/remember how it is called in english :P )

Only bad thing about dummy battery packs is that they can get really expensive if you have to buy lots of them (dummy battery pack for my model is around 10-11 euros on ebay and i don't think they are the original ones..so 10 x 64 cameras...you get the idea...)
Atleast we know they have the correct specs .
Title: Re: Multi-camera setup project.
Post by: cdg on 03 / April / 2017, 02:45:27
Only bad thing about dummy battery packs is that they can get really expensive if you have to buy lots of them (dummy battery pack for my model is around 10-11 euros on ebay and i don't think they are the original ones..so 10 x 64 cameras...you get the idea...)
Atleast we know they have the correct specs .
Just like you said,not cheap for the dummy battery pack.
[/size]I will try to change the [/size]DC-DC converter to 2A or 3A first,see what hanppens,if still not working,i will buy the [/size]dummy battery pack.
Title: Re: Multi-camera setup project.
Post by: cdg on 03 / April / 2017, 02:48:16
Take a look at the specs (output current) of the original Canon power supply to get an idea.
Thank you ! i will try to find out that current.
As srsa_4c suggests, your DC-DC converter is almost certainly too small. The moment the camera starts to zoom, the current draw needed will overload it.  As you have already observed.  There are several posts on this forum documenting measured brief current draws of about 1.5 amps IIRC!  Those extra capacitors you added will not help enough to overcome that.

You need something that can source at least 1.5 amps for several seconds without overloading.
[size=78%]I going to buy some DC-DC [/size][/size]converters with 2A or 3A to see if it's working.[size=78%]
Title: Re: Multi-camera setup project.
Post by: bismo on 17 / January / 2019, 02:18:45
How do you load the bcamHost.lua?
I don't understand how to run it on the PC, I've successfully run the bcamRem.lua on the camera by loading it via card reader to the card and run it with "Load Script from File..."
Title: Re: Multi-camera setup project.
Post by: mphx on 17 / January / 2019, 07:46:52
How do you load the bcamHost.lua?
I don't understand how to run it on the PC, I've successfully run the bcamRem.lua on the camera by loading it via card reader to the card and run it with "Load Script from File..."
It's been a while since i was playing with lua scripts in chdkptp.So i dont quite remember :) But have a look at this (https://github.com/simonswine/chdkptp/blob/master/USAGE.TXT) link.Start cli mode of chdkptp and my bet is on this :
Code: [Select]
exec (!)     <lua code>  : - execute local lua
To integrate the script in GUI , its a bit more complicated if i remember well...

Title: Re: Multi-camera setup project.
Post by: bismo on 17 / January / 2019, 22:29:53
How do you load the bcamHost.lua?
I don't understand how to run it on the PC, I've successfully run the bcamRem.lua on the camera by loading it via card reader to the card and run it with "Load Script from File..."
It's been a while since i was playing with lua scripts in chdkptp.So i dont quite remember :) But have a look at this (https://github.com/simonswine/chdkptp/blob/master/USAGE.TXT) link.Start cli mode of chdkptp and my bet is on this :
Code: [Select]
exec (!)     <lua code>  : - execute local lua
To integrate the script in GUI , its a bit more complicated if i remember well...


Thanks for the reply! I'll try it after school tonight.
Title: Re: Multi-camera setup project.
Post by: bismo on 07 / March / 2019, 12:13:54
How do you load the bcamHost.lua?
I don't understand how to run it on the PC, I've successfully run the bcamRem.lua on the camera by loading it via card reader to the card and run it with "Load Script from File..."
It's been a while since i was playing with lua scripts in chdkptp.So i dont quite remember :) But have a look at this (https://github.com/simonswine/chdkptp/blob/master/USAGE.TXT) link.Start cli mode of chdkptp and my bet is on this :
Code: [Select]
exec (!)     <lua code>  : - execute local lua
To integrate the script in GUI , its a bit more complicated if i remember well...


Sorry this reply took so long, I was caught up in something.
Anyway the script works, turns out I've downloaded the wrong chdkptp, what I had was an entirely different program, oops.

I've successfully connect the scripts to the camera but for some reason I cannot use the remote?

I've checked the "use remote sync?" option on the script setting but still cant, and everytime after I run the bcamRem, my remote parameters setting resetted (previously I've checked it and use the one shot)

but when I load the default.lua I can use the remote no problem

can you help point me in the right direction?

Thanks!
Title: Re: Multi-camera setup project.
Post by: mphx on 07 / March / 2019, 12:19:55

Sorry this reply took so long, I was caught up in something.
Anyway the script works, turns out I've downloaded the wrong chdkptp, what I had was an entirely different program, oops.

I've successfully connect the scripts to the camera but for some reason I cannot use the remote?

I've checked the "use remote sync?" option on the script setting but still cant, and everytime after I run the bcamRem, my remote parameters setting resetted (previously I've checked it and use the one shot)

but when I load the default.lua I can use the remote no problem

can you help point me in the right direction?

Thanks!
As i said , its been a while since i was playing with these things.I use chdkptp (gui) for specific actions and i haven't update/change anything in chdptp for months if not years.So i don't remember much about stuff :) Reyalp or anyone else watching this thread might have better answers than me.
What are you trying to do and in what way?
Title: Re: Multi-camera setup project.
Post by: waterwingz on 07 / March / 2019, 12:34:35
I've successfully connect the scripts to the camera but for some reason I cannot use the remote?
Are you trying to use a USB remote like the one describe here? (https://chdk.fandom.com/wiki/USB_Remote)  If so, how do you have that wired to your USB connection to your PC?

Using both PTP and a wire remote is tricky.  That's why we added the usb_force_active( ) (https://chdk.fandom.com/wiki/Lua/PTP_Scripting#usb_force_active) function.

Quote
I've checked the "use remote sync?" option on the script setting
That option is only needed when you are trying to get two or more cameras to shoot at almost exactly the same time.

Quote
and everytime after I run the bcamRem, my remote parameters setting resetted (previously I've checked it and use the one shot)
Is that the script I posted almost five years ago? If so, I'll have to drag it out of my svn archive and try to figure out what I was doing way back then.  IIRC, it sets up the remote parameter configuration - overriding the current settings and does not politely reset them when it is done.  Sorry.


Edit :  thread continues here : Re: Building a mult-camera rig (https://chdk.setepontos.com/index.php?topic=11583.msg139693#msg139693)