multicam, first steps, syntax wrong? - page 4 - General Help and Assistance on using CHDK stable releases - CHDK Forum

multicam, first steps, syntax wrong?

  • 34 Replies
  • 7526 Views
*

Offline Mlapse

  • *****
  • 584
  • S95 S110
Re: multicam, first steps, syntax wrong?
« Reply #30 on: 18 / April / 2022, 04:21:54 »
Advertisements
multicam wasn't written to be an intervalometer.
For a single camera, there's no reason to use multicam. You can use cli command, or the functions it uses in camclockutil.lua.
was more thinking of letting it set putm messages at the interval time, like 'getready'(half shoot),'now'(shoot) since the cam side script already does an interval, so if multicam or the pc doesn't do it's job, nothing lost but timing.
i looked at simple multicam script and camclockutil, but i don't grasp it enough to do anything with it yet.


Quote
In principle you could modify your script to check for a message like multcam.lua does, but it would be complicated: You can't just send message that says "set the time to X:Y:Z" because if the script is in the middle of shooting, it could be seconds before it checks for the message. So you'd need one message from the PC that says "let me know when you're ready to set the clock", then a response from the script that says "ready" and waits for a response that has the actual time to set.
i thought of something in this line myself because i am unable to get the .0 file stripped as params for loadfile.
it probably has a smaller chance of failure compaired to:
download settings, shut down cam script, start mc, set clock, start cam script with downloaded settings, shut down mc.
and i'm guessing only a fraction less accurate
frustration is a key ingredient in progress

*

Offline Mlapse

  • *****
  • 584
  • S95 S110
Re: multicam, first steps, syntax wrong?
« Reply #31 on: 01 / May / 2022, 09:45:56 »
started with putm with one cam and that works.

so with:
___>connect
con>putm shootnow

i can now trigger a shot.

but how to do that with 2 cams simultanious?
i tried:
___>!mc=require'multicam'
___>!mc:connect()
___>!mc:cmd('shootnow')

and that did the trick i think :)
« Last Edit: 01 / May / 2022, 10:41:45 by Mlapse »
frustration is a key ingredient in progress

*

Offline reyalp

  • ******
  • 14121
Re: multicam, first steps, syntax wrong?
« Reply #32 on: 01 / May / 2022, 14:01:55 »
but how to do that with 2 cams simultanious?
i tried:
___>!mc=require'multicam'
___>!mc:connect()
___>!mc:cmd('shootnow')

and that did the trick i think :)
Yeah, that should work to send a message. Note that many other multicam features will not work, because they expect the multicam camera side script to be running, or expect particular messages in response.

Again, if you want a minimal "do stuff on several cameras" script without the complexity of multicam, you could use extras/simplemulticam.lua as a starting point.
Don't forget what the H stands for.

*

Offline Mlapse

  • *****
  • 584
  • S95 S110
Re: multicam, first steps, syntax wrong?
« Reply #33 on: 01 / May / 2022, 14:39:38 »
i looked into simplemulticam, but still hard to grasp for me and multicam seems to have more things that i can use.
plus, i wanted to have as tight as possible timing between cams and thought that you wrote somewhere multicam was more accurate.

although, the fact that setclock did not work without starting cam side script was a bit dissapointing  ;)
i was actually just about to ask you what i did wrong that it had missing params when you gave me my answer.
but i'll get over that when i've figured out how to put utc+1 in that !mc:cmd message.  :)...or when i disabled whatever is blocking setclock to work as it does with single cam connect.
« Last Edit: 01 / May / 2022, 15:45:42 by Mlapse »
frustration is a key ingredient in progress


*

Offline reyalp

  • ******
  • 14121
Re: multicam, first steps, syntax wrong?
« Reply #34 on: 01 / May / 2022, 17:35:00 »
i looked into simplemulticam, but still hard to grasp for me and multicam seems to have more things that i can use.
In simplemulticam, m.connect_all connects to all available cameras. m.exec runs codes on the. You should be able to use m.exec as model for a function that sends messages using lcon:write_msg_pcall instead. While it may not be easy to understand, it is surely less complicated than multicam.
Quote
plus, i wanted to have as tight as possible timing between cams and thought that you wrote somewhere multicam was more accurate.
multicam is only "more accurate" if you use the camera side script, or implement similar logic yourself. What multicam tries to do is
1) calculate offsets of each cameras tick counter relative to PC time (mc:init_sync)
2) estimate the time required to send commands to each camera (also mc:init_sync)
3) for synchronized commands (mc:cmd with syncat, which is also used by other function like mc:shoot) tell each camera to do the action at some point in absolute time in the future (calculated using the tick counter offsets) such that all cameras will have time to receive the command.

Quote
although, the fact that setclock did not work without starting cam side script was a bit dissapointing  ;)
i was actually just about to ask you what i did wrong that it had missing params when you gave me my answer.
but i'll get over that when i've figured out how to put utc+1 in that !mc:cmd message.  :)...or when i disabled whatever is blocking setclock to work as it does with single cam connect.
If you want to implement setclock without the normal multicam camera side script, you would need to implement the corresponding code in your own camera side script. You can find it in cmds.setclock in multcam.lua, but it depends on other parts of the camera side script and uses the sync system.
Don't forget what the H stands for.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal