crop_rec on steroids: 3K, 4K, 1080p48, full-resolution LiveView

Started by a1ex, April 01, 2017, 11:15:41 AM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

Walter Schulz

Was occupied with other things.
Loaded your ISO-research build for 1.0.5 and no problem loading crop_rec.mo + adtg_gui.mo. Sooo ... what to do?

Danne

Two new builds, one for eosm and the other for eos 100D:
https://bitbucket.org/Dannephoto/magic-lantern/downloads/magiclantern-Nightly.2018Jul25.100D101_2K-3K-4K_10bit_patch_g3gg0.zip

https://bitbucket.org/Dannephoto/magic-lantern/downloads/magiclantern-Nightly.2018Jul25.EOSM202_2K-3K-4K_10bit_patch_g3gg0.zip

100D crop_rec menu:
    "2.5K 2520x1304", only 14bit lossless
    "3K 3096x1320", only 14bit lossless
    "4K 4056x2552", only 14bit lossless
    "3x3 720p", (problematic, probably not working....)
    "2K 2520x1080p", 10/12/14bit lossless (Regular x5 mode records in 2520x1078)
    "2.5K 10bit 2520x1304", 14bit lossless but will record at 10bit bitrate Thanks to A1ex, Bilal and Levas

eosm crop_rec menu:
    "2.5K 2520x1304", only 14bit lossless
    "3K 3072x1304", only 14bit lossless
    "4K 4038x2558", only 14bit lossless
    "3x3 720p",
    "3x3_mv1080_EOSM", only 14bit lossless this version will only do 1736x696(don´t know how to do crop_rec exceptions in raw.c code)
    "2.5K 10bit 2520x1304", 14bit lossless but will record at 10bit bitrate Thanks to A1ex, Bilal and Levas

Modified a bit in g3gg0 crop_rec_4k_mlv_snd branch:
https://bitbucket.org/Dannephoto/magic-lantern/branch/crop_rec_4k_mlv_snd_lossless_croprec_iso_reg

Crop_rec code from here:
https://bitbucket.org/Dannephoto/magic-lantern/commits/c1588d0719e6bf383964d66fca95c3980f843291?at=crop_rec_4k_mlv_lite_snd_sd_uhs_HDR_croprec#chg-modules/crop_rec/crop_rec.c

Did not have time to test this too much, hopefully working. Please report back how it works or not.

theBilalFakhouri

@a1ex

Can you disable crop_rec in x10 magnification by default to use this mode for focusing in higher wider resolutions? and re-enable it automatically in x5 ?
It would be nice trick for making focusing easier.

a1ex

That's how it's supposed to work, but detecting video mode switches is a bit tricky. The PathDrive stuff works well in this case (x1 -> x5 -> x10), but has some regressions (there are other video mode switches where the current code works better). Still looking into it.

dfort

Quote from: Walter Schulz on July 25, 2018, 08:57:44 AM
Was occupied with other things.
Loaded your ISO-research build for 1.0.5 and no problem loading crop_rec.mo + adtg_gui.mo. Sooo ... what to do?

I was also occupied with many other things. Your mission, should you choose to accept it, is:

Quote from: a1ex on July 08, 2018, 11:40:48 PM
Still looking for addresses of ADTG 805F and 8061 for 650D and 100D. Currently, crop_rec doesn't load on these models.

So using the adtg_gui module see if you can find the values for those ADTG registers. This is what it looks like on the EOSM:



@nikfreak found them on the 100D. Note that you might have to switch settings around before they show up.

Sganzerla

I had some problems with the latest Experimental build from 22 July with my 5D MKIII that I'd like to share...




