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

dfort

  • Hero Member
  • *****
  • Posts: 2087
Re: Assign lens focal length and name for non cpu lenses
« Reply #225 on: September 02, 2017, 03:16:02 AM »
A while back we discussed the possibility of adding an optional block that could take more than 32 characters, actually 31 characters terminated by a null (0).

Note the truncated name (...ZF.2)

Code: [Select]
Block: LENS
  Offset: 0x00000164
    Size: 96
    Time: 0.806000 ms
     Name:        'Zeiss Makro-Planar T* 2/100 ZF.'
     Serial:      ''
     Focal Len:   100 mm
     Focus Dist:  0 mm
     Aperture:    f/2.00
     IS Mode:     0
     AF Mode:     3
     Lens ID:     0x00000000
     Flags:       0x00000000

Any progress on that yet?
EOSM.202 EOSM.203 EOSM2.103 700D.115 5D3.*

Lars Steenhoff

  • Senior
  • ****
  • Posts: 296
Re: Assign lens focal length and name for non cpu lenses
« Reply #226 on: September 10, 2017, 11:24:22 PM »
What's the best way to make a build that combines the crop_rec_4k experiment with the manual lens info branch?

Import the manual lens into the crop_rec_4k branch?

and can this perhaps be done already for the main crop_rec_4k branch.  So that the new experimental build also include the option to set the lens info.

I don't want to make a pull request yet because I don't know what implication this has for the crop_rec_4k branch.
I would like to see a newer build for people to experiment with so we get more feedback on its use.

I can make one but I don't know how to upload it to the experiments page.

dfort

  • Hero Member
  • *****
  • Posts: 2087
Re: Assign lens focal length and name for non cpu lenses
« Reply #227 on: September 11, 2017, 01:54:59 AM »
What's the best way to make a build that combines the crop_rec_4k experiment with the manual lens info branch?

Merge

I did that a while ago and it seems to work fine. Seeing your message I thought I'd update it. There were some conflicts that I'm pretty sure I resolved properly. The branch is here:

https://bitbucket.org/daniel_fort/magic-lantern/branch/crop_rec_4k_manual_lens_info

It would be nice to add manual_lens_info to crop_rec_4k sort of like how raw_video_10bit_12bit was merged into crop_rec_4k. Only a few cameras are working with crop_rec_4k so those other branches are not going away any time soon.

As far as posting to the experiments page, I believe only a developer can do that. Of course if you can compile ML you can post your own test builds. Hint.
EOSM.202 EOSM.203 EOSM2.103 700D.115 5D3.*

Lars Steenhoff

  • Senior
  • ****
  • Posts: 296
Re: Assign lens focal length and name for non cpu lenses
« Reply #228 on: September 11, 2017, 12:55:49 PM »
Thanks
Yea I tested your build too, I still can't get it to auto run on startup on the canon 5d mk3 1.2.3
I guess you have the same?

And for the mlv play module to load mlv_rec has to be disabled.
But I think thats a known issue.

JohanJ

  • Freshman
  • **
  • Posts: 52
Re: Assign lens focal length and name for non cpu lenses
« Reply #229 on: September 11, 2017, 01:55:13 PM »
In case you did not notice yet. @a1ex placed a pull request to merge lens_info into lua_fix which is probably the easiest and fastest way to get this function into nightly and also different experimental branches. Might be  good to comment this PR.
60D.111 / 100D.101 / M2.103

Lars Steenhoff

  • Senior
  • ****
  • Posts: 296
Re: Assign lens focal length and name for non cpu lenses
« Reply #230 on: September 11, 2017, 02:47:35 PM »
@JohanJ. Good tip, thanks

Lars Steenhoff

  • Senior
  • ****
  • Posts: 296
Re: Assign lens focal length and name for non cpu lenses
« Reply #231 on: September 14, 2017, 12:19:22 PM »
I added a few more Nikon lenses.

