Assign lens focal length and name for non cpu lenses

Started by Lars Steenhoff, October 29, 2016, 12:04:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dfort

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)

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?

Lars Steenhoff

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

Quote from: Lars Steenhoff 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?

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.

Lars Steenhoff

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

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

I added a few more Nikon lenses.

--  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.
Quote from: dfort on December 14, 2016, 03:50:52 AM
@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:

/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:

/Users/<you>/Library/Application Support/Adobe/CameraRaw/LensProfiles/1.0/

Then edit the stCamera:Lens from this:

<stCamera:Lens>35.0 mm f/2.0</stCamera:Lens>

To this:

<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

update with two new lenses:

{ name = "Lensbaby Sweet 80", focal_length = 80, manual_aperture =  2.8 },
{ name = "Lensbaby Creative Bokeh", focal_length = 50, manual_aperture =  2.5 },

g3gg0

Quote from: dfort on September 02, 2017, 03:16:02 AM
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 :)


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

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

Maybe this from exiftool - Canon.pm will help?

    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]',
    },

dfort

I was adding the lenses ML users have added and this one threw me:

Quote from: Lars Steenhoff on September 14, 2017, 12:19:22 PM
--  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.

Lars Steenhoff

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

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.)

NunoCaldeira

any idea when will we have a build with this? last one was in April

dfort

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.

Lars Steenhoff

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

Quote from: dfort 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.

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

@NunoCaldeira

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

Lars Steenhoff

I think you copied the script to a build from 4k crop without the capabilty of manual lens scripts?

NunoCaldeira

Quote from: Lars Steenhoff 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?

Quote from: dfort on October 07, 2017, 05:51:05 PM
@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

Quote from: NunoCaldeira on October 07, 2017, 11:27:04 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

Lars Steenhoff

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

Quote from: Lars Steenhoff on October 09, 2017, 12:37:44 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

Ok I just tried building for the 6D but I got some errors.