mv1080 on EOSM

Started by dfort, February 06, 2016, 04:56:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Teamsleepkid

I got ya. honestly I was just talking some trash to keep the thread alive. I'm more of a camera guy than a coder. On the main eos m thread looks like the new guy can code..wildstray. Is mv1080 even worth it? Is the resolution gained that much? I've never tried it cause I only have the M..Thanks Dfort you're awesome and you always have tons of useful knowledge and help.
EOS M

dfort

Quote from: Teamsleepkid on October 25, 2016, 08:38:46 AM
...I was just talking some trash to keep the thread alive...

Thanks. You brought up a good point though. Is mv1080 really worth the effort? Since the 700D has basically the same sensor I thought I'd run some comparisons between mv1080, mv720 and mv1080crop just for good measure.

mv1080


mv720


mv1080crop

Ok, not too dramatic yet. A few notes, I used a 17-55mm lens zoomed all the way in to 55mm on the mv1080 and mv720 shots and all the way out to the other extreme at 17mm for the mv1080crop shot. The EOSM can do mv1080crop just fine but it means shooting on a small part of the sensor and losing that "film look" from the APS-C sensor's depth of field. Shooting in crop mode with the same focal length as non cropped mode results in a 3x crop.

mv1080crop showing 3x crop factor

To really see the difference between mv1080 and mv720 let's look at a small section of the frame and play it in motion.



Both the mv1080 and mv720 shots were framed at 1280x720 but the mv720 shows a drop in resolution and increased aliasing.

What are the advantages of mv720? On other cameras the default frame rate for mv720 is 60 or 50 frames per second depending if you are set in NTSC or PAL mode. On the EOSM it defaults to 24, 25 or 30 fps depending on the settings in the Canon menu. Yeah, the EOSM should be able to do raw 60p just like the DSLR's but that's a different topic.

Teamsleepkid

Looks a hell of a lot sharper on that video you posted. Think the grain will be less pronounced in low light? Thats where i seem to be struggling the most with my M. Not enough sharpness and too much grain. If I add sharpening to make up for the 720p image the grain gets sharper and more pronounced. If we shoot mv1080 crop maybe we don't have to add sharpness and the grain won't look so pronounced.
EOS M

dfort

Yeah, the best setting for recording raw video on the EOSM is mv1080crop. As far as grain, it should be more pronounced in low light. To make mv720 video look good it is probably better not to add any sharpness. If anything, keeping the image soft might hide some of the aliasing. If you shoot 720p at 60fps it looks better but we can't go there on the EOSM.

rbrune

After a long time I finally had time to fiddle around a little bit.

Using adtg_gui I overrode the ADTG 800C register that controls the vertical line skipping to switch from 3x5 (0x4) to 3x3 (0x2) line skipping mode. To successfully record an mlv file I also changed mlv_rec.c to ignore the special squeeze factor calculation that assumes the EOSM is always in mv720 mode.
To get the camera to accept the overridden register one has to use the INFO button to switch into Canons menu and display modes and back into magic lantern. The preview image should be stretched when it worked.

Here example 1x1, 3x5 and 3x3 frames from the exact same spot, with the same 22mm lens and the same mlv_rec resolution settings.

What I'm not sure about is how to properly implement this in a way that is conveniently usable - and acceptable for the main branch version of Magiclantern. 


single 1x1 crop mode frame recorded with mlv_rec


single 3x5 mv720 squeeze mode frame recorded with mlv_rec


single 3x3 frame recorded with mlv_rec overriding ADTG2[800C]=2

a1ex

Very nice. Sounds like a great addition to the crop_rec module.

The code there is be fairly generic - you can see the actual mode patches are done under "if (is_5D3)" blocks. It's written that way to make it easier to accommodate other models.

rbrune

Quote from: a1ex on October 26, 2016, 09:59:23 PM
Very nice. Sounds like a great addition to the crop_rec module.

The code there is be fairly generic - you can see the actual mode patches are done under "if (is_5D3)" blocks. It's written that way to make it easier to accommodate other models.

Great, I'm looking through the module right now. Some questions popup.

In crop_rec ADTG_WRITE for the 5D3 is defined as 0x11640 but in adtg_gui ADTG_WRITE_FUNC is 0x11644 - since the idea is to place the hook, how would I determine a good position, I assume the difference is based on that?
And what is the purpose of MEM_ADTG_WRITE / the second argument (orig_instr) to patch_hook_function? Following the code I assume this is just a safety measure to check the memory content before patching?


a1ex

