Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MLV App cannot deal with black level 0 #184

Open
ilia3101 opened this issue Oct 13, 2019 · 34 comments
Open

MLV App cannot deal with black level 0 #184

ilia3101 opened this issue Oct 13, 2019 · 34 comments
Assignees
Labels

Comments

@ilia3101
Copy link
Owner

ilia3101 commented Oct 13, 2019

For MLV App to support the future of MLV, it will need to support black level at 0. Cameras like Apertus, Nikon, Sony and Arri can often have 0 black level.

Currently, when the value is zero, MLV App seems to think black level is something much higher than zero, so it produces a very green/black image, and the only fix is to set black level to 1, which looks close enough, but is technically wrong.

I think MLV App uses black level being set to zero as some sort of flag for black level repair? Not sure how this part works.

A black level of zero does bring back the debayer issues we had when trying to subtract it. But this is a separate issue.

@ilia3101 ilia3101 added the bug label Oct 13, 2019
@masc4ii
Copy link
Collaborator

masc4ii commented Oct 13, 2019

I have to search in code, but I think you are right: 0 should be some flag for some functionality, but I forgot about. In past we thought that there will never be a clip with 0 black level.

@ilia3101
Copy link
Owner Author

isn't this black level feature from bouncyball? I guess we can wait for a bit until he is here again, as it should be easier for him to fix it than us.

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 13, 2019

We had to work together in this regard, because we had very big problems with this black level slider. In the first 15min of searching, I did not find the important part yet... have to search more...

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 13, 2019

Okay... I am now ready and read all the black level related code. And I found the code parts, where I discussed so long with bouncyball and I remember. But it was related to "original black level" and "corrected black level". We save the black level from the MLV in a extra variable, and the slider overwrites the MLV header value. On doubleclick on slider, the original value is written again into MLV header value.
In the GUI code the black level is initialized with "-1" as "unknown". But this should all not be the problem.

    if( receipt->rawBlack() != -1 )
    {
        ui->horizontalSliderRawBlack->setValue( receipt->rawBlack() );
    }

Could you send me such a file with blacklevel=0 for analysis?

@ilia3101
Copy link
Owner Author

coming in 1 second!

@ilia3101
Copy link
Owner Author

Apple update has completely broken my compiling, so I can only provide a older, possibly glitchy 16 ish bit file, but I think it shows the issue as it has 0 black level.

D700.mlv.zip

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 13, 2019

Okay reproduced. But it should be a problem on loading the MLV. Blacklevel=0 works! Just on loading the MLV it is set to something about 5000. Enter =1 and then =0, and it works. I have to debug... I would start searching in the GUI for that.

@ilia3101
Copy link
Owner Author

ilia3101 commented Oct 13, 2019

Well it works if you set to 1 and then 0, but it's still at 1 in reality. Try setting 2000 and after that 0, it clearly stays at 2000 so I assume it also stays at 1 when you do what you said. I think it is necesarry to fix 0 capabilty, as the difference between 1 and 0 may be noticable with 10 bit footage.

I remember being really confused by this bug a few months ago, don't think I had any success tracking it down.

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 13, 2019

Well it works if you set to 1 and then 0, but it's still at 1 in reality. Try setting 2000 and after that 0, it clearly stays at 2000 so I assume it also stays at 1 when you do what you said.

Sh**... you're right. That's bad. 😢

@ilia3101
Copy link
Owner Author

😢

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 13, 2019

Found and fixed it. e286c91
Please try.

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 14, 2019

I see another problem with your Nikon-MLV file... there are blue dots with all debayer algorithms - just AHD is fine:

AMaZE:
Bildschirmfoto 2019-10-14 um 11 23 15

AHD:
Bildschirmfoto 2019-10-14 um 11 23 26

@ilia3101
Copy link
Owner Author

ilia3101 commented Oct 14, 2019

Yep, blue dots. Must be a MLV App specific issue, as I think rawtherapee does subtraction before debayer and has no issues with these algorithms. Strangest issue I have ever seen though.

To fix this (until a real fix is found), I think we should just raise the blacks if it is below a certain value (and then correct after debayering).

