ilia3101 / MLV-App

All in one MLV processing app.
https://mlv.app/
GNU General Public License v3.0
283 stars 29 forks source link

Vertical stripes causes horizontal / grid like artifacts #112

Closed ilia3101 closed 5 years ago

ilia3101 commented 6 years ago

Happens when the stripes are severe, more info here: https://www.magiclantern.fm/forum/index.php?topic=22890.new#new

Made me think my sensor was messed up :laughing: (well it still is but not that much)

masc4ii commented 6 years ago

I have the same problem with my fathers 7D (mainboard exchanged by Canon). I am not sure if it is visible in CR2, but the MLVs look the same as @ilia3101 was showing in ML Forum... 😄 So there is hope, the clips become better!

ilia3101 commented 6 years ago

Wow can't believe Canon wouldn't even calibrate their own column gains!

@bouncyball main replies on that thread to see are #3 and #4

bouncyball-git commented 6 years ago

Yes I saw it thanks :smiley:

masc4ii commented 6 years ago

For me it looks like that: Stripes OFF bildschirmfoto 2018-10-08 um 20 28 19

Stripes ON bildschirmfoto 2018-10-08 um 20 28 23

What do you think? The same?

ilia3101 commented 6 years ago

Yep, that's the fine grid pattern I see, makes adding sharpening not nice.

bouncyball-git commented 6 years ago

Is old mlv_dump correction better in this regard?

ilia3101 commented 6 years ago

Ah sorry for being slow to reply. Yes, old mlv_dump gets rid of these stripes perfectly

masc4ii commented 6 years ago

Hm... I tried exporting once with MLVApp (VStripes On) and then I mounted same MLV with MLVFS with VStripes On. MLVFS dng looks identical to VStripes Off. So, I don't know if it works there. Do I need a special version of MLVFS (ML Forum told no)? Edit: tried again - now MLVFS brings exactly the same as MLVApp. So it is something else with my clip?!

ilia3101 commented 6 years ago

Try converting to dng with mlv_dump that you can download from mlv_dump forum thread first page. I know that had no stripes. Or show what's happening

masc4ii commented 6 years ago

Did that also with mlv_dump now - 3rd time same result. Looks like my 2nd picture above. If you like to try it out: https://www.dropbox.com/s/wbzgtacehlrl2z0/M13-1329_7Dpink.MLV?dl=0 (in MLVApp you need to sharpen to see it, in Lightroom it is more extreme)

ilia3101 commented 6 years ago

I tried it out converting to DNG with old mlv_dump(working) and with MLV App(not working right). Had to average frames to get it to export as uncompressed mlv form mlv app (for old mlv_dump to read it).

Here's exported with MLV App problematic stripe correction: broken You can see a fine grid pattern

Now exported to DNG with old mlv_dump and working stripe correction: broken_less No fine grid pattern.

(both images have a extreme rawtherapee edit to exaggerate the patterns)

Zoom in close, you will see the fine grid pattern. Same effect as on my videos.

There's a slight black level difference in the pics making one more purple, ignore that.

Also stupid of me to have used detail detail crushing JPEG, but it still shows.

masc4ii commented 6 years ago

No matter how I tried to export the dng - I always had the grid pattern as in your first picture. How exactly have you extracted 2nd one? What was the command (maybe mine was wrong)?

ilia3101 commented 6 years ago

Command was: mlv_dump mlv_file --dng

Literally just dragged mlv dump then file on to terminal and added --dng.

Maybe the Mac version of mlv dump in the download is different? Were you using the one I mentioned from mlv_dump thread first page? (The download with versions for different operating systems)

bouncyball-git commented 6 years ago

Actually I can not see any difference at all :) stripes are all over the white wall under the window. They are even worse on the second picture.

masc4ii commented 6 years ago

Thanks. This is exaclty the same I did. Could you please paste the link? The mlv_dump's I find, are not able to convert lossless or are from 2018 (and with these I get the same as using MLVApp).

bouncyball-git commented 6 years ago

Ehh guys I compared raw2dng and mlvfs versions and they are quite different. I have to adapt raw2dng version to mlvapp... it will take time because I have to dig into it deeply, what I hate very much ;)

ilia3101 commented 6 years ago

Ah sorry it was mlv thread not mlv dump thread https://www.magiclantern.fm/forum/index.php?topic=7122.0, downloaded file http://www.magiclantern.fm/modules/modules/mlv_dump.zip/mlv_dump.zip

@bouncyball there is some more stripes on the second one but are you not noticing the very fine pixel grid?

It even makes a moire pattern when I view on my phone: screenshot_20181010-100016

masc4ii commented 6 years ago

This one works for you? I just get noise... I guess it can't handle lossless. This moiree I get also in MLVApp when zooming around.

bouncyball-git commented 6 years ago

@ilia3101 yes I see it clearly. Very fine net like pattern. Is it produced after stripe correction or was it present in the original picture?

