Author Topic: Full-resolution silent mode with lua?  (Read 796 times)

spto

  • New to the forum
  • *
  • Posts: 10
Full-resolution silent mode with lua?
« on: March 07, 2019, 03:31:58 AM »
Hi experts,

Just wondering whether it's possible to call the silent shooting mode with a lua script?
(The silent shooting function as described here, https://www.magiclantern.fm/forum/index.php?topic=12523.msg143510#msg143510)

Thank you!

Cheers

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 6898
Re: Full-resolution silent mode with lua?
« Reply #1 on: March 07, 2019, 10:10:10 AM »
https://www.magiclantern.fm/forum/index.php?topic=9741.msg212214#msg212214
Just change the silent menu item in script or use a dumb script running
lv.start()
in photo mode
and half-shutter key press in script after activating and configuring FRSP.
If an ML function is not covered in LUA API you can always use "menu.set" and "menu.get" to access its menu item.
Photogs and videographers: Assist in proof reading upcoming in-camera help!. Your input is wanted and needed!

spto

  • New to the forum
  • *
  • Posts: 10
Re: Full-resolution silent mode with lua?
« Reply #2 on: March 08, 2019, 03:02:02 PM »
Thank you!

I noticed that even in LV mode, the mirror will always go down after the shutter closes, and it takes at least 0.7 seconds for the mirror to go up again. Can we lock the mirror during LV mode?

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 6898
Re: Full-resolution silent mode with lua?
« Reply #3 on: March 08, 2019, 03:20:31 PM »
? That's what silent.mo is all about: Taking pics without shutter and mirror actuation. Maybe a short video showing cam's screen and what is happening would be helpful.
Photogs and videographers: Assist in proof reading upcoming in-camera help!. Your input is wanted and needed!

spto

  • New to the forum
  • *
  • Posts: 10
Re: Full-resolution silent mode with lua?
« Reply #4 on: March 09, 2019, 01:21:13 PM »
Thank you Walter! I decide to use Mirror Lockup in Shoot menu instead of silent.mo, because I still want to use the physical shutter.

I have written a mini-script for testing:

Code: [Select]

-- MLUtest

Aperture = 7.1
PrefISO = 400
ShutterSpeed = 0.125

function main()
menu.close()
console.show()

beep(1,50)

camera.iso.value = PrefISO
camera.shutter.value = ShutterSpeed
camera.aperture.value = Aperture

camera.shoot(false)

beep(1,50)

console.hide()
end

main()


I first manually turned on the Mirror Lockup in Shoot menu and set the "MLU mode" to "Handheld", set "Handheld Shutter" to "1/2...1/125", set "Handheld Delay" to "1s" and set "Normal MLU Delay" to "1s".

Then I run my testing script, MLU was not functioning during the testing. (When I press the shutter manually, MLU works well)

Should I call MLU from the lua script as well to make it work? If so, could you please give an example on how to use the menu module of lua API? Thank you!

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12317
  • Emergencies only
Re: Full-resolution silent mode with lua?
« Reply #5 on: March 09, 2019, 01:46:05 PM »
Code: [Select]
-- MLU test - handheld
menu.set("Shoot", "Mirror Lockup", "ON")
menu.set("Mirror Lockup", "MLU mode", "Handheld")
menu.set("Mirror Lockup", "Handheld Shutter", "1/2...1/125")
menu.set("Mirror Lockup", "Handheld Delay", "1s")
sleep(2)
key.press(KEY.HALFSHUTTER)
key.press(KEY.FULLSHUTTER)
sleep(1)
key.press(KEY.UNPRESS_FULLSHUTTER)
key.press(KEY.UNPRESS_HALFSHUTTER)

Code: [Select]
-- MLU test - always on
menu.set("Shoot", "Mirror Lockup", "ON")
menu.set("Mirror Lockup", "MLU mode", "Always ON")
menu.set("Mirror Lockup", "Normal MLU Delay", "3s")
menu.close()
sleep(2)
camera.shoot()

Tested on 5D2 with latest lua_fix build.

TODO: merge the two delay entries under "MLU Delay" ?

spto

  • New to the forum
  • *
  • Posts: 10
Re: Full-resolution silent mode with lua?
« Reply #6 on: March 09, 2019, 02:49:25 PM »
That is so cool! It works on 550D (ML-lua-fix), thank you!!

spto

  • New to the forum
  • *
  • Posts: 10
Re: Full-resolution silent mode with lua?
« Reply #7 on: March 09, 2019, 05:02:38 PM »
Hi I made some further tests. It works well if I take only one shot, but hardly work when I try to take a series of shots.

Question: how did you choose sleep(1) between the press and unpress? What's the consideration for judging the waiting time?
Also, how to judge the waiting time needed between shots?

I cycled through such thing:

Quote
   key.press(KEY.HALFSHUTTER)
   key.press(KEY.FULLSHUTTER)
   msleep(1)
   key.press(KEY.UNPRESS_FULLSHUTTER)
   key.press(KEY.UNPRESS_HALFSHUTTER)
   task.yield(2000 + camera.shutter.ms)

It's weird that when I press the shutter button with my physical hand, 550D can take MLU shots at a rate of 1 shots / 2 seconds. But when I try the code above, it does not work at all (only 1 shot with MLU is taken).

Code: [Select]
-- MLU test - handheld
menu.set("Shoot", "Mirror Lockup", "ON")
menu.set("Mirror Lockup", "MLU mode", "Handheld")
menu.set("Mirror Lockup", "Handheld Shutter", "1/2...1/125")
menu.set("Mirror Lockup", "Handheld Delay", "1s")
sleep(2)
key.press(KEY.HALFSHUTTER)
key.press(KEY.FULLSHUTTER)
sleep(1)
key.press(KEY.UNPRESS_FULLSHUTTER)
key.press(KEY.UNPRESS_HALFSHUTTER)

Code: [Select]
-- MLU test - always on
menu.set("Shoot", "Mirror Lockup", "ON")
menu.set("Mirror Lockup", "MLU mode", "Always ON")
menu.set("Mirror Lockup", "Normal MLU Delay", "3s")
menu.close()
sleep(2)
camera.shoot()

Tested on 5D2 with latest lua_fix build.

TODO: merge the two delay entries under "MLU Delay" ?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12317
  • Emergencies only
Re: Full-resolution silent mode with lua?
« Reply #8 on: March 10, 2019, 08:49:05 AM »
1 second should be long enough to trigger a photo capture. If you press the shutter button for 1 millisecond... it's probably not.

My advice would be to stay away from multitasking features (such as task.yield), unless you know how to fix the code (I don't). Refer to docs and comments to see what's broken. For now, just keep the script single-threaded and stick with sleep/msleep.

Also, try large delays at first, to get something working, then decrease them until it stops working.

garry23

  • Contributor
  • Hero Member
  • *****
  • Posts: 1852
Re: Full-resolution silent mode with lua?
« Reply #9 on: March 10, 2019, 10:13:32 AM »
@a1ex/@spto

Just a thought. Could you also explicitly wait until you know the camera has written out the last image. Something like this:

Code: [Select]
count = dryos.shooting_card.file_number

-- MLU test - handheld
menu.set("Shoot", "Mirror Lockup", "ON")
menu.set("Mirror Lockup", "MLU mode", "Handheld")
menu.set("Mirror Lockup", "Handheld Shutter", "1/2...1/125")
menu.set("Mirror Lockup", "Handheld Delay", "1s")
sleep(2)
key.press(KEY.HALFSHUTTER)
key.press(KEY.FULLSHUTTER)
    repeat msleep(100) until dryos.shooting_card.file_number == (count + 1)
key.press(KEY.UNPRESS_FULLSHUTTER)
key.press(KEY.UNPRESS_HALFSHUTTER)

As I say, just a thought.