@ilia3101
Copy link
Owner Author

Wow you fixed it!!!

@ilia3101
Copy link
Owner Author

Can confirm it work! this is amazing.

Unrelated, but did you notice how much cleaner the Nikon file is than all the Canon images we normally see in MLV App? Literally zero noise ...

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 14, 2019

Noise looks not bad, yes, but I've never seen a Canon fullres picture in MLVApp. I thought most of the noise comes from lineskipping...

You can raise the blacks to 15500, then you just see the blue dots. 😄
You mean to sum with a positive offset before debayer and to subtract it afterwards? I'll try out.

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 14, 2019

To fix this (until a real fix is found), I think we should just raise the blacks if it is below a certain value (and then correct after debayering).

Crazy... this really works!
Edit: did the temp fix for now.

@ilia3101
Copy link
Owner Author

Noise looks not bad, yes, but I've never seen a Canon fullres picture in MLVApp. I thought most of the noise comes from lineskipping...

Maybe. I still get a lot of noise in 1:1 crop video though. I looked at a Canon 600D picture through MLV App, it was a lot noisier than the nikon pic. I have to try with one of my 5D mark 2 pictures, I have a feeling video mode might be adding a lot of noise.

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 14, 2019

Would be interesting to compare a .cr2 with a fullres MLV, or at least with a crop - at same settings. It is possible you are right with your feeling.

@ilia3101
Copy link
Owner Author

Did you manage to compile the raw2mlv tool included in LibMLV?

just run the ./compile bash script in raw2mlv folder then you can try it. (interesting to find out if it works for you also on OSX 10.9)

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 15, 2019

I tried, but it failed because of LibRAW. I bet I need it as well? Which version do I need and where do I install it? Do I have to compile it as well?

@ilia3101
Copy link
Owner Author

Try running the script now, it should work now (downloads libraw for you). It doesn't install anything, just links statically.

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 15, 2019

The LibRAW download did not work in the script. I had to download and copy the file manually, and then I got it compiled. Works on 10.9.5. I converted a 5D2 cr2 picture, and it opens fine in MLVApp.

@ilia3101
Copy link
Owner Author

Ah so it does not work on older macOS

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 16, 2019

I don't know which of the commands... manually it works. So I think there should be a way doing it by script as well.

@bouncyball-git
Copy link
Collaborator

bouncyball-git commented Oct 16, 2019

Where I can find LibMLV? Shit I've been missed so long...

@masc4ii: BTW Danne presented me the eos-m! So now I'm in the mirrorless club too. Just waiting for my batteries and EF to EF-M adapted to roll on... :)

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 16, 2019

https://github.com/ilia3101/LibMLV

Haha... great! It is a nice little camera! The anamorphic modes are great! Batteries are important!

@bouncyball-git
Copy link
Collaborator

Whoa! For a moment I thought Nikon was hacked to the MLV recording point! And wanted to search teh web ;)

@ilia3101: Great idea to convert any libraw supported still raw image to MLV to edit it in mlvap!!! Great project!

@ilia3101
Copy link
Owner Author

Where I can find LibMLV? Shit I've been missed so long...

Very nice to have you back!

LibMLV is not much yet, so far I only uploaded the MLV writing part and a small converter program. The reading part is not done yet. Trying to avoid all the mistakes I made in MLV App (taking time).

Some discussion on this thread: https://www.magiclantern.fm/forum/index.php?topic=24386.0

I hope to release all my code under MIT license (or anything permissive like that). So everything needs to be original.

@bouncyball-git
Copy link
Collaborator

COOL! You even woke up g3gg0!!! hahaha

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 27, 2019

New bug since we changed this (RAW black level): when now changing RAW White Level (no matter what value) entire picture becomes pink or white. We have to find out why... 😞

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 27, 2019

I hope I found and fixed it. We need more testing with black AND white levels, with clips at ANY bitdepth. 29d6984

@DeafEyeJedi
Copy link

DeafEyeJedi commented Oct 27, 2019 via email

@masc4ii
Copy link
Collaborator

masc4ii commented Oct 27, 2019

I had the problem with 5D2 and EOSM files, 14bit and 10bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants