Author Topic: 3K/UHD 5D2 Raw development and Other Digic IV Cams  (Read 167685 times)

reddeercity

  • Contributor
  • Hero Member
  • *****
  • Posts: 2105
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #975 on: August 27, 2019, 07:29:07 AM »
Starting to update the source code on bitbucket , should I be doing this or should I be looking at GitHub for ML source code ?

Anyways I fork the source from waza57 and started a new repository magic-lantern_reddeercity_5d2-50d_4k-crop_rec
So far I've removed waza57 "rom hack" for height & width and I added the parts for "raw_slurp" (needed for extended res. & 10-12bit )
No updated crop_rec presets commits .
commit e7bfe64 disables rom hack
commit 1a2efe8 enable EDMAC_RAW_PATCH for raw buffer 5d2 Crop_Rec
commit 9704e3b in stubs.S , Added Liveview Raw patches 5d2 4k crop_rec
commit c6cb9b4 Raw backend: overriding raw stream (CONFIG_EDMAC_RAW_PATCH) 5d2 4kcrop_rec extented res & 10-12bit support added

After this , I'm not posting any more commit here ,  going forward everybody will have to check the magic-lantern_reddeercity_5d2-50d_4k-crop_rec/commits

Also I haven't added the parts for 50D raw_slurp yet in the next days ..... plus I'm close on the crop_rec module for 50D , just a few errors to fix so it can compile

york824

  • New to the forum
  • *
  • Posts: 13
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #976 on: August 30, 2019, 12:12:23 PM »
I installed the July 15th build and found one issue: the mlv_play module cannot be enabled. Once I enable it and reboot the camera, I got some errors and all modules were disabled. Had to disable the mlv_play to have other modules working. I tried uninstalling the Magic Lantern on the CF card, re-formatting it and installing it back, still not working. When the module disabled, all other modules seem working fine.

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 6906
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #977 on: August 30, 2019, 12:55:35 PM »
Non-working mlv_play is a known issue. Use search field on upper right corner for more info.
Photogs and videographers: Assist in proof reading upcoming in-camera help!. Your input is wanted and needed!

Bender@arsch

  • New to the forum
  • *
  • Posts: 18
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #978 on: September 01, 2019, 04:21:50 PM »
@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

  • Contributor
  • Hero Member
  • *****
  • Posts: 2105
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #979 on: September 01, 2019, 08:58:23 PM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 2105
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #980 on: September 02, 2019, 02:07:59 AM »
checking in dual iso metadata with ExifTool I get a warning from mlv producer with cdng's
Code: [Select]
Bad IFD1 directoryI 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 
Code: [Select]
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 2105
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #981 on: September 02, 2019, 02:59:18 AM »
found some more problems , mlvfs web gui gave me the dual iso pattern and did not recognize the patterns
Code: [Select]
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

  • New to the forum
  • *
  • Posts: 13
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #982 on: September 02, 2019, 03:52:38 AM »
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.


reddeercity

  • Contributor
  • Hero Member
  • *****
  • Posts: 2105
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #983 on: September 02, 2019, 05:48:21 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 )
Quote
Workflow: 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

  • New to the forum
  • *
  • Posts: 13
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #984 on: September 02, 2019, 08:48:30 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

  • Member
  • ***
  • Posts: 196
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #985 on: September 02, 2019, 10:53:40 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

  • New to the forum
  • *
  • Posts: 3
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #986 on: September 02, 2019, 12:24:23 PM »
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

  • Hero Member
  • *****
  • Posts: 3351
  • 5D3 | M1 | 7D | 70D | SL1 | M2 | 50D
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #987 on: September 02, 2019, 05:10:23 PM »
...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

  • Contributor
  • Hero Member
  • *****
  • Posts: 2105
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #988 on: September 03, 2019, 05:46:27 AM »
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 
Code: [Select]
ISO pattern     : BBdd RGGB
The updated crop_rec dual video iso module has 4 different ISO patterns for crop_rec
Code: [Select]
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 ,
Code: [Select]
ISO pattern     : BBdd RGGBnot 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
Code: [Select]
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

  • Member
  • ***
  • Posts: 160
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #989 on: September 03, 2019, 12:43:58 PM »
Thanks like always RedderCity, but just for full operation option which build allow 3x3 FHD Dual ISO?
Canon 5D Mark II

Igor_Braun

  • Freshman
  • **
  • Posts: 98
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #990 on: September 06, 2019, 02:51:01 AM »
@Reddeercity. Sorry, could you please tell with simple words? As I understood, you did your work, and uploaded the source code for others?

reddeercity

  • Contributor
  • Hero Member
  • *****
  • Posts: 2105
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #991 on: September 23, 2019, 05:11:55 AM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 2105
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #992 on: September 23, 2019, 07:01:18 AM »
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

  • Contributor
  • Member
  • *****
  • Posts: 185
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #993 on: September 24, 2019, 03:27:56 PM »
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 2105
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #994 on: September 25, 2019, 12:43:28 AM »
@aprofiti thanks for input , sorry here the code I'm working from locally
Code: [Select]
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.
Code: [Select]
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
Code: [Select]
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

  • New to the forum
  • *
  • Posts: 4
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #995 on: September 27, 2019, 04:54:04 PM »
Hello,

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

Quote
Code: [Select]
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

  • Contributor
  • Hero Member
  • *****
  • Posts: 2105
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #996 on: September 28, 2019, 04:11:10 AM »
@alexboum thanks for the help , I'll give it a try
Yes that helps me under the synthax  better  :)

reddeercity

  • Contributor
  • Hero Member
  • *****
  • Posts: 2105
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #997 on: October 02, 2019, 08:10:28 AM »
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

  • New to the forum
  • *
  • Posts: 3
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #998 on: October 02, 2019, 08:40:31 AM »
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

  • Member
  • ***
  • Posts: 109
  • 50Dc EOSM
Re: 3K/UHD 5D2 Raw development and Other Digic IV Cams
« Reply #999 on: October 02, 2019, 07:38:36 PM »
@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