3K/UHD 5D2 Raw development and Other Digic IV Cams

Started by reddeercity, April 06, 2017, 12:22:27 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Bender@arsch

@Reddeercity
I've testet your new Dual iso.mo and postproduction only works in MLV App.

- Can't export cDNG after force to dual iso in MLV App -> large Artefact in cDNG (in MLV App preview is correct)
- Export as cDNG without force to dual iso in MLV App -> lightromm plug/ CR2hdr  says "Doesn't look like interlaced ISO" / no Dual iso
- Open with  MLVFS -> "Doesn't look like interlaced ISO"

Maybe false Metadata?
-----------
Any new news to 4096x1770 half framerate?

reddeercity

Ok I'll check in to it , did you check MLVFS ? I use quick mount on Win7Pro looks ok also did you check MLVProducer ?

reddeercity

checking in dual iso metadata with ExifTool I get a warning from mlv producer with cdng's
Bad IFD1 directory
I can't see any dualiso metadata right now , either a problem with raw.c or dng.c  not writing correct metadata for dual iso , need to investigate further .
Thanks for the report .

Edit:MLVFS Web GUI (win7), set to dual iso 20bit etc. ....
from cmd when I refreshed web gui with dual iso setting 
Doesn't look like interlaced ISO
ISO pattern     : dBBd RGGB
White levels    : 10000 5000
Noise levels    : 8.00 8.00 8.00 8.00 (14-bit)


So yea there a problem , I'll need to debug this -- in the mean time your will have too force "dual iso" in mlv app. & mlv producer .

reddeercity

found some more problems , mlvfs web gui gave me the dual iso pattern and did not recognize the patterns
Doesn't look like interlaced ISO
ISO pattern     : ddBB RGGB
ISO pattern     : BBdd RGGB
ISO pattern     : dBBd RGGB
ISO pattern     : BddB RGGB
ISO pattern     : BBdd RGGB

these patterns alternate on each of the frames , need to look in the dual iso code and see what pattern are being used


york824

So I shoot some footage using the 3K build and overall I am very impressed by the image quality and resolution. Only issue seems to be the aliasing and the very short recording time. I get 10~11 seconds with a Sandisk 120MB/s CF and 14 seconds with a Toshiba 150MB/s CF card.
I am very new to shooting videos but it feels really fun.
Thank you for your amazing work.

https://www.youtube.com/watch?v=hSqJzyp5DY8

reddeercity


Quote from: york824 on September 02, 2019, 03:52:38 AM
... Only issue seems to be the aliasing and the very short recording time. I get 10~11 seconds with a Sandisk 120MB/s CF and 14 seconds with a Toshiba 150MB/s CF card.
First , there no aliasing in 3x crop mode (5xZoom) it's 1:1 pixel , that why there a crop factor .
The aliasing in your video comes from your workflow (special the 8bit  Jpegs)
(From your Youtube post )
QuoteWorkflow: MLV App -- CinemaDNG -- Lightroom for Coloring -- JPEGs -- Davinci Resolve 16 -- Final output
Plus I see it's also upscaled to 4k  :( , personal I think up scaling to 4k is a bad think , I never seen a good one yet .
It always introduces artifacts & aliasing issues

You go from RAW Cdng's (10bit ,Linear color space) to Jpeg (8bit , 4.2.2 , 16-235 color space) then grade it (coloring) in Light Room .
Why grade the 8bit Jpegs ? you are loosing all that data .
Best to grade the cdng's , you have Resolve so you can grade (color) the cdng right there , and if you don't like resolve
to grade your image you can use MLV App to color the raw cdng's .

The data rate for 2784x1160 23.976 fps is around 90MB/s & 5D2 CF Card bus speed is limited to around 75-80MB/s ( but this not a hard limit , working on overclock the bus speed)
So if you get around 15 second a footage that's about right , I have Lexar 1066x 64GB and what I get on average.
If you what longer record times use 4k Anamorphic preset or lower horizontal resolution in centered 3.5k crop to 2.5k etc. ...

york824

