Author Topic: Assign lens focal length and name for non cpu lenses  (Read 60809 times)

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3574
Re: Assign lens focal length and name for non cpu lenses
« Reply #100 on: December 14, 2016, 09:26:35 AM »
All the Samyang/Rokinon/Bower cine lenses are missing from the official Adobe library but they are the same formula as the still lenses so that would be an easy place to start. Setting up the test chart and doing a real lens profile takes some effort but that is probably the best thing to do to insure that it is working for the image area that you are actually using. Things "seem" to be working now for the Zeiss ZF.2 lenses but those also have the most complicated profiles when compared to some other prime lenses.

In any case, it seems we have a good starting place. There is more that can be done with the script, especially the part about getting xmp sidecar files working but the modifications dmilligan did on the code seems like it is ready for some serious lua scripting.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

IBIRRU

  • New to the forum
  • *
  • Posts: 31
Re: Assign lens focal length and name for non cpu lenses
« Reply #101 on: December 17, 2016, 04:58:25 PM »
Dear all,
I'm an absolute beginner in lua scripting.
You are doing a great job!

I use some manual lens for astrophotography timelapse and I'll love the possibilities to set manually the exif data to avoid to do it in post.

I'm trying to use lua.mo module. All default scripts work without problems.

Then I try to load into my 700D ML card the "lens" lua scripting (adding also ui, config, xmp into library directory) but it doesn't work properly.
I cannot set the lens (I add also the name of my lens copying from this tread Samyang parts)

I find the "Lens Info Prefs" in the Prefs Menu, then "Manual lens" Option, but if I press "set" nothing appear :-\

I have tried a nightly 2016Nov30 " Genuine" and also a self compiled 

Do you know if this script work in EOS 700D?

Thanks
EOS 700D 1.1.5, EOS 500D

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3574
Re: Assign lens focal length and name for non cpu lenses
« Reply #102 on: December 17, 2016, 07:45:50 PM »
Hi @IBIRRU

Great to hear you're interested in this.

I find the "Lens Info Prefs" in the Prefs Menu, then "Manual lens" Option, but if I press "set" nothing appear :-\

I have tried a nightly 2016Nov30 " Genuine" and also a self compiled 

Do you know if this script work in EOS 700D?

I hope you are compiling from either of these branches:

https://bitbucket.org/hudson/magic-lantern/branch/manual_lens_info
https://bitbucket.org/daniel_fort/magic-lantern/branch/manual_lens_lua_script

I've just been working on adding some lenses and am having productive conversations with a staff member at Adobe to get more lens profiles for manual lenses working with this.

When you set the lens you won't "see" anything until you work with the MLV files. Right now that's the only format that this works with. Still will require some more work to get the xmp "sidecar" files working and DNG needs some back end modifications.

It should work on all platforms including the 700D. I've got one of those and just tested it to make sure.

I can see that you are able to compile--great! If you need any help, have a feature request or want a special build, just post it here.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

IBIRRU

  • New to the forum
  • *
  • Posts: 31
Re: Assign lens focal length and name for non cpu lenses
« Reply #103 on: December 18, 2016, 04:18:20 PM »
Thanks DFort :)

I compiled both branches you suggest and try both them.
I add Samyang 14mm and an old Sigma 28mm to the list just begin to try.

They both work for MLV (silent) and CR2 still pictures (with xmp sidecar file). I will wait for DNG files with correct exif data. :)

ui.lua: I found 2 little error at row 25 ("utton" instead of "button") and row 50 ("b" instead of "self"). Otherwise the lua editor doesn't work.

EOS 700D 1.1.5, EOS 500D

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3574
Re: Assign lens focal length and name for non cpu lenses
« Reply #104 on: December 18, 2016, 05:11:13 PM »
They both work for MLV (silent) and CR2 still pictures (with xmp sidecar file)...

ui.lua: I found 2 little error at row 25 ("utton" instead of "button") and row 50 ("b" instead of "self"). Otherwise the lua editor doesn't work.

You got xmp working? How? I haven't even ventured there yet. Please feel free to make pull requests for any fixes you're making. Let me know if I can help with that.

So how do you plan to use this feature? Lars Steenhoff wanted it for doing automatic lens distortion correction in Adobe Camera Raw. That lead to some interesting discussions with an Adobe staff member that might make future profiles for manual lenses a bit more user friendly. Right now the profiles for the lenses that you are using need to be hacked. More information here:

https://forums.adobe.com/message/9200782#9200782
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

IBIRRU

  • New to the forum
  • *
  • Posts: 31
Re: Assign lens focal length and name for non cpu lenses
« Reply #105 on: December 22, 2016, 07:24:00 PM »
I take hundreds of shots using manual lens with time exposure > 10 s up to 60s for nightly timelapse and load them to LRTimelapse or other software.
My goal would be take "dng Silent pictures" to save shutter wearing
Unfortunately  "dng" silent pictures do not save aperture or time or ISO into exif data.

I try xmp sidecar with CR2 and it work because when I load to LRTimelapse the aperture is correctly loaded

