Danne's crop_rec_4k experiments for EOS M

Started by Danne, December 03, 2018, 06:10:17 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Danne

Quote from: midnite on December 31, 2022, 06:28:59 PM
Hello everybody,

I am back after a very long break (my last post was in 2014 lol) with the cameras. I just wanted be a camera man once again and found my EOS-M in the junkyard side of my room.

I am really amazed that so many great stuff happened to the EOS-M/Magic Lantern since I left. Holy damn this cheap thing used to be considered junk now records 2.5k raw and rivals 5D MII/MIII, Black Magic etc...

I immediately wanted to try everything ML offers nowadays but then I realized that my 32gb Sandisk Extreme Pro from 2014 isn't that great anymore as It was impossible to overclock it above 160MHz (I got 66mb/s or 64mb/s in photo mode 160MHz If I remember right but 20mb/s on higher settings.) so I bought this card (samsung 256gb micro sd w:130mb/s) recently and I just benchmarked it on my EOS M in photo/playmode (240MHz) and It gave me 94mb/s. (77mb/s in192MHz)



How amazing is this now?



//

I am kind of confused with the 1080 raw mode though because no matter which card I use, I get crap pink stuff in my LCD view. Is this normal? Because this makes it impossible to focus.



Live View works fine with the 2.5k 1:1 centered (frtp too) preset btw. Is this normal?

Even If I can't make 1080p work, I am still going to be happy with the 2.5k raw I guess as it seems to me it is the most useful mode of this camera. (It is Zeek's favorite mode too)

Edit: 1080p 30/46/38 fps preset works with LV without a problem too. (and appears to have less crop than the 2.5k mode, maybe this preset is going to fit me better)
Is your fps set to 24, 25 or 30 fps in canon menu?

midnite

Quote from: Danne on December 31, 2022, 09:41:32 PM
Is your fps set to 24, 25 or 30 fps in canon menu?

In canon menu? As far as I see there are only 4 choices there, 1920/25, 1920/24, 1280/50 and 640/25. I don't see 30fps there.

I read somewhere that I should be using 720p mode when I shoot raw with ML, so I left it at 1280/50.

Am I doing it wrong?

Edit: I see that Video Setting is set to "PAL". Maybe this is the reason?
Edit2: I set it to NTSC and now I can see 1280/60fps setting and 1920/30fps setting. Which one should I choose? 1280/60?
Edit3: I went ahead and tried 1280/60, didn't work. Tried 1920/30 and now LV works with the base 1080p raw mode. Thanks for the help! I wouldn't have done it without your help. I mean I couldn't even remember what the hell PAL & NTSC was...
Edit4: Big question now is, should I be using 1920/30 in canon menu? Where did I read that I should be using 720p... Maybe that was the setting for the vanilla ML, not for this crop_rec build.

Danne


midnite

Alright I found where I got the 720p thing.

Quote from: CFP on July 27, 2013, 11:45:56 PM
If your buffer fills up you'll get pink frames. To avoid it, set the resoltuion in the Canon menu to 640p @ 30 fps (Lower YUV buffer = more space for other stuff) and use 'FPS Override' to lower the framerate. Also, make sure you have a fast SD-Card that reaches the 600D's 21 Megabyte/s write speed limit and set the 'Pic Quality' to 'SRAW' (And reboot your camera!) to increase the shoot_malloc buffer size. That should help to get rid of any pink frames. If they still appear you can try to use an older build.

By following these steps I haven't got any pink frames since weeks.

I probably read this post or something similar to this but the idea was the same probably. To empty the buffer of the camera.

But this post is from 2013, so I guess this new crop_rec build don't require 720p/640p  in Canon menu anymore.

However,

I just realized I do get pink frames every once in a while in my footage. Yesterday they weren't there, I must have broken something.

After 8 years, again I find myself in the ML rabbit hole. 8)

Edit: I had a good footage without any problems (no pinks, no frame skips) with 640/30-canon settings and 1080p 30/46/38 @ 38fps ML setting. However, I disabled the fps override setting when I was recording this. Maybe It was ruining my earlier footage.

Danne

Don't use fps override. Easiest way is to select a preset and change as little as possible. Maybe experment with bitdepth option 10/12/ or OFF for 14bit.

chrissul13

which preset is best if you just want HD or slightly larger? 

Danne

How do you mean? You tested the presets right?

Alp Korsan

