Is MLV using the full width of the sensor?

Started by Milk and Coffee, May 09, 2020, 08:09:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Milk and Coffee

On the 5DMKIII, ssing the experimental 10/12-bit RAW video: "magiclantern-raw_video_10bit_12bit.2019Mar24.5D3123" build.

I can get 1920x1280 (3:2) 12bit continuous RAW/.MLV with sound

That said, on my 5DmkIII, it's getting the full width of the sensor (I believe? Yes?).

Is it pixel binning/skipping to get the full width? Or is it super sampling the whole sensor?

Also, with the "mlv_snd" module, do I still get sound if I'm doing a FPS override at an even 24.00fps? (FPS override says that it disables sound.)

Thanks all!
Canon 5D Mark II, Mac/OSX

yourboylloyd

It's getting the full horizontal width (and height). I think it divides the sensor by three with the 3x3 binning.

5760 total horizontal pixels/3 =1920
3840 total vertical pixels/3 = 1280

And why not just use canon's 24p? You wouldn't ever have to worry about that. Use the RAW calculator to learn what you can record continuously. I would stick to 10bit honestly.

Raw calculator = https://rawcalculator.netlify.app/calculator_desktop
Join the ML discord! https://discord.gg/H7h6rfq

Milk and Coffee

Thanks for the response! I like to shoot a flat 24fps because I want to follow proper film standards and because I also create my own music and can cut perfectly to 72bpm, 96bpm, 120bpm.

In some examples, I've seen 10bit get quite noisy in the shadows and thus results in lost dynamic range. Have you had good results with 10bit?
Canon 5D Mark II, Mac/OSX

Kharak

Yes, full width and height 1920x1280 3x3 Pixel Binned.

With FPS override you get sound recording in RAW, if you have sound enabled in RAW options.

FPS override disables sound of h264 recording.

And if you use canon "24p" its 23.976 and crop mode will be recorded at 29.976.

And i easily have continues 14 bit 1920x1280. If you have problem with getting continues at 14 bit, you might need a faster card.
once you go raw you never go back

Milk and Coffee

Quote from: Kharak on May 10, 2020, 12:10:34 PM

And if you use canon "24p" its 23.976 and crop mode will be recorded at 29.976.

I'm a little confused. If you use Canon "24p" you get NTSC 30fps?

When you say "crop mode," is that the "crop_rec" experimental build?
Canon 5D Mark II, Mac/OSX

Walter Schulz

24p = 23.976 fps

"Crop mode" is what you get by pressing loupe/zoom/magnify button. It's included in nightly builds, too. This mode doesn't use sensor's full width

Milk and Coffee

Quote from: Kharak on May 10, 2020, 12:10:34 PM

And if you use canon "24p" its 23.976 and crop mode will be recorded at 29.976.

Is "29.976" mentioned above a typo? If your set to canon's 24p (23.976,) and when using crop mode, you get NTSC 30p instead?

Or it's a typo?
Canon 5D Mark II, Mac/OSX

Walter Schulz

No, that's what the man said.
In crop mode it doesn't really matter which video mode you selected. You are doing 29.976 fps anyway. You can tune it, though.


Kharak

Crop mode as in pressing the loupe/magnifier, not "crop_rec4k" modes, you need fps override to "tame the beast" when you crop. Because in canon firmware, when you press loupe x5/x10, the liveview fps rate goes to "30p" regardless of your canon fps settings.

But as a rule of thump when shooting raw just use fps override all the time, except when shooting in some of the crop_rec modes. Like 50/60p 3x3 crop_rec freezes camera when using fps override, but 1920 1:1, 1920x1920 1:1 and 3.5k center can handle fps override. The others i dont use, so dont know.
once you go raw you never go back

Milk and Coffee

In all modes, when using FPS override: Is FPS override a 'true' frames per second? If I set it to "24.00fps, Exact FPS" is the camera actually recording a proper 24.00 even frames in a second? Or is it interpolated/faked? IE: If I set FPS Override to "24.00," is the camera really recording a 29.976fps and dropping frames from 29.976fps resulting in 24.00fps?
Canon 5D Mark II, Mac/OSX

Walter Schulz

You can come very close. And remember that 24p is 23.976 fps.

Milk and Coffee

Quote from: Walter Schulz on May 10, 2020, 08:51:44 PM
You can come very close. And remember that 24p is 23.976 fps.

When I refer to "24.00fps," im setting FPS override at exactly at "24.00fps." I DONT want 23.976. I want an even 24.

Also, generally, when using FPS override: Is FPS override a 'true' frames per second? If I set it to "24.00fps, Exact FPS" is the camera actually recording a proper 24.00 even frames in a second? Or is it interpolated/faked? IE: If I set FPS Override to "24.00," is the camera really recording a 29.976fps and dropping frames from 29.976fps resulting in 24.00fps?
Canon 5D Mark II, Mac/OSX

Walter Schulz

Frame dropping: Strange concept.
Could be easily done in post and what can be easily done in post isn't worth the effort to implement it. Devs are not marketing driven...