Quote from: reddeercity on September 02, 2019, 05:48:21 AM
First , there no aliasing in 3x crop mode (5xZoom) it's 1:1 pixel , that why there a crop factor .
The aliasing in your video comes from your workflow (special the 8bit  Jpegs)
(From your Youtube post ) Plus I see it's also upscaled to 4k  :( , personal I think up scaling to 4k is a bad think , I never seen a good one yet .
It always introduces artifacts & aliasing issues

You go from RAW Cdng's (10bit ,Linear color space) to Jpeg (8bit , 4.2.2 , 16-235 color space) then grade it (coloring) in Light Room .
Why grade the 8bit Jpegs ? you are loosing all that data .
Best to grade the cdng's , you have Resolve so you can grade (color) the cdng right there , and if you don't like resolve
to grade your image you can use MLV App to color the raw cdng's .

The data rate for 2784x1160 23.976 fps is around 90MB/s & 5D2 CF Card bus speed is limited to around 75-80MB/s ( but this not a hard limit , working on overclock the bus speed)
So if you get around 15 second a footage that's about right , I have Lexar 1066x 64GB and what I get on average.
If you what longer record times use 4k Anamorphic preset or lower horizontal resolution in centered 3.5k crop to 2.5k etc. ...

Thank you so much for your advises. I use Lightroom because I am new to Davinci Resolve and don't know how to get the color grading done. The MLV App seems to render the images badly at least they don't look half as good when exported as DNG and opened in Lightroom so I don't really know how to grade in MLV App. Guess I have to learn how to grade Davinci Resolve now :D.

Luther

Quote from: york824 on September 02, 2019, 08:48:30 AM
don't look half as good when exported as DNG and opened in Lightroom

DNG is a raw format. None of the changes you make in it will take effect on Lightroom.

thebailey

Hey, just wondering if there is any way to get an interlaced mode enabled for 5Dii 1:1 pixel 3 x crop mode (10bit raw), without dual ISO? It would give us 1920 x 1080 @ 50fps for half the data rate?

DeafEyeJedi

Quote from: york824 on September 02, 2019, 08:48:30 AM
...The MLV App seems to render the images badly at least they don't look half as good when exported as DNG and opened in Lightroom so I don't really know how to grade in MLV App.

If you don't mind me asking... what were your export settings set to? Would be happy to get yourself squared up on MLV App to get the most out of your 5D2 while ur at it.

Please reply within MLV App to keep this thread on topic per @reddeercity. Thanks!
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109

reddeercity

Ok back to Dual ISO patterns , I when back to the old March 2017 dual iso video module
and loaded it on  "magiclantern-10bit_12bit_raw_twk_crop_rec.2016Dec01.5D2212" and it works ok.
I did find the ISO pattern  ISO pattern     : BBdd RGGB

The updated crop_rec dual video iso module has 4 different ISO patterns for crop_rec

Doesn't look like interlaced ISO
ISO pattern     : ddBB RGGB
ISO pattern     : BBdd RGGB
ISO pattern     : dBBd RGGB
ISO pattern     : BddB RGGB

I just need one ,
ISO pattern     : BBdd RGGB
not sure how this happen , basically I used waza57 dual video iso code and replace the non dual video iso module in the  5d2 4k crop_rec branch with the Video enabled dual iso .

But I find that MLV App still doesn't recognize it as dual iso ,
but MLVFS Web Gui does ! see below , it export as 20bit from 13.8 to 16.82EV
AMaZE interpolation ...
Edge-directed interpolation...
Smoothing alias map...
Final blending...
Noise level     : 8.00 (20-bit), ideally 8.00
Dynamic range   : 16.82 EV (cooked)
Semi-overexposed: 0.38%
Deep shadows    : 61.15%
Full-res reconstruction...
ISO overlap     : 4.7 EV (approx)
Half-res blending...
Building alias map...
Filtering alias map...
Amaze took 0.65 s
Edge-directed interpolation...
Smoothing alias map...
Final blending...
Noise level     : 8.00 (20-bit), ideally 8.00
Dynamic range   : 16.82 EV (cooked)
Semi-overexposed: 0.47%
Deep shadows    : 61.19%
Full-res reconstruction...
ISO overlap     : 4.7 EV (approx)
Half-res blending...
Building alias map...
Filtering alias map...
Smoothing alias map...
Final blending...
Noise level     : 8.00 (20-bit), ideally 8.00
Dynamic range   : 16.82 EV (cooked)
ISO pattern     : BBdd RGGB
White levels    : 16219 14819
Noise levels    : 8.00 8.00 8.00 8.00 (14-bit)
ISO difference  : 3.13 EV (875)
Black delta     : -4.94
Dynamic range   : 10.82 (+) 10.67 => 13.80 EV


