12-bit (and 10-bit) RAW video development discussion

Started by d, May 22, 2013, 10:58:34 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Andy600

I wouldn't be surprised if 01 and 02 also work for the 5D2  ;)
Colorist working with Davinci Resolve, Baselight, Nuke, After Effects & Premier Pro. Occasional Sunday afternoon DOP. Developer of Cinelog-C Colorspace Management and LUTs - www.cinelogdcp.com

dfort

0x01 and 0x02 are also working on the 7D but what I'm noticing is that when turning on the camera the LV skips until you start recording then it smooths out. 0x10 doesn't do that.

For those of you who are wondering what we're talking about. Andy600 and I are trying to find the best raw_write_chan to use.

/** this method bypasses Canon's lv_save_raw and slurps the raw data directly from connection #0 */
#ifdef CONFIG_EDMAC_RAW_SLURP

#if defined(CONFIG_5D3)
uint32_t raw_write_chan = 0x4;  /* 0x12 gives corrupted frames on 1.2.3, http://www.magiclantern.fm/forum/index.php?topic=10443 */
#elif defined(EVF_STATE)
uint32_t raw_write_chan = 0x12; /* 60D and newer, including all DIGIC V */
#elif defined(CONFIG_7D)
uint32_t raw_write_chan = 0x10; /* tested 0x01 through 0x60 (0x01 and 0x02 also work) */
#elif defined(CONFIG_5D2)
uint32_t raw_write_chan = 0x10;
#elif defined(CONFIG_50D)
uint32_t raw_write_chan = 0x01; /* 0x01 and 0x02 reported to work by Andy600 */
#elif defined(CONFIG_500D)
uint32_t raw_write_chan = 0x10;
#elif defined(CONFIG_550D)
uint32_t raw_write_chan = 0x10;
#endif

Andy600

No skipping or frame issues on the 50D. Tested a lot more today. Recorded 300Gb+ at different resolutions and not had any issues 8).

The LV skipping might be something to do with movie mode!? The 50D doesn't have a dedicated movie mode (it was added by a1ex) so maybe those EDMAC channels are not shared/used on the 50D but are on the 7D, 5D2 etc. Just speculating.

Colorist working with Davinci Resolve, Baselight, Nuke, After Effects & Premier Pro. Occasional Sunday afternoon DOP. Developer of Cinelog-C Colorspace Management and LUTs - www.cinelogdcp.com

dfort

@Andy600 -- Seems logical. Does 0x10 also work on the 50D? Do you find 0x1 more stable? Here's my experience on the 7D, maybe you can check these settings on the 50D.

Some things are consistant on the 7D, like recording up to 1736x976 (16x9) mv1080 at 10bit but as soon as I increase the vertical resolution to the next step 1736x1040 (5:3) it breaks up.

This morning I tried zoom mode and although the LV refresh rate was rather low I got good video at every resolution all the way up to 2520x1192 at 10bit. Don't get too excited, next time I tried it all I got was a garbled LV and corrupted frames. About the only thing consistant in zoom mode is that once you press the magnifying lens button you can't get out of that mode without restarting the camera. Still, there is a glimmer of hope there. I saved the test--I'll keep it on my downloads page for a few days. Don't judge the artistic content, I shot it without even getting out of bed.



7D 2520x1192 zoom mode at 10bit

Andy600

Quote from: dfort on December 09, 2017, 04:16:33 PM
@Andy600 -- Seems logical. Does 0x10 also work on the 50D? Do you find 0x1 more stable?

0x10 works for some resolutions but not others http://www.magiclantern.fm/forum/index.php?topic=5601.msg194350#msg194350

I get, dare I say, no problems using channels 0x01 and 0x02 at all resolutions in 10, 12 and 14bit. Tried most channels up to 1F. Most don't work and the ones that did (0x0A, 0x0B, 0x03) had issues (corrupt LV, EDMAC timeout etc).

For the 50D 0x01 and 0x02 are the ones to use. I'm interested to see if those channels work equally well on the 5D2. I don't have one to test but I suggest uploading a couple of 5D2 test builds for someone that does (or I can build/upload).

I would like to try pushing the resolution but don't know where to start. The 50D is maxed at 2000*1076 currently (crop).
Colorist working with Davinci Resolve, Baselight, Nuke, After Effects & Premier Pro. Occasional Sunday afternoon DOP. Developer of Cinelog-C Colorspace Management and LUTs - www.cinelogdcp.com

masc