You will however see a slight change in fps drifting around your setting if you dare to test it for yourself.

Milk and Coffee

Thanks for the reply! I think you may have misunderstood me. What I meant was --- Does Magic Lantern record REAL/Exact FPS from "FPS Override?" Or is magic lantern achieving custom frame rates by dropping frames from canon's standard/default frame rates? Does that make sense? (It's just a general question about how magic lantern achieves FPS Override frame rates.)
Canon 5D Mark II, Mac/OSX

Walter Schulz

See answer above. First sentence.
Please take your cam and dive into it.

https://wiki.magiclantern.fm/camera_help#fps_override (needs some work/redo).

Milk and Coffee

Thanks! But I still think I'm not articulating my question well enough! Anyway, I tested, and I'm getting a good 24.00fps sync with audio!
Canon 5D Mark II, Mac/OSX

Milk and Coffee

Is the 5DmkIII the only camera capable of capturing 1.00x crop RAW because of the sensor pixel dimensions?

Can we get perfect 1.00x crop on the 6D? 5DmkII? Since their sensor pixel dimensions don't perfectly divide by 3 (for 3x3 pixel binning?)

According to this (https://rawcalculator.netlify.app/calculator_desktop) the 6D and 5DmkII sensors aren't perfectly divisible by 3 resulting in 1.06x and 1.09x crops.
Canon 5D Mark II, Mac/OSX

masc

You can have 1.0x crop with any ML camera (digital crop). Don't understand your calculation. Just the resolution differs slightly.
5D3.113 | EOSM.202

Walter Schulz

I think he has another misconception about ML and "stock" using different sensor areas in non-crop mode.
And I think there is some misunderstanding about the term "1.00x crop" ... He is talking about native video resolution and I suppose you are talking about 1:1 crop mode.

Milk and Coffee

Sorry, yes. I am referring to using the full sensor width. So 1.0x crop would be full frame/no crop.
Canon 5D Mark II, Mac/OSX

reddeercity

Each camera has it own native resolution according to the sensor size and may be up-scaled to 1080p or not in h264 (.mov) canon firmware.
Magic Lantern does not upscale to any set size (e.g. 1080p) but just records the native raw resolution .
In non crop mode , or what we call it here on the forum 3x3 or FHD (Full HD)
e.g. 5D2:  the sensor size is 5616x3744 by canon info , do the math and you get 5616/3=1872 , but this is not right .
Canon also crop's the full sensor a little bit , the real size of the sensor is 5632x3750 wide! magic lantern unlocks the extra pixels .
So with the real size 5632/3=1877 ML report this as 1880x1250

So yes MLV record the full width of the sensor in 3x3(FHD) but that doesn't mean it records 1080p in raw !
The only camera that records a true 1920x1080(1280) is the 5D3 because canon made the sensor divisible by 3 to make 1920x1080p (so no up-scaling true 1920 etc. )
‎the 5D3 sensor size is 5760 × 3840 , 5760/3=1920 .

I hope I didn't confuse you .

Levas

Edit, just saw this post of yours later, after I typed the response. So I guess it is caused by the ruleset in ML.
Edit2: I'm wondering though, where those lost 16 pixels are, ML rules calculates 1856 pixels for the 5d2, but those 16 pixels are not gone, they are either on the left side or the right side.
Maybe you can get those 16 pixels back by altering the black border offset for the 5d2, see post below. (those 16 pixels must be somewhere, either on the left or on the right, or both  :P)

https://www.magiclantern.fm/forum/index.php?topic=15487.msg227048#msg227048

@Reddeercity

Standard cr2 files and jpg's from the Canon 5d2 are 5616 pixels wide. (according to the internet, I don't have a 5d2 myself to verify  ???)
So the pixels and the image data are there to get 1872 pixels of wide resolution.
I could think of 2 things that prevent from getting 1872 resolution in ML.
Black borders are set too tight on the 5d2 in ML.
As you probably know, all camera's have some (covered) pixels on the borders off the sensor, probably to calculate noise or black level.
In the 'raw.c' file in ML, there are hardcoded offsets for each camera.
You could try lower the ' skip_left       = 160; ' to a value of 144 and see if you get real image data or just 16 more black pixels on the side.


        /**
         * The RAW file has unused areas, usually black; we need to skip them.
         *
         * To find the skip values, start with 0,
         * load the RAW in your favorite photo editor (e.g. ufraw+gimp),
         * then find the usable area, read the coords and plug the skip values here.
         *
         * Try to use even offsets only, otherwise the colors will be screwed up.
         */
        #ifdef CONFIG_5D2
        skip_top        = zoom ?   52 : 18;
        skip_left       = 160;
        #endif
       
        #ifdef CONFIG_5D3
        skip_top        = zoom ?   60 : mv720 ?  20 :   28;
        skip_left       = 146;
        skip_right      = 2;
        #endif

        #ifdef CONFIG_6D
        /* same skip offsets in 1080p and 720p; top/left bar is the same in x5 zoom as well */
        skip_top        = 28;
        skip_left       = 80;
        skip_right      = zoom ? 0  : 10;
        #endif