0x11640 is good. I usually do these adjustments are to avoid cache conflicts (not the case here, because this address is in RAM) or to avoid backend quirks (for example, older versions of patch hooks could not be placed on a branch). Here, both addresses will work, but 0x11640 is the actual start address for the function.

MEM_ADTG_WRITE is just a safety check.

rbrune

Quote from: a1ex on October 26, 2016, 11:45:27 PM
0x11640 is good. I usually do these adjustments are to avoid cache conflicts (not the case here, because this address is in RAM) or to avoid backend quirks (for example, older versions of patch hooks could not be placed on a branch). Here, both addresses will work, but 0x11640 is the actual start address for the function.

MEM_ADTG_WRITE is just a safety check.

That works really well. I made a pull request into the crop_rec branch.

Issues so far:
- I had to deactivate the cmos_hook, even without it changing values it results in black preview data from the sensor
- mlv_rec assumes that the EOS is in 3x5 mode when calculating the squeeze factor. I removed that for now. Maybe we can check the crop.preset value there?
- the preview in 3x3 override mode is of course now stretched. Not sure if that can easily be fixed

rbrune

In case someone wants to play around with it:
https://drive.google.com/file/d/0B5FJDsqHlkJ6TVNXS1Y0MWF0dXM/view?usp=sharing

Activate the crop_rec and mlv_rec module. Under video set the crop to 3x3 mode, switch to play mode or to a canon menu for a second to make the override work and then go ahead and record mlv. Be aware that the preview is stretched.

dfort

Interesting idea. I took a quick look and it does seem to be recording in mv1080 mode or something like that. Seems that the maximum vertical resolution is 692 so you can't record 1280x720 16:9 video. Thanks for posting a binary so more EOSM users can check it out.

Teamsleepkid

EOS M

dfort

Rafael Brune is the EOSM hero of the day.

DeafEyeJedi

Thanks for sharing Rafael and perhaps we should remind those that aren't aware ... please do not activate the autofocus fine-tuning (dot_tune.mo) otherwise you will see wall of errors scrolling up on your LiveView LCD as it hasn't been fixed (yet).
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109

madz

Finally EOS-M is just about to become little video beast on steroids :) Thank you, Rafael, for your work and time!

P.S. Unfortunately I wasn't able to open that google drive link :(
650D.104 | EOSM.202

dfort

Right--it looks like there are some problems with build and link rbrune posted. According to his latest pull request comment he won't be near his camera until Monday evening so for anyone eager to try it out over the weekend I posted a build on my bitbucket download area:

https://bitbucket.org/daniel_fort/magic-lantern/downloads

Also hoping to get this into the Crop mode recording (crop_rec.mo) (1:1, RAW/H.264, 25/30/50/60 fps) topic.


madz

@rbrune

Sorry for some offtopic

As I understood you managed to switch subsampling inside of mv720? So it might be possible now to make 48/50/60fps RAW on 5D3 without stretching using same method?
650D.104 | EOSM.202

Danne

it,s better. It affects mv1080p footage. Great work rbrune.

Got a file from dfort. Seems it,s also free from focus pixels? Could this be right?

rbrune

Quote from: madz on October 28, 2016, 05:10:32 PM
@rbrune

Sorry for some offtopic

As I understood you managed to switch subsampling inside of mv720? So it might be possible now to make 48/50/60fps RAW on 5D3 without stretching using same method?

Check out the crop_rec module thread linked in the post above you. That does exactly that - but don't credit me, it is not my work.
I just tried if we can get 3x3 working in the mv720 mode on the EOSM and after a1ex pointed me towards the crop_rec mode I just added some preliminary support for the EOSM. After the weekend I will try to tackle the remaining issues of which the most important one is probably to center the recording area.

dfort

Quote from: rbrune on October 28, 2016, 09:23:58 PM
After the weekend I will try to tackle the remaining issues of which the most important one is probably to center the recording area.

I helped a 60D user with this problem a while back. Here's how we fixed it:

http://www.magiclantern.fm/forum/index.php?topic=16912.0

Teamsleepkid

yes i noticed the recording area is a little off. didn't want to sound like i was complaining. thank you.
EOS M

rbrune

Quote from: dfort on October 28, 2016, 09:57:15 PM
I helped a 60D user with this problem a while back. Here's how we fixed it:

http://www.magiclantern.fm/forum/index.php?topic=16912.0