Quote from: Andy600 on December 09, 2017, 05:17:19 PM
I'm interested to see if those channels work equally well on the 5D2. I don't have one to test but I suggest uploading a couple of 5D2 test builds for someone that does (or I can build/upload).
If you could do that, I could test... not this weekend, but next week I'll find some time for testing... ;) That is so exciting!
5D3.113 | EOSM.202

dfort

Put up the 5D2 test builds recommended by @Andy600 - raw_video_10bit_12bit_raw_write_chan=0x01 and 0x02. On my downloads page.

Of course if more users would run through the simple compiling tutorials for Mac and Windows and run tests like @Andy600, development would move at a faster pace.

Quote from: Andy600 on December 09, 2017, 05:17:19 PM
...no problems using channels 0x00 and 0x01 at all resolutions in 10, 12 and 14bit...

You mean 0x1 and 0x02, right?

Quote from: Andy600 on December 09, 2017, 05:17:19 PM
I would like to try pushing the resolution but don't know where to start. The 50D is maxed at 2000*1076 currently (crop).

That sounds about right. The 50D has a 15.1 megapixels sensor while the 7D has a 17.9 megapixels sensor. Increasing resolution beyond zoom mode is handled by the crop_rec module.

Speaking of crop and zoom, it can get rather confusing. When I was working on the focus pixel issue with EOSM/100D/650D/700D I added this to one of my scripts. The buffer sizes are different on these Digic IV models but the description of the various video modes still apply. We need to concentrate on mv1080, mv720 and zoom modes for the LVState cameras (7D/50D/5D2/500D/550D):

# Mode          Buffer Size   Notes
#
# mv1080      - 1808x1190  -  Uses full sensor area with a 3x3
#                             line skipping pattern.
#                             Not available on the EOSM.
#                             Canon menu setting 1920x1080 24/25/30.
#
# mv720       - 1808x727   -  Uses full sensor area with a 3x5
#                             line skipping pattern.
#                             Needs to be stretched by 1.67x
#                             vertically - up to 50/60 fps.
#                             Limited to 24/30 on EOSM.
#                             Canon menu setting 1280x720 50/60.
#
# mv640       - 1808x1190  -  Basically the same as mv1080 mode when
#                             shooting MLV/RAW.
#                             Canon menu setting 640x480 25/30.
#
# mv1080crop  - 1872x1060  -  High resolution and largest
#                             sustainable frame sizes on all cameras.
#
# mv640crop   -            -  Not available on these cameras.
#
# zoom        - 2592x1108  -  Same 5x magnification as mv1080crop but
#                             can pan around sensor and achieve
#                             higher resolution than mv1080crop.
#
# crop_rec    - 1808x727   -  Requires crop_rec module.
#                             Uses mv720 raw buffer but records in
#                             3x3 line skipping like mv1080.

Andy600

Quote from: dfort

You mean 0x1 and 0x02, right?


Doh  ::)

Yes, I mean 0x01 and 0x02
Colorist working with Davinci Resolve, Baselight, Nuke, After Effects & Premier Pro. Occasional Sunday afternoon DOP. Developer of Cinelog-C Colorspace Management and LUTs - www.cinelogdcp.com

Andy600

Quote from: dfort on December 09, 2017, 06:42:42 PM
Speaking of crop and zoom, it can get rather confusing. When I was working on the focus pixel issue with EOSM/100D/650D/700D I added this to one of my scripts. The buffer sizes are different on these Digic IV models but the description of the various video modes still apply. We need to concentrate on mv1080, mv720 and zoom modes for the LVState cameras (7D/50D/5D2/500D/550D):

# Mode          Buffer Size   Notes
#
# mv1080      - 1808x1190  -  Uses full sensor area with a 3x3
#                             line skipping pattern.
#                             Not available on the EOSM.
#                             Canon menu setting 1920x1080 24/25/30.
#
# mv720       - 1808x727   -  Uses full sensor area with a 3x5
#                             line skipping pattern.
#                             Needs to be stretched by 1.67x
#                             vertically - up to 50/60 fps.
#                             Limited to 24/30 on EOSM.
#                             Canon menu setting 1280x720 50/60.
#
# mv640       - 1808x1190  -  Basically the same as mv1080 mode when
#                             shooting MLV/RAW.
#                             Canon menu setting 640x480 25/30.
#
# mv1080crop  - 1872x1060  -  High resolution and largest
#                             sustainable frame sizes on all cameras.
#
# mv640crop   -            -  Not available on these cameras.
#
# zoom        - 2592x1108  -  Same 5x magnification as mv1080crop but
#                             can pan around sensor and achieve
#                             higher resolution than mv1080crop.
#
# crop_rec    - 1808x727   -  Requires crop_rec module.
#                             Uses mv720 raw buffer but records in
#                             3x3 line skipping like mv1080.