So For now you can used the old 5D2212_Video_dual_iso.zip with magiclantern-10bit_12bit_raw_twk_crop_rec.2016Dec01.5D2212.zip together and you sure be able to use lightroom plug/ CR2hdr .
That build has only 10-12bit in crop_mode not 3x3(FHD) FYI


dariSSight

Thanks like always RedderCity, but just for full operation option which build allow 3x3 FHD Dual ISO?
Canon 5D Mark II

Igor_Braun

@Reddeercity. Sorry, could you please tell with simple words? As I understood, you did your work, and uploaded the source code for others?

reddeercity

Hey all , I'm back from my summer projects  :)
I have some free time now for the next 8weeks , I hope to get more work done on both 5D2 & 50D crop_rec .
I'll need a few days to refresh & catch up on things .

A little more investigation in to dual ISO patterns from above posts



from left to right , frame 0 , 1 , 2 & 3 , first 2 frames are different then the next 2 ( frame 2 & 3)  are the same
So by blending all 3 different iso patterns , would that give a better image without artifacts ?
I remember a post by @Ilia3101  about having different iso lines on the same image for a better image interpolation .
how about different iso pattern on each frame ? I guess we would need to add different patterns to mlv_dump (not sure if I can do that , may be beyond my abilities)
and then blend them , not sure if that would be better or not .
Here the 4 dng's I used to compare Different_ISO_Patterns.rar

reddeercity

from this post https://www.magiclantern.fm/forum/index.php?topic=21447.msg220835#msg220835
here the link to the 3xcrop_mode check I having issue with
crop_rec.c#lines-1588
any suggestions ? , I'll post tomorrow the code pieces I've tried that didn't work .
I started to update the source code to a new bitbucket repository. magic-lantern_reddeercity_5d2-50d_4k-crop_rec
but I havn't updated the crop_rec module code yet with the new presets , in the next days .

aprofiti

Didn't understood well where is the problem and what you are trying to achieve, but the highlighted line of code is never taken with the 5d2, because the condition for true statement as it is written now is: "go inside the true branch if is not a 5d2 and current register is 0xC0F06804".
Or are you working in local with a different code at that line?

Maybe try to manipulate the register 0xC0F06804 inside the false branch like waza57 did (or remove !is_5d2), if you want to follow his route.
If I mislead something just ignore, didn't digged inside crop_rec code yet :)

reddeercity

@aprofiti thanks for input , sorry here the code I'm working from locally
if (!is_5D2 &&(reg == 0xC0F06084))         
        {
            engio_vidmode_ok = (crop_preset == CROP_PRESET_3K)
                ? (old == 0x46A04BA)                        /* x5 zoom */
                : (old == 0x4F40432);                       /* 1080p */
        }                 
        else
        {
          if (reg == 0xC0F06014)      // waza57 for 5D2 without this reg check,  0xC0F06084 is not seen 
            {                 
               if (crop_preset == CROP_PRESET_3K)
                {
                  if ((old == 0x4ff) || (old == 0x4d5 ))
                    {
                      engio_vidmode_ok = 1;
                    }               
                  else
                    {
                      engio_vidmode_ok = 0;
                    }
                 }   
               if (crop_preset != CROP_PRESET_3K)
                {
                   if (old == 0x577)
                    {
                      engio_vidmode_ok = 1;
                   }
                 else
                    {
                      engio_vidmode_ok = 0;
                    }
                } 
            }                     
        } 
    }
    if (!is_supported_mode() || !engio_vidmode_ok)
    {
        /* don't patch other video modes */
        return;
    }

    for (uint32_t * buf = (uint32_t *) regs[0]; *buf != 0xFFFFFFFF; buf += 2)
    {
        uint32_t reg = *buf;
        uint32_t old = *(buf+1);
       
        int new = reg_override_func(reg, old);
        if (new || reg == 0xC0F06084)            // waza57 fixme! reg_override_func(0xC0F06084 return 0 so new don't exist)
        {
//            dbg_printf("[%x] %x: %x -> %x\n", regs[0], reg, old, new);
            *(buf+1) = new;
        }
    }
}