It's a little different in this case.
mlv_rec tries to center the recording area inside the area of the sensor that is read out. What is off here is that the area of the sensor that is read out is not centered anymore after switching to 3x3 binning. What needs to be done is getting the cmos_hook working and changing the start read out line for the read sensor area.

dfort

Quote from: rbrune on October 28, 2016, 10:58:47 PM
It's a little different in this case.

It certainly is. I got a chance to do some quick tests. Please check that I'm doing this right because there aren't really any instructions for this yet.

Let's start with the Canon menu. Make sure to have the camera in movie recording mode. We're going for mv1080 video (3x3 line skipping) so the camera should be set up for 1920x1080 24fps.


Everything else is set up via the Magic Lantern menu starting with making sure both the crop_rec and mlv_rec modules are loaded.


Turn on the crop_rec module and pick the 3x3 720p (1x wide) option. Yeah, it is confusing because the Canon menu is set to 1080p and the crop_mode is set to 720p but it will all make sense in a few steps.


The frame size that I really wanted is 1280x720, that's a 16:9 aspect ratio but the maximum vertical resolution is 692 which corresponds to a 1.85:1 aspect ratio. Ok, close enough and it is a standard cinema aspect ratio so I'm good with that.


When you go to LiveView everything looks "normal" if you've ever shot raw video except maybe the crop doesn't look quite right and there's a little warning sign at the bottom of the screen. If you look back a couple of screenshots you'll see a message saying, "After leaving ML menu, press PLAY twice to enable crop mode."


This is what it looks like after pressing PLAY twice. Wow, that's quite a stretch!


The default settings are for most of the screen overlays to disappear when recording. I find that the best way to frame your shot is to make some marks right on the screen with tape or a marker. Lo-tech but it works.


I haven't shot any video's worth sharing using this module yet but here's a frame of a quick shot using the above settings. The actual frame size is 1280x692 and the EOSM seems to have no problem recording continuously at this setting. That wild moiré going on in the background is due to a window screen. This is "normal" with raw video and these ML enabled Canon cameras (with the notable exception of the 5D3).


So why 720 (or actually 692) and not 1080 and isn't this supposed to be mv1080? The frame full buffer when recording 1080p video on the EOSM is 1808x1190. The camera is skipping every 3rd pixel horizontally and vertically and the maximum resolution of the sensor is 5184 x 3456, give or take. In mv720 mode it is a 3x5 pattern skipping 3 pixels horizontally and 5 pixels vertically with a buffer size of 1808x727. When recording H.254 the frame is scaled up in 1080p mode and in 720p mode it is scaled down but only in the horizontal axis. Ok so in mv1080 mode the ML menu should go up to 1728x1158 on the EOSM like it does on it's big cousin, the 700D (the full buffer is cropped when recording video). However, there's no way to record that much data with the camera's hardware so we're limited to a frame size of about 1280x720. You can vary the dimensions somewhat, it is the size of the frame in MB that matters. Make sense? Good, now can someone explain it to me because I'm not sure I got this right. As far as I know this isn't really documented all in one place.

Long story longer, @rbrune has figured out a way to get mv1080 raw video out of the EOSM. What I'm finding very intriguing is that there are no focus pixels showing up on the frames. Just to make sure I'm not seeing things I used mlv_dump to create the DNG frames because MLVFS automatically masks out the focus pixels. Now how did that happen? Maybe there is an answer to dealing with focus pixels in camera?

Teamsleepkid

I have focus pixels on my footage. I'm using 5:3 aspect ratio though 1.66.. maybe since the framing is off they are underneath of your footage?..maybe I'm doing something wrong but Ive got em. I did the same thing you outlined dfort except i used 1080p30 with fps override for 23.976.
EOS M

a1ex

Quote from: dfort on October 29, 2016, 05:43:43 AM
So why 720 (or actually 692) and not 1080 and isn't this supposed to be mv1080?

On EOS M, in standby, the LiveView is configured as 720p, even if you have selected 1080p in Canon menu (see first post). Once you start recording H.264, the LiveView is reconfigured to what you have selected in Canon menu (resolution, fps). Of course, it goes back to 720p once you stop recording H.264.

Tip: you can see the default LiveView configuration from the FPS override submenu, without turning it on.

QuoteOk so in mv1080 mode the ML menu should go up to 1728x1158 on the EOSM like it does on it's big cousin, the 700D (the full buffer is cropped when recording video). However, there's no way to record that much data with the camera's hardware so we're limited to a frame size of about 1280x720.

FYI, the card speed never affects what options appear in menu. And, iirc, the two cameras have nearly identical write speeds.