Quote from: chrissul13 on January 04, 2023, 05:33:53 AM
which preset is best if you just want HD or slightly larger?

If you want HD, just use HD mode?

I use 38fps HD mode personally.

Danne

New upload

Added below code for faster zoom aid for all presets not using movie crop mode. That is it works with 5k anamorphic frtp and x3 crop modes.
Also testing some stabilty fixes around 5k frtp mode. Sometimes the preset gets stuck. Maybe works more stable now.

Quote from: theBilalFakhouri on December 20, 2022, 04:16:49 PM
These lines in crop_rec.c (under crop_rec_keypress_cbr):

if ((key == MODULE_KEY_PRESS_HALFSHUTTER) && lv_dispsize == 5 && is_movie_mode()
&& !gui_menu_shown() && lv && patch_active == 1 && !RECORDING && crop_preset != CROP_PRESET_1440p_700D && crop_preset != CROP_PRESET_3K_700D_FIXED)
{
unpatch_memory(ENGIO_WRITE);
unpatch_memory(CMOS_WRITE);
unpatch_memory(ADTG_WRITE);
update_patch();
set_zoom(10);
return 0;
}

if ((key == MODULE_KEY_UNPRESS_HALFSHUTTER) && crop_preset != CROP_PRESET_OFF && lv_dispsize == 10 && is_movie_mode()
&& !gui_menu_shown() && lv && !RECORDING && crop_preset != CROP_PRESET_1440p_700D && crop_preset != CROP_PRESET_3K_700D_FIXED)
{
patch_hook_function(CMOS_WRITE, MEM_CMOS_WRITE, &cmos_hook, "crop_rec: CMOS[1,2,6] parameters hook");
patch_hook_function(ADTG_WRITE, MEM_ADTG_WRITE, &adtg_hook, "crop_rec: ADTG[8000,8806] parameters hook");
patch_hook_function(ENGIO_WRITE, MEM_ENGIO_WRITE, engio_write_hook, "crop_rec: video timers hook");
update_patch();
set_zoom(5);
return 0;
}


These works for all 1x3 presets and 1920x1280p 1:1 preset.

EDIT: New upload again. Fixed a bug with higher frame rates and using zoomaid.

Carniphage

So.. Having used ML on my 7D a bit. I bought the EOS-M. Looked for the feature to overlock the SD card and ended up with this build.
It works great (I shot something promising this morning.)

There's just one mysterious thing...

My Modules tab only lists one item:the Bench module. (Even though the SD card Modules directory contains everything you'd expect)
Some modules must have loaded, because they are working!

Any suggestions? (or should I ask somewhere else?)


Mattia

Hi Danne! Thanks for your builds, I think they're really great! I have two questions I would like to ask you to better understand how ML works:

- In one of his videos Zeek says that 5k resolutions are actually recorded at a lower resolution than HD and then upscaled internally. Are there any other video modes that work this way? If so, what's their real resolution?

- I've found a formula on reddit to calculate the precise crop factor for any video mode. The formula is: 5184 / (selected horizontal resolution) * 1.6. Is this formula correct?

Let me know and thanks for the work you do!

Ernani

Thanks! Glad to know you guys still find time to fiddle with the eosM!

Walter Schulz

Quote from: Carniphage on January 04, 2023, 03:32:58 PM
My Modules tab only lists one item:the Bench module.

Works as designed. Danne's builds only have this module in Module tab/screen.

Walter Schulz

Quote from: Mattia on January 04, 2023, 06:48:21 PM
- In one of his videos Zeek says that 5k resolutions are actually recorded at a lower resolution than HD and then upscaled internally. Are there any other video modes that work this way? If so, what's their real resolution?

https://wiki.magiclantern.fm/glossary#anamorphic

Quote from: Mattia on January 04, 2023, 06:48:21 PM
- I've found a formula on reddit to calculate the precise crop factor for any video mode. The formula is: 5184 / (selected horizontal resolution) * 1.6. Is this formula correct?

No idea what you are talking about. Link, please!

Ernani

I spent some hours testing today's build doing a side by side comparison (2 eosMs).
As I understand, this new development supposedly "works in all 1x3 presets and 1920x1280p 1:1 preset".

Sadly, however,  this new build provides little to no advantages over October's build regarding the 10x zoom feature on the M, unlike the 700D where it seems to work fine. It enters the 10x zoom mode almost instantly (just like the older build), but upon release of half shutter, it still takes a couple of seconds to return to live view, albeit slightly differently than before (screen goes black earlier than older build).

I'm uploading a short video with the comparison tonight.


Ernani

Checking the test videos, I do notice this new build gives a 0.4 sec advantage on 3:1 modes over the old build. It's not as great as the 700D, but it is a welcome advantage nevertheless.

Danne

Quote from: Ernani on January 04, 2023, 10:40:55 PM
I spent some hours testing today's build doing a side by side comparison (2 eosMs).
As I understand, this new development supposedly "works in all 1x3 presets and 1920x1280p 1:1 preset".

Sadly, however,  this new build provides little to no advantages over October's build regarding the 10x zoom feature on the M, unlike the 700D where it seems to work fine. It enters the 10x zoom mode almost instantly (just like the older build), but upon release of half shutter, it still takes a couple of seconds to return to live view, albeit slightly differently than before (screen goes black earlier than older build).

I'm uploading a short video with the comparison tonight.

The advantage is when entering x10 zoom in in x5, x3 crop modes. Includes the 5k anamorphic frtp mode. Also high frame rate modes a bit faster. Code more stable than before.
As you say, upon exit x10 zoom means a bit of waiting. This is because of early code which is doing some hackish stuff. Will take some time to rewrite it correctly and not sure if I will have the time for it.
HD1080p is working as before. I need to exit from movie crop mode so can't do it faster as bilals code will not work effectively in this mode. Maybe it could but will need time and testing.
Thanks for testing.

Ernani

Thanks for everything, Danne. You're legend!

Danne

You´re welcome. True legend goes to a1ex ;). And for this find it´s theBilalFakhouri.
Seems magic lantern has frozen in time with digic V models atm, although I can see several developers poking around with later models.
I still love picking up the eosm for so many reasons :).