currently no 720 mode on the 50D.

I tested 1080 and 640 modes with those EDMAC channels and all work although I have just been through all the dngs and did have a couple of random corrupt 10 and 12bit frames when set to 640 mode so it's not perfect. 1080 mode DNGs have no issues :)
Colorist working with Davinci Resolve, Baselight, Nuke, After Effects & Premier Pro. Occasional Sunday afternoon DOP. Developer of Cinelog-C Colorspace Management and LUTs - www.cinelogdcp.com

dfort

Seems like the 50D is the most stable with this 10bit/12bit experiment. Maybe since it wasn't designed for video the channels and buffers and what not are fixed in one place instead of moving around like what seems to be happening on the other cameras.

Is that mv640 mode of any use or is it pretty much the same as mv1080?

Andy600

It affects H.264 recording sizes but for raw recording, aside from the couple of bad frames I mentioned, it seems to be the same as mv1080 mode.

mv1080 at all bit depths and frame sizes seems to be rock solid 8). If it can be made to work with the crop_rec module and compression it should be quite good :) (actually, it's already good)
Colorist working with Davinci Resolve, Baselight, Nuke, After Effects & Premier Pro. Occasional Sunday afternoon DOP. Developer of Cinelog-C Colorspace Management and LUTs - www.cinelogdcp.com

dfort

I'd really like to get this merged into the raw_video_10bit_12bit branch so it could be included on the Experiments downloads page but so far it seems that the only camera that is ready for this is the 50D. Maybe I can make a pull request for just the 50D?

@a1ex, any thoughts? Is this experiment heading in the right direction?

Quote from: Andy600 on December 09, 2017, 07:39:57 PM
If it can be made to work with the crop_rec module and compression it should be quite good :)

I agree. It should be possible. Just requires some time and perseverance. Of course if more ML users would get involved it would help our chances. Sort of like the infinite monkey theorem, the chances may be extremely low (but technically not zero).

a1ex

From what I remember, the problem with 5D2 was similar to what it was reported (lack of good sync in LiveView), so I believe edmac_raw_slurp must be called from another place (somehow in sync with the LiveView capture process - probably the ReadOutDone event). I've started to look into that here, but didn't get too far. Still, the edmac module is compatible with DIGIC 4, so you are encouraged to try it and log the LiveView activity in various modes.

The last graph from that page is in the "edmac" branch, but not very interesting for the current issue; everything else is in mainline (edmac module). Didn't upload the drawing script yet, but you can upload some logs and I'll draw the graphs for you. If it won't require too much fiddling, I'll upload the script as well.

The 50D doesn't seem to be 100% clean either (the two video modes are likely identical in standby, so I assume the "rock solid" report was just pure luck). Just FYI - its firmware and video mode implementation is very close to 5D2 1.0.x (the older firmware without manual video controls).

My older attempt for 5D2 was pretty much the same as in the current PR, just less polished. Back then, I've used dmaFlags = 0x20000000, raw_write_chan = 5, PREFERRED_RAW_TYPE 5 and redirected_raw_buffer = malloc(2050*14/8*2000).

Andy600

mv640 had a couple of corrupt frames but I've recorded a lot with video mode set to mv1080 without issues at 10,12 and 14bit both crop and non-crop. No bad frames or LV glitches. Yes, might be luck but seems solid for me. What can I do to push it to break?
Colorist working with Davinci Resolve, Baselight, Nuke, After Effects & Premier Pro. Occasional Sunday afternoon DOP. Developer of Cinelog-C Colorspace Management and LUTs - www.cinelogdcp.com

CITY-U1001

1584х on 50D in no crop ? i see only 1568 on my camera  :-\
50D | EFS 18-55 | last build crop_rec-3744x1080_24fps_50D-eXperimental.4.57pm.2020May06.50D109.zip

Andy600

Quote from: CITY-U1001 on December 09, 2017, 09:04:39 PM
1584х on 50D in no crop ? i see only 1568 on my camera  :-\

1584 is because I'm testing 10/12bit with the MLV-Lite module.
Colorist working with Davinci Resolve, Baselight, Nuke, After Effects & Premier Pro. Occasional Sunday afternoon DOP. Developer of Cinelog-C Colorspace Management and LUTs - www.cinelogdcp.com