Code: [Select]
--  Nikon lenses
    { name = "Nikon AF Fisheye-NIKKOR 16mm f/2.8D",          focal_length =  16, manual_aperture = 2.8 },
    { name = "Nikon AF NIKKOR 20mm f/2.8D",          focal_length =  20, manual_aperture = 2.8 },
    { name = "Nikon AF NIKKOR 28mm f/1.4D",          focal_length =  28, manual_aperture = 1.4 },
    { name = "Nikon AF NIKKOR 35mm f/2D",            focal_length =  35, manual_aperture = 2   },
    { name = "Nikon AF NIKKOR 50mm f/1.4D",          focal_length =  50, manual_aperture = 1.4 },
    { name = "Nikon AFS-NIKKOR 50mm f/1.8G",         focal_length =  50, manual_aperture = 1.8 },
    { name = "Nikon AF Micro-NIKKOR 60mm f/2.8D",    focal_length =  60, manual_aperture = 2.8 },
    { name = "Nikon AF NIKKOR 85mm f/1.4D IF",       focal_length =  85, manual_aperture = 1.4 },
    { name = "Nikon AF DC-NIKKOR 105mm f/2D",        focal_length = 105, manual_aperture = 2   },
    { name = "Nikon AF DC-NIKKOR 135mm f/2D",        focal_length = 135, manual_aperture = 2   },
    { name = "Nikon AF NIKKOR 28-105 f3.5-4.5D",     focal_length =  28, manual_aperture = 3.5 },

--  Nikon Manual focus lenses
    { name = "Nikon Zoom Ais ED 50-300",             focal_length = 300, manual_aperture = 4.5 },
    { name = "Nikon Ais NIKKOR 24mm f/2.8",          focal_length =  24, manual_aperture = 2.8 },
    { name = "Nikon Ais NIKKOR 35mm f/1.4",          focal_length =  35, manual_aperture = 1.4 },
    { name = "Nikon Ais NIKKOR 55mm f/1.2",          focal_length =  55, manual_aperture = 1.2 },
    { name = "Nikon Ais NIKKOR 105mm f/1.8",         focal_length = 105, manual_aperture = 1.8 },
    { name = "Nikon Ais NIKKOR 500mm f/8",           focal_length = 500, manual_aperture = 8   },
    { name = "Kiron Macro 100mm f/2.8",              focal_length = 105, manual_aperture = 2.8 },

--  Anamorphic Lenses
    { name = "Iscorama Anamorphic 50 f/2.8mm ",      focal_length =  50, manual_aperture = 2.8 },

I know the list is not complete but there are so many manual lenses
http://www.photosynthesis.co.nz/nikon/lenses.html

Full manual lenses from Nikon won't be recognised in ACR because adobe does not have profile for them.
There is a way to make profiles with the adobe profile creator.
http://supportdownloads.adobe.com/detail.jsp?ftpID=5493.

Here an article on the editor
http://blogs.adobe.com/jkost/2013/09/create-your-own-lens-profiles.html

The best way to auto recognise them is what fort described here.
@Lars_Steenhoff

Had a breakthrough today. To get your Nikon AF NIKKOR 35mm f2D lens working with the lua script simply copy the profile from the ACR installation. I'm not sure what the Windows location is but on the Mac it is in:

Code: [Select]
/Library/Application Support/Adobe/CameraRaw/LensProfiles/1.0/Nikon/NIKON D3X (Nikon AF NIKKOR 35mm f2D) - RAW.lcp
and put the copy in your user area, again on the Mac it is in:

Code: [Select]
/Users/<you>/Library/Application Support/Adobe/CameraRaw/LensProfiles/1.0/
Then edit the stCamera:Lens from this:

Code: [Select]
<stCamera:Lens>35.0 mm f/2.0</stCamera:Lens>
To this:

Code: [Select]
<stCamera:Lens>Nikon AF NIKKOR 35mm f2D</stCamera:Lens>
Do a copy/replace because there are multiple instances of that tag.

Finally put that lens name in your lua script and that's it.

For more details, here's my latest post on the Adobe Camera Raw forum:

https://forums.adobe.com/message/9200782#9200782

NunoCaldeira

  • New to the forum
  • *
  • Posts: 40
Re: Assign lens focal length and name for non cpu lenses
« Reply #232 on: September 23, 2017, 06:14:32 PM »
update with two new lenses:
Code: [Select]
{ name = "Lensbaby Sweet 80", focal_length = 80, manual_aperture =  2.8 },
{ name = "Lensbaby Creative Bokeh", focal_length = 50, manual_aperture =  2.5 },

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3052
Re: Assign lens focal length and name for non cpu lenses
« Reply #233 on: September 23, 2017, 08:54:15 PM »
Any progress on that yet?