Danne

New upload

- Fixed zoom aid latency issue going back from being in x10 zoom. Mean no black frame etc. Works for most presets, not HD1080p.

Turned out I had put in some refresh code in mlv_lite.c way back when I started rearranging in code.
I will keep cleaning out code but meanwhile this should work real nice. Thanks Bilal for the find.

Ernani

WOW! This is awesome! Working like a charm! I rely heavily on the 10x zoom to pull focus so this new trick is super welcome.
Zoom feature is improved on all modes, especially on 1:1 where it is almost instantaneous.

The only quirk I found is that sometimes half shutter fails to enter zoom in 1080p or 5k. This peculiarity didn't happen in older builds.
Attached a video to demonstrate.

Again, thanks for this!


Danne

New upload

Thanks for testing Ernani. Fixed. Accidentally took out too much code for the HD1080p preset before. Added back. Seems to work again.

EDIT:
Uploaded another build right now which adds 40fps with higher framerates when in 16:9 mode.

gabriielangel

Tested here and it is perfectly snappy at 2.5K, 2.8k, 5K frtp,
and a little less at 3K (Goes through the black screen phase, But still way faster than before)

This is a great fix, as it also allows to use one-shot autofocus when the camera is on the gimbal very comfortably (Set focus aid to default mode instead of sticky push) !!!

I found 3 issues

These Behaviours were present in Jan 05 build as well:

1-
Set ratio to 2.39:1
Load 2.5K preset
Press Star
Press Star Again

It will show 29.97 fps

Reload the preset to make it go back to 23.976
Does not happen in the other modes (i.e. 2.8k, 5k frtp)

2-
Load 5k Preset
Press half-shutter in-out 2-3 times in a row
Display becomes corrupted

3-
Was present in Jan 05 build, It is less pronounced now, but still there:
Load 2.8k Preset
Press half-shutter in-out 2-3 times in a row
Vertical lines appear on the image, and remains on screen for a few seconds
On one occasion the display became corrupted, but I could not reproduce on demand.

Danne

New upload

- Fixed the bug with 2.5k preset. I simply skipped all patching stuff which seems even better. Maybe fixed the othe bugs as well? Needs testing. Could you check again @gabriielangel?

Ernani

All bugs seem fixed! I couldn't replicate any of the quirks described by Gabriel. Awesome work!
I'm most impressed with the high framerate modes. I don't know what sorcery you did, but besides now working at full 3x3 (1736x976) at 40 fps (!), everything feels way more responsive. 2.35to1 at 48fps works super smoothly, no pink frames, no freezes... just a joy to work with slow motion now!

Very excited right now 8)