CITY-U1001

50D | EFS 18-55 | last build crop_rec-3744x1080_24fps_50D-eXperimental.4.57pm.2020May06.50D109.zip

a1ex

Quote from: Andy600 on December 09, 2017, 08:42:47 PM
What can I do to push it to break?

Different frame rates and different overlay configurations in ML (zebras, magic zoom etc). These are likely to affect the LiveView sync.

Some models and/or video modes might be luckier than others, or they might have a higher tolerance for timing errors. The 50D might be lucky because of the lower resolution.

I might be able to give a better answer after some hours of analyzing LiveView logs (to cross-check what happens on 60D and newer vs 550D and older models), but not right now. Want to check the timing relationships between the EDMAC transfers from connection #0, and the ReadOutDone event or HEAD interrupts, or whatever else might signal a completed image capture. The tools for doing that are edmac.mo and dm-spy-experiments. Some real-time plotting code that can be reused is in mlv_lite on crop_rec_4k (EDMAC plots).

ilia3101

Edmac channel 0x02 works perfectly for recording 10/12 bit on 5D2 without pink frames and without needing fps override, however crop mode is broken.

Interestingly... channel 0x01 produced same split frame problems as 5D2 had right at the start of 10/12 bit development. So 0x01 doesn't work at all on 5D2.

I noticed a strange problem though... the liveview seemed to refresh at around 12fps and stutter a lot, but not when recording... what is happening?
However on channel 0x01 it always stuttered and refreshed slowly even when recording.

I was using code fetched with this:
hg clone -u raw_video_10bit_12bit_LVState-wip https://bitbucket.org/daniel_fort/magic-lantern magic-lantern-dfort

Just recorded a "rock solid" 3-chunk, 3-minute, no corrupt frame 10 bit MLV :D

Quote from: a1ex on December 09, 2017, 09:27:14 PM
Different frame rates and different overlay configurations in ML (zebras, magic zoom etc). These are likely to affect the LiveView sync.
I tried doing this to make it break... framerate at some weird 24.88 fps, overlays, zebras, histograms, waveform everything that can be: enabled, still got a flawless 10 bit recording.

dfort

@Ilia3101 - So like the opthamologist says, which looks better A or B? Seems like 0x2 works on the 5D2 but the LiveView stutters until you start recording, just like on the 7D. I'm finding 0x10 doesn't exhibit this yet it records mv1080 at 1736x976 at all bit depths just fine. However, increasing the vertical resolution doesn't work. Sometimes it works in zoom mode but the LiveView either stutters or freezes--usually it doesn't work at all.

@Andy600 - Do you feel lucky punk? Just kidding. Same question as above. Is 0x1 or 0x2 really better than 0x10 on the 50D or do you just want to be different from everybody else?

Speaking of different, I'm not getting any responses from the 1100D camp, just one download. I tried getting the SRM_BUFFER_SIZE in QEMU but can't get to the ML menu. I'll upload a find-SRM_BUFFER_SIZE build but that camera is way behind, most modules don't even compile. Ironic that it was the work that was done on the 1100D that got this 10bit/12bit on Digic IV thing started.

dfort

Great news for the 1100D. Found a user who is willing to do some testing.

@nuvon -- I uploaded a find-SRM_BUFFER_SIZE build for the 1100D on my Bitbucket downloads page. It is using the latest code base which means that many of the modules won't compile. Don't worry about it, we just want one piece of information so follow these steps:

In the ML Debug menu go to Free Memory option:



This should display the SRM_BUFFER_SIZE. Write it down and report back.



(These screenshots were done on an EOSM so it might look a little different on the 1100D.)

There is also a build for the 1100D (raw_video_10bit_12bit.2017Dec06.1100D105.zip) on the same downloads page with all the goodies for the 1100D including mlv_lite and it should work with 10bit/12bit raw video. It would be great if you could try that build and report back.

reddeercity

I can confirm with @Ilia3101 on 5D2 in 1:1 non crop mode with mlv_lite & mlv full+audio ,
I can record 10 , 12 , 14 bit with out any frame corruption or out of sync Lv preview.
I downloaded the source code , changed write channel from 0x01 to 0x02 in edmac-memcpy.c  , compiled it locally in my VM.
Tested 1856x928 , 1872x936 , 1880x1056 , 1880x1016 , 1880x1128 , 1880x1248 ,  23.976 with frame over ride to exact in Auto Preview with mlv_lite
Pressed the half shutter while recording to get actuate framing with out issue , in 10 , 12bit (14bit where short 200 frame captures)