Take a look at the pink stain on the right side.
Never experienced this before in 4 years of ML RAW use and more than 40 videos recorded, looked like a random thing occurence, could not reproduce at will.
(I can't verify right now but thinking about it, looks like it only happens with slow motion footage)

Another thing I had was camera freeze after reaching 10x zoom. It blacks out and you have to turn off and on again the camera. This problem is a little annoying when using a gimbal.
I don't know how or where to send the 3 crash reports I have for you developers, please let me know.

Mikv

Hello guys!
I can confirm the Sganzerla feedback about the blackouts of the 22 july build for 5D MK III.
In my case I use firmware version 1.2.3.

Have experienced the black outs using:

- 3072x1308 2.35:1 24 fps

- 1080 x 818 2.35:1 50 fps


My workaround is to push the MENU button, wait for see the original Canon menus and then immediately push MENU button again and back to Magic Lantern GUI.

No need for shut down or eject the battery.

Luckily is fast enough but please check the "black outs", You don't see a full black screen but a black screen with some color vertical lines that tend to vanish if you wait few seconds becaming all black.

Is like to see the matrix of the sensor..


Anyway the shootings in those resolution are still super freaking awsome!!!!!!!!!

jimiz

I confirm also, same problem, 5d3 - 123 last exp 22. :(
5D3-123


rebilith

I had the same blackouts as Mikv on 1.2.3 with 22 July build for 5D3 on the 3k crop mode.

And I managed to kind of replicate Sganzerla's problem, it happens or it worsens when you go out of the zoom.
Steps to replicate pink pixels/stripes: 22 July build, 5d3, use crop mode 3k or 45/48fps, select 1920x1080 resolution, keep camera cap on, so you get a black screen. Zoom x5, x10, zoom again, you are gonna get pink stripes and other glitches, even on preview.

Steps to replicate blackout/sudden shutdown: 22 July build, 5d3, use crop mode 3k, select 3072x1308 24 fps 2.35:1, zoom 5x, 10x, when you zoom again to reset, shuts down camera.
Crash log on card:
ASSERT: hLvJob->hJpegMemSuite
at ./Epp/Vram/VramStage.c:891, Epp:ff1859cc
lv:1 mode:3

Epp stack: 17dbd0 [17dca8-17d0a8]
0xUNKNOWN  @ de48:17dca0
0xUNKNOWN  @ 17bbc:17dc78
0x000178B4 @ ff0de67c:17dc58
0xUNKNOWN  @ 178e4:17dc48
0xUNKNOWN  @ 1796c:17dc28
0x00001900 @ ff1859c8:17dc08
0x00069878 @ 69c1c:17dbd0

Magic Lantern version : crop_rec_4k.2018Jul22.5D3123
Mercurial changeset   : c1e44b8e0183 (crop_rec_4k_mlv_snd) tip
Built on 2018-07-22 13:10:52 UTC by jenkins@nightly.
Free Memory  : 219K + 3089K

theBilalFakhouri

@a1ex

I like Movie crop mode feature in 700D to extend the focal length. Can you enable x10 mode to be used for better focusing when pressing magnification button ?

optik

Quote from: jimiz on July 31, 2018, 07:16:48 PM
I confirm also, same problem, 5d3 - 123 last exp 22. :(


Same Here ::) 5D3 Looking for some love...
Canon 5D Mark III, Canon 24-105mm F4, Canon 50mm F1.4, Nikkor 35mm f/1.4 AI-s, Tokina AT-X 16-28mm F2.8 Pro FX, 2 Lexar 1000x 64GB, Kumputer Bay 1000x 64GB, FCPX, Nuke, Modo, AE,
DaVinci

zalbnrum

Hello, I tried latest developments regarding 3.5K. Latest 22July, 4July and 20June. Had most success with the latest - 22nd July. Using 5dmkIII 113.

This topic is hard to understand or read all the pages. On one hand development is of course the most valuable, but it is a pitty that there is so few feedbacks from testers. Infos on first page and on experimental DL page also did not give me answers. So please answer these questions that I have:

- Which option is used when and what are the differences between them? (options in question are: 1920 1:1 tall/3K 1:1/UHD 1:1/3.5K 1:1 centered x5)

- How can you go above 3584x___?

- If I want to shoot biggest resolution to get smallest crop of sensor as close to continous what settings I should use?

- Why are there limited options of shutter speeds when using crop_rec especially when using lossless compression and how can I get normal options?

- Why I can shoot normally in 3.5K 1:1 in 14 bit lossless, if I choose 12 or 11...8 bit lossless I get underexposed and magentish colored frames? (4 bit lossless works even with 24 FPS override - all perfect frames!)

- Why I get red circle in "memory patches - code: FF28CC3C EA397952 crop_rec"?

Normal versions of HD RAW recording dont work, have corrupted frames. I get that, its bleeding edge.

I recorded successfully in 3520x1320 1,63 crop factor, which is almost continous. If get a bit lower I am on safe side. Crop sensor has much more rolling shutter, so you must have either tripod, video head with slow pan, sliders, IS lenses, gimbals and so on. It is impossible to shoot handheld with manual lens even if using wide lens. But the images are stunning and it is a pleasure to grade them.

I normally use "magiclantern-crop3x.2017Mar21.5D3113" and in that version everything works perfectly stable. Option that I like there is "card spanning", I can get continous 3200x1200 10 bit uncompressed and I can use raw2cdng which is just the best simple converter, then I use resolve and so on (other topic).

Maybe it wouldnt be stupid to actually open specific topic regarding testing crop_rec and maybe even have specific topics for all the models? There is for normal recording, but that is way behind what experimetal builds offer today.

Big THANK YOU to all the developers.

a1ex

Quote from: rebilith on August 10, 2018, 07:24:08 PM
Steps to replicate pink pixels/stripes: 22 July build, 5d3, use crop mode 3k or 45/48fps, select 1920x1080 resolution, keep camera cap on, so you get a black screen. Zoom x5, x10, zoom again, you are gonna get pink stripes and other glitches, even on preview.

Confirmed.

Quote from: rebilith on August 10, 2018, 07:24:08 PM
Steps to replicate blackout/sudden shutdown: 22 July build, 5d3, use crop mode 3k, select 3072x1308 24 fps 2.35:1, zoom 5x, 10x, when you zoom again to reset, shuts down camera.

Could not reproduce.

Quote from: RÁTNEEK on August 13, 2018, 09:55:18 PM
- Why are there limited options of shutter speeds when using crop_rec especially when using lossless compression and how can I get normal options?

Probably a bug; what limits did you find and how to reproduce?

There was a bug affecting shutter speeds in the centered x5, but it was solved on June 30. Tested again the latest build, just in case, and the fix appears to be working.

Quote
- Why I can shoot normally in 3.5K 1:1 in 14 bit lossless, if I choose 12 or 11...8 bit lossless I get underexposed and magentish colored frames? (it works even with 24 FPS override - perfect frames!)

Sounds like a postprocessing issue - incorrect white level used by your raw converter. If in doubt, you may upload a sample DNG or a very short MLV.

QuoteNormal versions of HD RAW recording dont work, have corrupted frames. I get that, its bleeding edge.

Steps to reproduce?

Just to make sure I understand well: you are able to record 3K without corrupted frames, but you have issues with regular 1080p?!

The other questions are probably best answered by those who actually record video (I don't).

sys73r

hey guys, in the first post there is tutorial showing how to record continuously at 3072x1308  2:35:1 12 Bit, however in the last builds there is no longer that resolution. It now shows ...2240,2560,2880,3200,3520, what's the one to be used for 3K continuously with sound?

On a side note, when I try to enable the mlv_play.mo and already have the crop_rec, mlv_rec and mlv_sound ML crashes at the start. (crop_rec_4k.2018Feb24) "error: undefined symbol 'lossless_decompress_raw" E. failed to link modules.

thank you.




Levas

Quote from: sys73r on August 15, 2018, 01:28:28 AM
hey guys, in the first post there is tutorial showing how to record continuously at 3072x1308  2:35:1 12 Bit, however in the last builds there is no longer that resolution. It now shows ...2240,2560,2880,3200,3520, what's the one to be used for 3K continuously with sound?

You can adapt the preset resolutions in small increments with the scroll wheel (not sure which one on 5dIII, but the one where you can adjust aperture or shutter time with, in manual mode)
Go into Raw video menu and highlight on the resolution and use scroll wheel to adjust.
Took me 3 years or so to find out this option exists in Magic Lantern Raw video menu  :P

zalbnrum

Alex, thank you for your answers.

I had problems with shutter speeds due to FPS override. FPS override works OK when not using crop mode, regardless of bit rate/lossless.

Colors and exposure were off at lover lossless bitrates because MLVProducer and mlv_play wont show them correctly. Mlv_play sometimes showed totally corrupted frames, but mlv_dump gave clean dng frames. So, it is really cruicial to use latest mlv_dump from experiments DL, at least for now.

For normal HD I retested and now everything seems OK.

There still is a few "bugs". When applying FPS override and turning it off, frame rate goes either to 30.125 or 19.sth, it can be solved by going to Canon menu and back. The other is when going to slowmotion crop mode, and applying FPS camera freezes. It is solved by taking battery out and restarting camera.

I will test more and post my findings.

zalbnrum

Quote from: sys73r on August 15, 2018, 01:28:28 AM
hey guys, in the first post there is tutorial showing how to record continuously at 3072x1308  2:35:1 12 Bit, however in the last builds there is no longer that resolution. It now shows ...2240,2560,2880,3200,3520, what's the one to be used for 3K continuously with sound?

On a side note, when I try to enable the mlv_play.mo and already have the crop_rec, mlv_rec and mlv_sound ML crashes at the start. (crop_rec_4k.2018Feb24) "error: undefined symbol 'lossless_decompress_raw" E. failed to link modules.

I use "magiclantern-crop_rec_4k.2018Jul22.5D3113", so it could be different with your version.

You have to load mlv_lite with crop_rec, otherwise modules wont load. I never use sound due to external sound recording, but use FPS override all the time, cause exact 24fps is more managable especially for DCP. So for mlv_snd I dont know.

With recent crop_rec you can not use FPS override.

For "3K 3072x1308  2:35:1 12 Bit continous" I set it this way:

Under "Movie"
- enable crop mode, select 3K
- in raw tab select 2.35:1 and in resolution select 3072 and it goes automatically to 3072x1308, then is also select 14bit lossless, it wont go to 12bit lossless, to get continous (which also depends of ISO and actual scene you are filming).

Another bug: If I set those settings and restart the camera, I have black frame only. I have to set crop mode to OFF and select 3K again, then it works.




a1ex

Some notes for 700D. Will edit as I'll discover more stuff.

1080p25:
Timer A=640, B=2000
Timer A must keep the same parity (odd value written to register)
Timer A min = 0x207 raw => 520 (same as 100D)
520*4 - 1808 = 272

1080p25 crop:
Mostly the same as above.
Timer A min = 0x217 raw => 536 (100D: 540)
536*4 - 1872 = 272

1080p50:
Timer A=640, B=1000
Timer A min = 0x207 raw => 520 (same as 100D). No change with line skipping factor, unlike 5D3.
520*4 - 1808 = 272

x5:
Timer A = 716, B = 1492
Timer A min = 0x2cb raw => 716 (tight fit in Canon firmware?! very unusual; 100D has 732 default and 724 min)
716*4 - 2592 = 272.

Photo mode:
timer A = timer A min = 0x56b => 1388.
1388*4 - 5280 = 272.

Cross-check with other parameters from raw_res.txt.

The above numbers give the timer A requirements for some desired horizontal resolution. That is:
timer A * 4 - horizontal resolution (including black bars) must be at least 272 in all of the above video modes.

The 5D3 does not show this kind of consistency, figure out why.

call("lv_120fps_test") -> does nothing.

GetPathDriveInfo mode map (codenames):
0 = LVx1
1 = LVx1_60fps
2 = LVx5
3 = LVx10
4 = LV_AF_Crop_120fps
5 = LV_FlashExposure
6 = Rec_HD
7 = Rec_720p
8 = Rec_Vga
9 = Rec_DZ_Crop_HD
10 = RecStandby_x1
11 = RecStandby_x1_60fps
12 = RecStandby_x1 (again?!)
13 = LVx1_60fps
14 = LVx1_CreativeFilter
15 = LvServoGaia
16 = LvServoDiana

Funky effects:
call("lv_cfilter_mode", i); // i from 0 to 7
0 = none, 1 = bw, 2 = lighter, 3 = oldstyle, 4 = darker, 5 = fisheye, 6 = saturated/noisy/low-fps, 7 = washed out.




CMOS[7] is vertical position (start and stop scanning line, 6 bits each), equivalent of CMOS[1] on 5D3.

CMOS[5] is horizontal position (mask FC0, max=0xB00) and column binning factor (0x20).
Canon values: 0x380 in 3x crop (active area xres: 1800), 0/0x300/0x600 in x5 zoom, 0x20 in 1080p.
Value used with CROP_PRESET_CENTER_Z_700: 0x300 (active area xres 2520).

This appears to be one-size-fits-all for CMOS[5] and CMOS[7] on 700D. Likely portable with minimal changes.

    if (is_700D)
    {
        /* horizontal and vetical centering, in rough increments */
        int xres = get_preset_xres(crop_preset);
        int yres = get_preset_yres(crop_preset);

        /* the sensor is divided into slices, 120x120 pixels each */
        const int slice_size = 120;

        /* 700D:
         * xpos=0 => capture from the left side
         * xpos=44 => black image, no valid data
         * sensor xres = 5208; last slice is incomplete
         */
        const int x_slices = (sensor_xres + slice_size - 1) / slice_size;
        const int y_slices = (sensor_yres + slice_size - 1) / slice_size;
        const int extended_xres = x_slices * slice_size;
        const int extended_yres = y_slices * slice_size;

        /* most presets read out every column;
         * a few of them will bin every 3 columns */
        int col_binning = 1;
        switch (crop_preset)
        {
            case CROP_PRESET_3x3_1X:
            case CROP_PRESET_3x3_1X_48p:
            case CROP_PRESET_1x3:
                col_binning = 3;
                break;
        }

        /* 700D:
         * CMOS[5]: horizontal position mask 0xFC0, column binning 0x020
         * 1736: about 14.5 would be ideal, formula gives 14.46 before rounding
         * 1800: 14 looks about right, formula gives 14.2 before rounding
         * 2520: 12 is Canon default, formula gives 11 (11.2 before rounding)
         */
        int xpos = ((sensor_xres/col_binning - xres) * x_slices + extended_xres/col_binning)
                 / (2 * extended_xres/col_binning);
        int col_binning_flag = (col_binning == 1) ? 0 : 0x20;
        cmos_new[5] = PACK12(col_binning_flag, xpos);

        /* vertical position in rough increments */
        /* CMOS[7]: start/stop scanline, 5 bits each, 120px increments, highest 2 bits unknown */

        /* most presets read out every row;
         * a few of them will "bin" every 3 rows (actually read one line and skip 2) */
        int row_binning = 1;
        switch (crop_preset)
        {
            case CROP_PRESET_3x3_1X:
            case CROP_PRESET_3x3_1X_48p:
            case CROP_PRESET_3x1:
                row_binning = 3;
                break;
        }

        int ystart = ((sensor_yres/row_binning - yres) * y_slices)
                 / (2 * extended_yres/row_binning);
        int ystop  = ((sensor_yres/row_binning + yres) * y_slices)
                 / (2 * extended_yres/row_binning);
        cmos_new[7] = PACK552(ystart, ystop-1, 0);

        dbg_printf("sensor res: %dx%d\n", sensor_xres, sensor_yres);
        dbg_printf("capture res: %dx%d\n", xres, yres);
        dbg_printf("slices: %dx%d bin %dx%d\n", x_slices, y_slices, col_binning, row_binning);
        dbg_printf("x:%d y:%d-%d\n", xpos, ystart, ystop);
        dbg_printf("cmos [5]:%x [7]:%x\n", cmos_new[5], cmos_new[7]);
    }

Sganzerla

I wrote a few pages ago about this theme but could not find any way to solve this question for my needs.

If you put aspect ratio at 1:1,3:2 or 4:3 in mlv_rec, it gives real time preview with croped borders when using at 24fps mode. Everything is perfect.
If you do the same with mlv_lite than it gives the low fps and lower quality preview that we see as if using crop_rec with slow motion. Even when recording at 24fps.

Isn't there really any way to make mlv_lite work as mlv_rec with realtime good image quality preview for different aspect ratios other than 16:9?

a1ex

After fiddling a bit with a 700D, I've got a better understanding of how resolution overrides should work, and I'm getting closer to reworking the crop_rec code to allow arbitrary resolutions (rather than preset-based). Most of the ADTG register overrides are already generic (used on all models), CMOS registers for H/V centering were almost figured out (see previous post) and FPS timer requirements can be figured out by trial and error (already done for 700D).

Now I'd welcome some suggestions for how the menu should look like. Here's one starting point:

- Column binning factor: 1 or 3
- Row binning/skipping factor: 1 or 3 (hardware allows other values, but don't see why anyone would use them)
- X resolution: from Canon default (1932, 1736, 3520 etc) to full width (5796, 5208 etc)
- Y resolution: from Canon default (1290, 1160, 672 etc) to full height (3870, 3478 etc)
- Frame rate: value from Canon menu / half of that value / max allowed by current resolution / custom?
- Shutter speed: same as in current builds
- custom settings for each video mode selectable from Canon menu?

Levas

@Sganzerla

You should look into the options in raw video menu.
There is something called 'Preview' and it has 4 options if I'm right (not the camera with me now)
By default this 'Preview' option is set to some 'auto' setting, which selects indeed the 'ML preview' on 5x zoom mode.
Now change this value to 'real-time', and you get real-time preview, even when using 5x zoom.


Levas

@Alex
Sounds like crop_rec is going to become mature  :D

How do you want to implement the selectable resolution, since resolution is also set in MLV_lite raw video menu ?
Not sure if this is possible, but would be nice if these options can be put within the already available raw video menu (MLV_Lite).






Sganzerla

@Levas

Thank you very much, it solved the situation! I was really unaware of this option.
Using 'framing' option or 'realtime' it gives me the same frame in 24p Full HD setting, 'auto' option could very well relate to 'real-time' instead of 'framing' in this situation.

a1ex

Alright, please find the first proof of concept for crop_rec with arbitrary resolutions. 700D only; won't work on any other model yet.

It's too much of a hack to commit it in this state, but I have to return the 700D today, so... that's my current snapshot. Please give it a try and write down what works right now, as things will very likely break after I'll integrate the other models, and I won't be able to notice.

crop_rec.c

Beware: might be very buggy. After changing settings, press MENU twice to refresh. Have fun.