I try to use MLV format (but it is risky) when I deflate into dng files I could find the right lens desciption string and using ExifToolGui I can batch change into all dng files.
EOS 700D 1.1.5, EOS 500D

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3574
Re: Assign lens focal length and name for non cpu lenses
« Reply #106 on: December 22, 2016, 07:58:44 PM »
You lost me:

I try xmp sidecar with CR2 and it work because when I load to LRTimelapse the aperture is correctly loaded

xmp with CR2 isn't working yet, or at least it isn't in the current lens lua script. I'm not sure how to script it yet.

I try to use MLV format (but it is risky) when I deflate into dng files I could find the right lens desciption string and using ExifToolGui I can batch change into all dng files.

If you're using the script it should save the metadata into the MLV file and all the DNG files should have the EXIF tags. How are you "deflating" the DNG's? Since you're using the 700D I'd recommend MLVFS. That should take care of any focus pixels from that camera. Are you are using full resolution silent picture? (Search for FRSP) I haven't tried that yet with this script.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

IBIRRU

  • New to the forum
  • *
  • Posts: 31
Re: Assign lens focal length and name for non cpu lenses
« Reply #107 on: December 22, 2016, 08:50:31 PM »
I tried with Bridge and LRTimelapse.
The xmp sidecar generated from script is correctly loaded.
All lens data are present and if I change manually the data, into the xmp, Bridge load the new data without problem.

I tried MLV with MLVFS and it's ok.

Thanks DFort  :D
EOS 700D 1.1.5, EOS 500D

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 3171
  • 5D3 / M1 / 7D / 70D / SL1 / M2
Re: Assign lens focal length and name for non cpu lenses
« Reply #108 on: December 23, 2016, 08:35:43 AM »
I still don't follow you @IBIRRU -- care to share screenshots of some sort?
5D3.113 • 5D3.123 • EOSM.203 • 7D.203 • 70D.112 • 100D.101 • EOSM2.*

IBIRRU

  • New to the forum
  • *
  • Posts: 31
Re: Assign lens focal length and name for non cpu lenses
« Reply #109 on: December 23, 2016, 10:29:11 AM »
I'll try to resume:
0) I choose a manual lens data from script
1) CR2: works OK with XMP sidecar generated by script.
That means I can record the exposure exif data of manual lens and when load the pictures on Adobe Bridge or ACR I have all exposure data, time, aperture and ISO.
2) FULL SILENT PICTURE
a) Mlv format works OK  with Mlvfs. That means: the exif data embedded into dng single shots are correctly passed from script to mlv to dng.
b) DNG format: the single DNG picture doesn't have the right exif data.

I don't use the exif data for geometric correction.

I try for Samyang 14 mm a lcp profile created for  EOS 650. Edit it for EOS 700. ACR is able to use it but I don't know if is right.

Inviato dal mio GT-I9300 utilizzando Tapatalk

EOS 700D 1.1.5, EOS 500D

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3217
  • 60Da / 1100D / EOSM
Re: Assign lens focal length and name for non cpu lenses
« Reply #110 on: December 23, 2016, 02:44:19 PM »
Merged the lens info stuff from g3gg0 and fixed the typos that IBIRRU found: https://bitbucket.org/hudson/magic-lantern/branch/manual_lens_info

Haven't really tried it, there might be some weirdness with the menus now that there's a bunch of lens info in that menu.

And yes, XMP should be working.

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 3171
  • 5D3 / M1 / 7D / 70D / SL1 / M2
Re: Assign lens focal length and name for non cpu lenses
« Reply #111 on: December 23, 2016, 06:23:45 PM »
Nice find @IBIRRU and Thanks for the quick fix @dmilligan!
5D3.113 • 5D3.123 • EOSM.203 • 7D.203 • 70D.112 • 100D.101 • EOSM2.*

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3574
Re: Assign lens focal length and name for non cpu lenses
« Reply #112 on: December 24, 2016, 09:33:29 AM »
I'm getting these compile errors on several modules that seemed to have been introduced with the lens_info_fix merge.

Code: [Select]
Building module lua...
Updated HGVERSION
[ README   ]   module_strings.h
Traceback (most recent call last):
  File "../readme2modulestrings.py", line 150, in <module>
    size = extent_func(commit_msg)[0]
  File "/Users/rosiefort/magic-lantern/modules/rbf_read.py", line 64, in extent_func
    w += font.wTable[ord(c) - font.charFirst]
IndexError: list index out of range
make[4]: *** [module_strings.h] Error 1

********************************************************
WARNING: module lua failed to build, deleting
********************************************************
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12112
  • 5D Mark Free
Re: Assign lens focal length and name for non cpu lenses
« Reply #113 on: December 24, 2016, 09:52:50 AM »
Non-ASCII characters in commit message.

This looks good, but adds yet another dependency to the build process: https://www.tablix.org/~avian/blog/archives/2009/01/unicode_transliteration_in_python/

Code: [Select]
>>> from unidecode import unidecode
>>> print unidecode(u"Merge ‘lens_info_fix’ into ‘manual_lens_info’")
Merge 'lens_info_fix' into 'manual_lens_info'