In mlv full with audio I tested 1856x928,  1856x1044 , 1856x1114 , 1856x1238 , 1856x1248 ,  23.976 with frame over ride to exact in Auto Preview ,
also pressed the half shutter while recording to get actuate framing with out issue , in 10 , 12bit (14bit where short 200 frame captures)


3x Crop mode is broken , it seems to keep the first frame it see as a alternating frame while the other frame has movement so
like frame #1 is frozen and frame #2 has normal movement and keeps repeating that pattern but frame #1 is not broken -- as in
artifacts or shearing with pink frame just frozen . I tested mlv_lite 2152x1072 & Full mlv + audio 2144x1074

*Note* Full MLV +Audio : audio was sync and was perfect , not problems.

My Camera setting and build information
magic.cfg
# Magic Lantern Nightly.2017Dec10.5D2212 (ee95e8825183+ (raw_video_10bit_12bit_LVState-wip) tip)
# Built on 2017-12-10 03:33:12 UTC by ml@ml-pc
# Configuration saved on 2017/12/10 00:17:36
beta.warn = 10
menu.first = -4
movie.log = 1
rec.notify = 0
enable-liveview = 2
fps.preset = 1
fps.override.idx = 32
fps.override = 1
battery.drain.rate.rev = 69
hist.log = 0
spotmeter.draw = 0
zebra.draw = 0
disp.mode.x = 149



mlv_lite.cfg
# Config file for module mlv_lite (MLV_LITE.MO)

raw.video.enabled = 1
raw.res_x_fine = -40
raw.write.speed = 6399
raw.warm.up = 2
raw.bppi = 0


mlv_rec.cfg
# Config file for module mlv_rec (MLV_REC.MO)

mlv.video.enabled = 1
mlv.res.x.fine = 64
mlv.bpp = 0
mlv.write_speed = 6699
mlv.display_rec_info = 2
mlv.buffer_fill_method = 0


mlv_snd.cfg
# Config file for module mlv_snd (MLV_SND.MO) mlv.snd.enabled = 1

This code looks promising for the 3.5/UHD development with custom buffers , I'll see if I can implement this in to my source code.

Edit: if anyone that can't compile and what to try out  1:1 10 & 12bit raw video with mlv_lite & full mlv+audio I uploaded to my bitbucket downloads magiclantern-10_12bit_broken_3xcrop_mode_2017Dec10.5D2212.zip




Andy600

Quote from: dfort on December 10, 2017, 02:29:14 AM
@Andy600 - Do you feel lucky punk? Just kidding. Same question as above. Is 0x1 or 0x2 really better than 0x10 on the 50D or do you just want to be different from everybody else?

To put it simply, 0x01 and 0x02 work with every setting and resolution when set to mv1080 but I had a couple of bad frames with a random LV glitch when set to mv640 mode[/url]. I have tested more as @a1ex suggested and, so far, I've had no additional issues. Call it a favorable race condition, luck or whatever but LV and recording on the 50D appear to be very stable when it's set to mv1080 with channel 0x01 or 0x02. I'm still testing.

There appears to be no difference between these channels but I can only test empirically and have nowhere near @a1ex's understanding of how these cameras work. He may well know of good reasons why those channels shouldn't be used.

0x10 has some issues with crop mode recording and glitchy, unstable LV.

I get that it would be simpler for all Digic IV cameras to use the same channels but I think the 50D is going to be a bit different by virtue of it's 'added' movie modes.
Colorist working with Davinci Resolve, Baselight, Nuke, After Effects & Premier Pro. Occasional Sunday afternoon DOP. Developer of Cinelog-C Colorspace Management and LUTs - www.cinelogdcp.com

nikfreak

Quote from: a1ex on December 09, 2017, 08:35:13 PM
... (somehow in sync with the LiveView capture process - probably the ReadOutDone event)....

what happened to http://a1ex.bitbucket.org/ML/states/ ??
[size=8pt]70D.112 & 100D.101[/size]

a1ex

Quote from: nikfreak on December 10, 2017, 09:31:28 AM
what happened to http://a1ex.bitbucket.org/ML/states/ ??

Good catch - they renamed it to bitbucket.io. Found this guide and renaming the old repository was enough to do the trick.

=> http://a1ex.bitbucket.io/ML/states/index.html

Also updated old forum links.