nope.
did i miss a field there? maybe something you want/have to add?
as soon it is "live" there is no way back :)

Code: [Select]
typedef struct {
    uint8_t     blockType[4];    /* ELNS - Extended LENS block with longer lens name and optional fields, depending on camera */
    uint32_t    blockSize;
    uint64_t    timestamp;
    uint16_t    focalLengthMin;  /* shortest focal length in mm                       */
    uint16_t    focalLengthMax;  /* longest focal length in mm                        */
    uint16_t    apertureMin;     /* lowest f-number * 100                             */
    uint16_t    apertureMax;     /* highest f-number * 100                            */
    uint32_t    version;         /* lens internal version number, if available        */
    uint8_t     extenderInfo;    /* extender information, if provided by camera       */
    uint8_t     capabilities;    /* capability information, if provided by camera     */
    uint8_t     chipped;         /* when not zero, lens is communicating with camera  */
    /*uint8_t     lensName[variable]*/     /* full lens string, null terminated                 */
}  mlv_elns_hdr_t;
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3052
Re: Assign lens focal length and name for non cpu lenses
« Reply #234 on: September 23, 2017, 09:38:28 PM »
as alex pointed out, the lens firmware version could be added.
anyone knows about its maximum length?
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

dfort

  • Hero Member
  • *****
  • Posts: 2087
Re: Assign lens focal length and name for non cpu lenses
« Reply #235 on: September 24, 2017, 06:56:12 AM »
Maybe this from exiftool - Canon.pm will help?

Code: [Select]
    0x93 => { %ciMinFocal }, #15
    0x95 => { %ciMaxFocal }, #15
    0x97 => { #15
        Name => 'LensType',
        Format => 'int16uRev', # value is big-endian
        SeparateTable => 1,
        ValueConvInv => 'int($val)', # (must truncate decimal part)
        PrintConv => \%canonLensTypes,
    },
    0xa4 => { #PH
        Name => 'FirmwareRevision',
        Format => 'string[8]',
    },
EOSM.202 EOSM.203 EOSM2.103 700D.115 5D3.*

dfort

  • Hero Member
  • *****
  • Posts: 2087
Re: Assign lens focal length and name for non cpu lenses
« Reply #236 on: September 24, 2017, 07:36:25 AM »
I was adding the lenses ML users have added and this one threw me:

Code: [Select]
--  Nikon lenses
 ...
    { name = "Kiron Macro 100mm f/2.8",              focal_length = 105, manual_aperture = 2.8 },

Really? Well OK. I'm making a pull request to add more lenses to the script. Note that all lenses are commented out so you need to uncomment the lenses you plan to use.
EOSM.202 EOSM.203 EOSM2.103 700D.115 5D3.*

Lars Steenhoff

  • Senior
  • ****
  • Posts: 296
Re: Assign lens focal length and name for non cpu lenses
« Reply #237 on: September 24, 2017, 10:28:55 AM »
Thanks for organising them, the old macro lens from kiron is also there, Its not a nikon lens, buts its a nikon mount lens.

It should be in its own category.


dfort

  • Hero Member
  • *****
  • Posts: 2087
Re: Assign lens focal length and name for non cpu lenses
« Reply #238 on: September 24, 2017, 06:44:12 PM »
Right, I added a Miscellaneous category at the end of the list. Read up on Kiron lenses and it turns out that the U.S. distributor was located just a few miles from where I live yet I never heard of them. The lenses were manufactured in Tokyo by Kino Precision Industries Limited and they made lenses for companies like Vivitar. Theirs is a similar story as the current Samyang lenses.

In any case, there's no way to include every possible lens but if ML users want to contribute specs for the lenses they own, as long as the list doesn't get too long!

(Note that I added my 55mm 2.8 Micro Nikkor.)
EOSM.202 EOSM.203 EOSM2.103 700D.115 5D3.*

NunoCaldeira

  • New to the forum
  • *
  • Posts: 40
Re: Assign lens focal length and name for non cpu lenses
« Reply #239 on: October 03, 2017, 09:46:35 PM »
any idea when will we have a build with this? last one was in April

dfort

  • Hero Member
  • *****
  • Posts: 2087