bouncyball-git commented 6 years ago

Reproduced and compared!!! Older version does a great job! Definitely MLVFS variant is bad and it has to be changed

ilia3101 commented 6 years ago

Glad you finally reproduced, I don't think the grid patterns were there on original clip. Sorry I've not been too helpful with this I've just had so much life stuff to do 😭

ilia3101 commented 6 years ago

This one works for you? I just get noise... I guess it can't handle lossless.

I first used MLV App to export an averaged frame of the whole video without compression, that was the way I got a uncompressed file :rofl:

masc4ii commented 6 years ago

Thanks Ilia! Now I got it. And yes, that looks way better.

masc4ii commented 6 years ago

https://github.com/ilia3101/MLV-App/commit/7435867d11d7f6b234ac8deaf15588668f114b75 makes it so much better...

bouncyball-git commented 6 years ago

Hey guys there is still difference between old mlv_dump and mlv app stripe processing, this noticeable mostly in dark areas. Light areal are processed great.

I've got the idea why this is happening! This is because @ilia3101's sample is 12bit uncompressed!

The main difference between mlv_dump and mlvapp/mlvfs is the fact that all raw processing (corrections) in mlv_dump is done after converting raw data to 14bit and mlvapp/mlvfs does it on original bit depth data (bitunpacked to 16bit thought).

In short all raw processing algos: stripes, bad pixels, CS, etc... been written and tuned for 14bit raw data. I did a lot of hoop jumping during mlv_dump on steroids development to make it work as good as possible for 10/12 bit uncompressed raw (not lossless one, it is completely another story).

So my proposition is: all 10/12 uncompressed raw data should be converted to 14bit (as it is in old good mlv_dump) before all processing is done. This will introduce some extra steps when saving DNGs, e.g. downconvert to other bit depths (now it automatically exports DNGs with the depth input MLV has).

What do you think? There are still many MLVs recorded in 10/12bit uncompressed, especially for cameras without lossless support.

masc4ii commented 6 years ago

Have you tried with commenting out this one pragma line? If it compiles as you checked it in (I had to adapt it a bit) I also get different stripes (correction "works half" only). When commented out it looks awesome for me.

bouncyball-git commented 6 years ago

Strange, I compile it with pragma under linux and it works. But if it causes issue of course let's get rid of it.

bouncyball-git commented 6 years ago

I was right. Changes commited to test. With raw data converted to 14bits the image looks awesome even in dark areas (to the left from the hanging leaf)!

ilia3101 commented 6 years ago

Shadows are cleaner now, no signs of grid at all anymore!

masc4ii commented 6 years ago

That looks so good... unbeliveable what this does to my 7D testclips!

bouncyball-git commented 6 years ago

I'm glad you both liked it!!! :)

mlv_dump original (good rendering) mlv_dump MLV App 12bit mlvapp_12bit MLV App 14bit fix mlvapp_14bit_fix

bouncyball-git commented 6 years ago

Sorry. The difference is more visible after sharpening :)

bouncyball-git commented 6 years ago

This commit finalizes 14bit only processing.

PROS: All uncompressed 10/12bit raw data will be processed with the raw tools written and tuned for 14bit data processing.

CONS: Exported DNGs will be always 14bit except if "Cinema DNG Fast Pass" is selected in the export settings.

Please test and share your findings.

Edit: side effect: raw black and white level ranges for appropriate sliders will always be 14bit range. It's not bad because allows fine tuning levels more precisely.

Edit2: info panel shows original MLV bitdepth and b/w levels.

masc4ii commented 6 years ago

First found: if I now enable dual iso (it's a non dual iso clip) the image is not black (good), but the stripes are there again (bad). I got a new clip from the stripe-producing-7D... in the darks there are still some noticable stripes... :( (Look at the churchs roof) m05-1401stripes_frame_1 https://www.dropbox.com/s/atm91nsuv814ujg/M05-1401stripes.MLV?dl=0

bouncyball-git commented 6 years ago

Gonna take a look tomorrow.

bouncyball-git commented 6 years ago

If we do not have more issues let's close it.

masc4ii commented 6 years ago

In the clip above, I get some few lines in the dark areas. But I think we are not able to get that clean 100%... or do we?! (See blue roof and ocean at the very right.) If not: you can close it.

bouncyball-git commented 6 years ago

Yes exactly we can not do anything about it unless Alex does something about this small issue :). We could ask him. The old mlv_dump does exactly the same.

bouncyball-git commented 6 years ago

I asked him here.

masc4ii commented 5 years ago

@bouncyball-git : a1ex write (see link) "My draft patch completely replaced the old algorithm; if you’d like to try it at this stage, I can share it." Have you tried it out? If it does not change the artifacts, let's close here... 😄

bouncyball-git commented 5 years ago

Yeah, but as I remember he never shared that patch (I guess he just forgot about it).