This works right now , problem is adding in a second or third 3xcrop_mode (5xZoom) preset .
If I have 2 presets e.g.
engio_vidmode_ok = (crop_preset == CROP_PRESET_3K || CROP_PRESET_CENTER_Z)
.........
if (crop_preset == CROP_PRESET_3K || CROP_PRESET_CENTER_Z)
........
if (crop_preset != CROP_PRESET_3K || CROP_PRESET_CENTER_Z)

This causes both preset to default back to 3x3(FHD)
I did have a little better success with
engio_vidmode_ok = ((crop_preset == CROP_PRESET_3K) (CROP_PRESET_CENTER_Z))
the first preset applied correctly (in 5xZoom) the next one loaded in 3x3(FHD) but before it loaded , it flash
for a split second in 5xZoom then fell back to the default 3x3 (FHD)
I can change the name to any 5xZoom preset & it loads correctly , just can't have more then one preset name that a time .
I'm not a real coder , so this may be fix easy for a real programmer  :D
I work best from examples .

alexboum

Hello,

"if" CROP_PRESET_CENTER_Z = 1 the two last "if" will always be executed.

Quote

engio_vidmode_ok = (crop_preset == CROP_PRESET_3K || CROP_PRESET_CENTER_Z)
.........
if (crop_preset == CROP_PRESET_3K || CROP_PRESET_CENTER_Z)
........
if (crop_preset != CROP_PRESET_3K || CROP_PRESET_CENTER_Z)



Is it what you are looking for? If not you can maybe try:
Quote
engio_vidmode_ok = (crop_preset == CROP_PRESET_3K || CROP_PRESET_CENTER_Z)
.........
if (crop_preset == CROP_PRESET_3K || CROP_PRESET_CENTER_Z)
........
else if (crop_preset != CROP_PRESET_3K || CROP_PRESET_CENTER_Z)
........

With this synthax only one "if" can be executed. (If the first "if" is true the "else if" is ignored).

Hope it can help you.
Anyway thanks for your amazing work.

reddeercity

@alexboum thanks for the help , I'll give it a try
Yes that helps me under the synthax  better  :)

reddeercity

Hey 50D users I've started to port 50D to crop_rec , first step was to code a simple preset in ADTG_GUI.mo where a1ex first tested the 5d3 code.
Reasons why I put the 50D crop_rec in adtg_gui is to make sure it work or course & a simple coding task for me ! Since I very weak on that I
being teaching myself (with the help of the internet  :D ) c code syntax , I'm slowing making good process , much to learn but it's worth it in the end  ;D

adtg-gui_crop_rec-3.7k-50D-eXperimental.2019Oct01.50D109.zip

How to get started:
Load mlv_rec.mo & adtg_gui.mo
Enable adtg_gui go to the advance menu and enable ENGIO Registers