Re: Assign lens focal length and name for non cpu lenses
« Reply #240 on: October 04, 2017, 07:22:14 AM »
I've got a pull request open for additional lenses but other than the branch hasn't changed much. You could comment on the pull request or just take the script from bitbucket and replace the one in your ML/scripts directory.

By the way, there's another pull request for merging manual_lens_info into lua_fix. That would be a very good thing for this project because at some point lua_fix will be merged into unified and it will be available on the nightly builds.
EOSM.202 EOSM.203 EOSM2.103 700D.115 5D3.*

Lars Steenhoff

  • Senior
  • ****
  • Posts: 296
Re: Assign lens focal length and name for non cpu lenses
« Reply #241 on: October 04, 2017, 12:19:05 PM »
Yes the merge with Lua and ultimately with croprec4k is nice to get more feedback, because yes your right the last build is a bit old
I imagine you mostly want to use it with the latest experiments and with the latest nightly builds.

NunoCaldeira

  • New to the forum
  • *
  • Posts: 40
Re: Assign lens focal length and name for non cpu lenses
« Reply #242 on: October 07, 2017, 04:33:20 PM »
I've got a pull request open for additional lenses but other than the branch hasn't changed much. You could comment on the pull request or just take the script from bitbucket and replace the one in your ML/scripts directory.

By the way, there's another pull request for merging manual_lens_info into lua_fix. That would be a very good thing for this project because at some point lua_fix will be merged into unified and it will be available on the nightly builds.

tired that, with no success. the script isnt shown on the SCRIPTS menu. when i get to DEBUG menu theres the Memory Error in red.

dfort

  • Hero Member
  • *****
  • Posts: 2087
Re: Assign lens focal length and name for non cpu lenses
« Reply #243 on: October 07, 2017, 05:51:05 PM »
@NunoCaldeira

What exactly are you doing? Updating a lua script shouldn't be that hard.
EOSM.202 EOSM.203 EOSM2.103 700D.115 5D3.*

Lars Steenhoff

  • Senior
  • ****
  • Posts: 296
Re: Assign lens focal length and name for non cpu lenses
« Reply #244 on: October 07, 2017, 06:24:04 PM »
I think you copied the script to a build from 4k crop without the capabilty of manual lens scripts?

NunoCaldeira

  • New to the forum
  • *
  • Posts: 40
Re: Assign lens focal length and name for non cpu lenses
« Reply #245 on: October 07, 2017, 11:27:04 PM »
I think you copied the script to a build from 4k crop without the capabilty of manual lens scripts?

@NunoCaldeira

What exactly are you doing? Updating a lua script shouldn't be that hard.

6D Latest Build: 2017-10-03
copy the lua script to script folder

dfort

  • Hero Member
  • *****
  • Posts: 2087
Re: Assign lens focal length and name for non cpu lenses
« Reply #246 on: October 07, 2017, 11:38:24 PM »
6D Latest Build: 2017-10-03

That's the problem. You need to use the one from the experiments page: magiclantern-manual_lens_info.2017Apr04.6D116.zip
EOSM.202 EOSM.203 EOSM2.103 700D.115 5D3.*

Lars Steenhoff

  • Senior
  • ****
  • Posts: 296
Re: Assign lens focal length and name for non cpu lenses
« Reply #247 on: October 09, 2017, 12:37:44 AM »
EDIT build is now old
@NunoCaldeira you can try this build from today where I merged the manual lens info branch on to the 4kcrop.

Please report if it works well for you, or if you have any issues.

NunoCaldeira

  • New to the forum
  • *
  • Posts: 40
Re: Assign lens focal length and name for non cpu lenses
« Reply #248 on: October 09, 2017, 01:06:39 AM »
https://www.dropbox.com/s/jwuambvb6it1xmz/magiclantern-Nightly.manual_lens_info.2017Oct09.5D3123.zip?dl=0

@NunoCaldeira you can try this build from today where I merged the manual lens info branch on to the 4kcrop.

Please report if it works well for you, or if you have any issues.
thanks, but have a 6D. not 5D MKIII :)

Lars Steenhoff

  • Senior
  • ****
  • Posts: 296
Re: Assign lens focal length and name for non cpu lenses
« Reply #249 on: October 09, 2017, 01:30:51 AM »
Ok I just tried building for the 6D but I got some errors.