A solution without additional dependencies, but non-ASCII characters are removed:
Code: [Select]
>>> msg = "Merge ‘lens_info_fix’ into ‘manual_lens_info’"
>>> print msg.decode('ascii', 'ignore')
Merge lens_info_fix into manual_lens_info

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3217
  • 60Da / 1100D / EOSM
Re: Assign lens focal length and name for non cpu lenses
« Reply #114 on: December 24, 2016, 03:36:40 PM »
Yeah I couldn't figure this one out either. I had ended up going back and making a new branch and cherry picking everything on to it. Not sure how the non-ASCII single quotes got in there. Must have been SourceTree.

I'm in favor of the no dependency option.

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3574
Re: Assign lens focal length and name for non cpu lenses
« Reply #115 on: December 24, 2016, 06:39:06 PM »
So how do you edit a commit message? I assume it has to be done by a developer who can access the hudson repository. Last time I submitted a pull request that backed out a changeset it caused all sorts of issues on my repository so I'll just go sit in a corner and wait.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3574
Re: Assign lens focal length and name for non cpu lenses
« Reply #116 on: January 04, 2017, 01:59:36 AM »
Ok, had enough sitting in a corner and decided to work around the commit issue. It wasn't as straightforward as I had hoped but it worked.

Now the problem is that the lua_fix branch doesn't draw the information on the EOSM screen properly so of course neither does the manual_lens_info branch after the merge.



Note that I have only experienced this on the EOSM. It looks fine on the 700D.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12112
  • 5D Mark Free
Re: Assign lens focal length and name for non cpu lenses
« Reply #117 on: January 04, 2017, 09:56:21 AM »
I can try to troubleshoot it in QEMU, but I need some things from you:

- your autoexec.bin (the one that shows incorrect display)
- a startup log from dm-spy-experiments branch, with mpu_send/mpu_recv stubs (0x1dd2c, 0x36A0); background info here and here.
- same log from 700D (stubs already there)
- a serial flash dump (here; will commit a more polished version soon)

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3574
Re: Assign lens focal length and name for non cpu lenses
« Reply #118 on: January 04, 2017, 06:10:46 PM »
Thanks a1ex, I'm working on getting what you asked for.

I made a regression test and found that commit 56464bc is where the issue first appeared.

Quote
bmp_printf: allow transparent text on transparent background
(note: this breaks binary compatibility with modules)
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12112
  • 5D Mark Free
Re: Assign lens focal length and name for non cpu lenses
« Reply #119 on: January 04, 2017, 06:44:37 PM »
Just in case: did you recompile everything with make clean?

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3574
Re: Assign lens focal length and name for non cpu lenses
« Reply #120 on: January 04, 2017, 07:04:11 PM »
Yes, I'm running make clean on every compile run.

I got the autoexec.bin files from the lua_fix branch for both the EOSM (incorrect display) and the 700D (correct display)

Now I'm stuck trying to figure out how to get a startup log with the dm-spy-experiments branch.
[EDIT] Dumb mistake -- logging is working.

I saw the Serial flash dumper pull request. It has a note with my name on it and thought, uh oh -- what did I get myself into? I'm doing my best to get this together. Note, I've never used QEMU though that's on my to learn list.

In the meantime I'm adding the files you're requesting in this dropbox folder:
https://www.dropbox.com/sh/m17imm8wqavd1q3/AADOhSg95KRemu6WGc9zRqgaa?dl=0
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12112
  • 5D Mark Free
Re: Assign lens focal length and name for non cpu lenses
« Reply #121 on: January 04, 2017, 07:10:57 PM »
Just CONFIG_DEBUG_INTERCEPT_STARTUP = y should be enough for 700D. The log file is created at startup, a few seconds after starting the camera.

These stubs are in dm-spy-extra.c (easy to find with grep, or with a text editor that can search in all files from a directory).

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3574
Re: Assign lens focal length and name for non cpu lenses
« Reply #122 on: January 04, 2017, 07:38:59 PM »
Got it. Startup logs are in the dropbox folder. Next challenge, serial flash dump.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3574
Re: Assign lens focal length and name for non cpu lenses
« Reply #123 on: January 04, 2017, 08:12:57 PM »
Ok serial flash dumps are uploaded to the dropbox folder.

https://www.dropbox.com/sh/m17imm8wqavd1q3/AADOhSg95KRemu6WGc9zRqgaa?dl=0

I made the dump with only the sf_dump module enabled and saw some 404 reports on the console for dual_iso and other modules that were not enabled. I played around with it a little more and found that depending on which modules are loaded it might be saving different information in the dump. I'll run another dump with these modules loaded:

Code: [Select]
dual_iso
ettr
mlv_snd (mlv_rec)
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3574
Re: Assign lens focal length and name for non cpu lenses
« Reply #124 on: January 04, 2017, 08:24:07 PM »
@a1ex -- You should have everything you asked for now. I'm also doing a pull request for the dm-spy-experiments branch to add the mpu_send/mpu_recv stubs for the EOSM.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102