Another thing that could prevent the 1872 resolution from being available is that there are some rules build in ML that horizontal pixels must be dividable by 8 I think and there are some other rules that horizontal x vertical resolution must be dividable by 16 bytes.
Not sure why, could be that hardware needs it to be that, or that it is just faster because the hardware can move the data around more efficiently when it is dividable by 8 or 16.

If this parts prevent 1872 from being selectable, then I don't know how to fix it.

In mlv_lite.c it's this part about ruleset to get available resolution:

static REQUIRES(settings_sem)
void update_resolution_params()
{
    /* max res X */
    /* make sure we don't get dead pixels from rounding */
    int left_margin  = (raw_info.active_area.x1 + 7) & ~7;   /* ceil rounding to multiple of 8 pixels */
    int right_margin = (raw_info.active_area.x2 + 0) & ~7;   /* floor rounding */
    int max = (right_margin - left_margin);
   
    /* max image width is modulo 2 bytes and 8 pixels */
    /* (EDMAC requires W x H to be modulo 16 bytes) */
    /* (processing tools require W modulo 8 pixels for struct raw_pixblock) */
   
    max_res_x = max;
   
    /* max res Y */
    max_res_y = raw_info.jpeg.height & ~1;


Milk and Coffee

Quote from: reddeercity on May 12, 2020, 08:37:41 AM

Canon also crop's the full sensor a little bit , the real size of the sensor is 5632x3750 wide! magic lantern unlocks the extra pixels .
So with the real size 5632/3=1877 ML report this as 1880x1250


So ML "reports" as 1880, but it's actually 1877? Does that not cause an error with the file?

So it seems that the 5DMKIII and 6D, utilize the full width of their sensors because of the sensor's native resolution is divisible by 32? And the 5DMKII has to "crop" out 16 pixels because of the black pixels and it's imperfect division of 32?
Canon 5D Mark II, Mac/OSX

reddeercity

@Levas , I have a 5D2 and yes a cr2 is 5616 but the FRSP is 5632 , and there must be some padding in canon firmware .
Also I check the Image dump from my 5D2 & 3x3 raw image is indeed 1880 not 1872 or 1877 as I said ,
there's 3 pixel from somewhere , maybe some padding ?
In the zip file there is 3 files the 3x3 ml raw dump , DNG ,  the converted dng ->.ppm file from exiftool & the converted .ppm -> .png
5D2_True_3x3__Sensor_Size_5-12-2020.zip
File Name                       : RAW-001.DNG
Camera Model Name               : Canon EOS 5D Mark II
Software                        : Magic Lantern
Subfile Type                    : Full-resolution Image
Image Width                     : 2040
Image Height                    : 1268
Strip Offsets                   : 33792
Samples Per Pixel               : 1
Rows Per Strip                  : 1268
Strip Byte Counts               : 4526760
X Resolution                    : 180
Y Resolution                    : 180
Default Crop Origin             : 0 0
Default Crop Size               : 1880 1250
Active Area                     : 18 160 1268 2040
Image Size                      : 2040x1268

So if you pixel peep there no missing pixels that I can see .

In the Old Raw_Rec module (pre-2016) We had 1880 wide , before the speed penalty was found in D5 cam .

Found a CR2 and
Record Mode                     : CR2
Canon Image Type                : Canon EOS 5D Mark II
Canon Image Width               : 5616
Canon Image Height              : 3744
Raw Jpg Size                    : Large
Cropped Image Width             : 5616
Cropped Image Height            : 3744
Sensor Width                    : 5792
Sensor Height                   : 3804
Sensor Left Border              : 168
Sensor Top Border               : 56
Sensor Right Border             : 5783
Sensor Bottom Border            : 3799
Color Data Version              : 6 (50D/5DmkII)
Exif Image Width                : 5616
Exif Image Height               : 3744
Image Size                      : 5616x3744

Important info about Sensor
Cropped Image Width             : 5616
Cropped Image Height            : 3744
Sensor Width                         : 5792
Sensor Height                        : 3804
Sensor Left Border                 : 168
Sensor Top Border                 : 56
Sensor Right Border               : 5783
Sensor Bottom Border            : 3799

Magic Lantern uses less of a off set 160 compared to canon's 168 and the vertical canon does 58 where ML uses 18 offset
Also I did a OB Zone test here and it's 1880 so
mainly a coding issue . With Crop_Rec it's really a non issue now , with 1x3 , 3x1 etc. ....  :)

Milk and Coffee

So looks like the 5D2 technically records about a 1.1x crop (3x3) in mlv. Is 1.1x correct? Is it smaller than that? If you could physically measure 36mm x 24mm of the 5D2 sensor, the active pixels used for capturing MLV 3x3, would be slightly smaller? Is this a negligible crop? Even if we could add the extra pixels, would there be much of a difference?
Canon 5D Mark II, Mac/OSX