Press half shutter to exit to liveview then press the play button (make sure to have a cr2 there to view ,this refreshes liveview & enables the other 1500 reg's)
go back to the advance tab in the adtg_gui.mo and now enable the 3k 1:1 50D preset



Press half shutter to exit to liveview , then you may have to cycle thought the 5xzoom button ( but you should only have to press it once)
Make sure you set the shutter to as close to 1/48th of second as you can , I was able to set it to 1/49th and when the preset is enabled it will
go to 1/48th of a second  for 23.9876 fps @ 3744x1080



Don't worry about the line on the right had side , there will not be in the raw image (this is the same thing that happen with the 5D2 , still working on a fix )
To make sure everything gets loaded , you can check the memory patches in the debug menu you should have 7 like this



On a Lexar 1066x 64GB CF card was getting around 10 second in 10bit .

This is very Bleeding Edge Stuff , so expect lockups , cam liveview freezes , etc. .... if it brakes you get to keep both halves  :P

thebailey

Standard interlacing would take 2 lines (to make sure you have RGBG included within that line) per stripe, and then break a 25 frame/s (40ms) timeline into a 50 field/s timeline, packing an 'upper' and 'lower' fields (20ms) taken sequentially but packed into one 40ms frame as far as the codec is concerned.

If you want max HDR and framerate in low data rate (ignoring compression), then you would have a different gain or exposure time on each stripe. Since I don't think the 5D2 can do different exposure times for individual stripes, then you have a few options:

1) In frame 1, you have the up field low gain, the down field high gain, then in frame 2 you have the up field high gain and down field low gain. This minimises the time that errors can accumulate that are hard to correct for (motion).

2) It may be possible to actually interlace using single (incomplete colour) lines, RG lines and GB lines, as long as you invert which one has the gain per field each frame

3) If you have the option to sample the pixels individually, you could effectively interlace in stripes of 2 lines (complete colour data) in horizontal and vertical directions, with each RGBG subset alternating high-gain, low-gain, then low gain, high gain, for 4 fields / 2 frames. This would minimise the chance for errors while maximising dynamic range and frame rate for the lowest data rate.

AF-OFF

@reddeercity
can confirm it works on my 50D.
could record several clips with 2560x1080 10bit uncompressed and 23.9 fps
Because of a slow card only 12seconds each, one pink glitch in one clip
GD should be set to allow in raw video (mlv) menu and preview to auto

cheers

aprofiti

It's normal if the pink clip is on the 2nd or 3rd frame (link to old post for reference) it's from the 10-12bit experimental method for D4 cameras

@reddeercity is this with your current repo codebase?
Do you think the problem you where having with 5d2 will pretty much likely happen also with 50D?

Was thinking to have a look to understand crop_rec_4k code using 50D for testing, but I'm a bit busy these days...

Would like just try to use as much of the main codebases as possible compared to current waza changes, but due to not being familiar with those changes I would like to know if are they all necessary?

Luther

Hey @reddeercity , thanks for coming back to work on 50D. I will test later your build and report any issues.

reddeercity

Quote from: aprofiti on October 02, 2019, 07:48:34 PM
It's normal if the pink clip is on the 2nd or 3rd frame (link to old post for reference) it's from the 10-12bit experimental method for D4 cameras
I don't have that here ,
I only use mlv_rec (need audio) not mlv_lite (no audio support for d4 cams) ,
there too many issue with D4 cams with mlv_lite  -- mainy the liveview preview side of the code (more resources are needed etc. .... )

Quote from: aprofiti on October 02, 2019, 07:48:34 PM
@reddeercity is this with your current repo codebase?
Do you think the problem you where having with 5d2 will pretty much likely happen also with 50D?
Yes more then likely ,  but it's a syntax code issue I'm having after reading some info online (I think I may have resolved it )

Quote from: aprofiti on October 02, 2019, 07:48:34 PM
Would like just try to use as much of the main codebases as possible compared to current waza changes,
but due to not being familiar with those changes I would like to know if are they all necessary?
I think yes , from waza comments there more then just the crop_rec code that was changed .
I'm still updating my source slowly , really the only changes I made was adding raw_slurp for 5d2 & 50d
and add the preset reg's to the crop_rec menu . Thou it did some time to understand the crop_rec code , just because
there was no preset example's to follow for D4 cams (other then the one that waza made but it was incomplete ) , I had to figure it out for myself   
I basically fellow the code structure for the 5D3 and just add the D4(5D2) code needed , so yea I'm very close to the main code base .

Next thing for me is to add the 50D in to the crop_rec module code ,
In fact that's what I'm doing tonight  :)