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 1 Guest are viewing this topic.

DeafEyeJedi

That's a bummer that it didn't work out in favor for the 2.5K stuff while in 5x zoom. Regardless I'll give this new 7D build a test run and Thanks for this @dfort!

5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109

IDA_ML

Hello all,

I am happy to provide some ffedback on the first significant progress with the EOS 7D for the last two years.  Thanks to Dfort's systematic efforts and helpful hints provided by A1ex, Aprofiti, Reddeercity and others, with today's experimental build, we finally have 10 and 12 bit uncompressed MLV video working.  I would like to thank all these people for making this remarkable progress possible.  Here is what works and what doesn't:

RAW video (MLV):
---------------------
All three bitdepths: 10, 12 and 14 bits uncompressed provide continuous recording with sound at 24fps.  If the preview mode is set to "Canon" in the sub menu, we also have a nice real time WYSIWYG color preview.  Recording is very stable and no corrupt frames are observed.  The maximum frame rate that can be set is 25fps.  If you add the raw_twk.mo module to the Modules folder, in-camera playback is possible.  This module is available in the Dec. 1-st, 2016 build.

For those of you who wish to see how 10-bit uncompressed RAW video from the 7D looks like, here are two short videos shot at 1728x972/24 fps:

https://we.tl/t-vJz7bBt9l4

As I mentioned in my post #1757, at 5x-magnification, the camera can also record in the 2496x1198 at all 10/12/14 bit depths.  At 10 bits/24fps recording is continuous, with sound and there are no corrupt frames in the footage.  Also very stable but prevew is 5x and not WYSIWYG.

RAW video:
-------------
As Dfort mentioned and DeafEyeJedi showed in his video, this mode does not work.  Footage is corrupt and camera crashes ocasionally, hard to reproduce though.

dfort

I want to look a little deeper into why zoom mode worked before patching but not after patching. When I was posting builds a few years ago for testing 10/12bit I wasn't aware back then that several cameras weren't ported to this branch at the time--yet they worked in zoom mode. Now that we have a few LV State, Digic 4 cameras ported maybe they all have this same issue?

Could some 50D and 5D2 users please download the latest 10/12-bit RAW video build from the Experiments downloads page and report back whether or not zoom mode is working on those cameras with the raw_video_10bit_12bit_LVState branch.

Back to the 7D, my development branch has some ugly hacks in it and now other cameras won't compile on it so it is going to take some more work before this can be merged. However, for those who want to keep moving the 7D to the next level I enabled CONFIG_DIGIC_POKE on the latest test build and posted it on my downloads page. Careful when using it. You might want to read through the 3K/UHD 5D2 Raw development and Other Digic IV Cams topic to see which registers to tweak. Yeah it isn't as cool as adtg_gui but it seems to be working on the 7D.

reddeercity

3x crop_mode 10-12bit has always works since dec/2016 .
yes , 5D2 works with the ML 10-12bit release on the
experimental download page works in 3x crop_mode (5x zoom) as well as 1:1 FHD

You will need 3x crop_mode working for 3k/UHD , pretty much everything is done in 3x crop_mode on d4 cams .

aprofiti

@dfort Have you already tried to use the "not so good" stub for x5 mode?
Is the different version of patch_hook_function() needed because of the sligthly different disassembly?

Can't test x5 mode on 50D, but I think it should works.
Will try to record a quick video as soon as possible.

dfort

Quote from: aprofiti on March 03, 2019, 01:27:37 AM
Is the different version of patch_hook_function() needed because of the sligthly different disassembly?

That's right. The 50D and 5D2 have the same instruction for the StartImagePass_x1 stub but the 7D, 500D and 550D have a different instruction so it needs to be adjusted when invoking the patch_hook_function or it will show an error on the console and the patch isn't applied.

Quote from: reddeercity on March 03, 2019, 12:54:36 AM
5D2 works with the ML 10-12bit release on the
experimental download page works in 3x crop_mode (5x zoom) as well as 1:1 FHD

Hum, let's try this again. Took my latest test build, ran Dump DIGIC registers just to see what registers show up on the log, fired up mlv_rec and what??? It works!!! Tried both mlv_rec and mlv_lite. At one point I did get some corrupt frames with mlv_lite but couldn't replicate it. So it looks like this latest build might be working working. Something that may have made a difference is that with these various branches merged together I now need to run "make clean" in the installer directory or subsequent attempts at compiling fail. Maybe that last test build didn't have good "make" cleaning before compiling.

It isn't perfect, not by a long shot. Turning the camera on and off isn't a problem. Note that in prior attempts it sort of worked when first starting up a virgin build but then showed corrupted frames after subsequent startups. However, now when pulling out the card and reinserting it, the camera won't start up--it needs a battery pull. Well, battery pulls seems to fix a lot of problems but what is the problem here? Maybe it should unpatch on shutdown? IDK.

reddeercity

Had a look at the reg's , there seem to line up with 5D2 -- shouldn't  be too hard to port to crop_rec .
the Interesting ones are
c0f06008:  22d022d    *Timer A*
c0f06014:      59b   *Timer B*
c0f0713c:      4cc   *Head Timer 3*
c0f07150:      538  *Head Timer 4*
c0f06084:    10143             
c0f06088:  4ca062f *Raw Resolution Size*
c0f08184:      4c9   *Preview Raw Height*
c0f08188:      9d7   *Preview Raw Total Width+ob area*
c0f08518:  4c909d7 *Preview Raw Height & Width*


raw res
4ca=>1226 (horizontal)
62f=>1583 x2->3166 (vertical) Maybe 3X crop_mode ? not sure on the off set
raw height head timers 4cc->1225 & 538->1336
Wow , there a lot of over head there , on the 5d2 I set
both head timer to the same valve e.g.4cc , it gives higher frame rate on extended res's   
c0f08184 , 8188 & 8518 work together for real time preview
8184 - raw height preview (set to the same as c0f0713c & 7150)
8188 - total preview raw width + OB area  (e,g, 5d2 in 3xcrop_mode offset=160 or OB area)
8518 - preview raw height & width from 8184 & 8188

AF-OFF

Quote from: dfort on March 02, 2019, 09:56:33 PM
Could some 50D and 5D2 users please download the latest 10/12-bit RAW video build from the Experiments downloads page and report back whether or not zoom mode is working on those cameras with the raw_video_10bit_12bit_LVState branch.

Yes, works for me on 50D . I can zoom in, and record 2000x1078 rav video , zoom out and record 1584x1056 , both 12bit uncompressed and 24fps.
See screenshot of damaged frame - each zoomed clip has two damged frames at the beginnig, frame 002 and 003.
Magnification (5x 10x) is without pink hue, I have had using another build.







aprofiti

Quote from: AF-OFF on March 03, 2019, 10:43:04 PM
Yes, works for me on 50D . I can zoom in, and record 2000x1078 rav video , zoom out and record 1584x1056 , both 12bit uncompressed and 24fps.
See screenshot of damaged frame - each zoomed clip has two damged frames at the beginnig, frame 002 and 003.
Magnification (5x 10x) is without pink hue, I have had using another build.



Confirmed. Same here with a quick test in 5x mode using mlv_lite.

Tried to record a clip with mlv_rec and it doesn't show broken second and third frames

dfort

Thanks--so it looks like the 7D is performing about as well as can be expected at this point. Moving on to the next stage, getting crop_rec working on this camera.

DeafEyeJedi

Quote from: dfort on March 04, 2019, 03:08:23 AM
...so it looks like the 7D is performing about as well as can be expected at this point.

Pretty much...



Quote from: dfort on March 04, 2019, 03:08:23 AM
Moving on to the next stage, getting crop_rec working on this camera.

It's definitely getting warmer...
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109

dfort

@DeafEyeJedi - can you reproduce the conditions that caused the corrupted frames? Something similar happened here but I couldn't reproduce it. I'm pretty sure it was a reduced bit setting with mlv_lite. Note that both mlv_lite and mlv_rec are working on the test build.

AF-OFF

Quote from: dfort on March 04, 2019, 07:44:49 AM
I'm pretty sure it was a reduced bit setting with mlv_lite. Note that both mlv_lite and mlv_rec are working on the test build.

@dfort same on the 50d, the Raw video module instead of mlv lite, does not produce bad frames in any mode when zoomed , 1984x1079
preview set to canon, when zoomed 5x, when recording very nice bw preview.
mlv lite has color preview. (but 2 bad frames at beginning of each zoomed recording)
really like this bw preview.



reddeercity

mlv_Lite has been a problem on d4 cams , I never use it  (besides it not having audio support) .
The pink frames/corruption are a result of system overload (can't keep up)
In mlv_lite you need to kill overlays to stop the pink frame/corruption , the display code is different then mlv_rec
where there's no pink frames/corruption . In mlv_rec , there's code to  kill overlays when recording raw video at least on the 5D2
and you can choose between debug info (record GB/time/buffer load) or a movie icon with time recorded . The overlays take up a lot of resources .

Danne

Put this in mlv_lite. Should work and bring you black and white preview while recording:
Change:
        (need_for_speed && !get_halfshutter_pressed())
            ? RAW_PREVIEW_GRAY_ULTRA_FAST
            : RAW_PREVIEW_COLOR_HALFRES

to:
        (need_for_speed && !get_halfshutter_pressed())
            ? RAW_PREVIEW_GRAY_ULTRA_FAST
    : cam_5d2 && RAW_IS_RECORDING ? RAW_PREVIEW_GRAY_ULTRA_FAST
            : RAW_PREVIEW_COLOR_HALFRES

Turning off global draw should be easy enough manually but it can be done in mlv_lite too. Also maybe worth to look into reg 7150 and 713c and see if they can be tweaked for corruption.

reddeercity

yes but this take CPU cycle , and still a impact to performance .
with "kill Overlays" code it picks up 10-15MB/s (65MB/s to 79MB/s) write speed and uses
Canon Liveview (full Color) so no lag . Also mlv_lite causes hdmi to be unusable on 5D2
nothing but pink & corrupted frames . mlv_lite is really not design for d4 cams but for the much
faster d5 cams .

dfort

Quote from: reddeercity on March 05, 2019, 07:16:57 AM
...mlv_lite causes hdmi to be unusable on 5D2
nothing but pink & corrupted frames . mlv_lite is really not design for d4 cams but for the much
faster d5 cams .

Maybe -- or maybe it is because what you are using has some experimental work that I did a while back that didn't work properly so I abandoned it. Check out the commit messages on the waza57 repository.



It might also be because you aren't using the latest version of mlv_lite. Look at some of the work that was put into it since the branch you are using was last updated to the main repository:



dfort

Quote from: Danne on March 05, 2019, 06:42:55 AM
Put this in mlv_lite...

I tried this:

        (need_for_speed && !get_halfshutter_pressed())
            ? RAW_PREVIEW_GRAY_ULTRA_FAST
            : cam_7d && RAW_IS_RECORDING ? RAW_PREVIEW_GRAY_ULTRA_FAST
            : RAW_PREVIEW_COLOR_HALFRES


Didn't work.

I also did some more testing between mlv_lite and mlv_rec. I'm getting clean video on all settings using mlv_rec but mlv_lite won't work with 10/12bit on zoom mode. There is also a chance of getting corrupt frames on other settings using mlv_lite.

On Digic 5 cameras mlv_lite has evolved and surpassed mlv_rec in pretty much every way but the raw_video_10bit_12bit_LVState branch is using a rather early version of mlv_lite so this isn't surprising. One of the features that would be great to have is lossless compression and only mlv_lite works with that. However, this is yet another challenge for Digic 4 development.

ProcessTwoInTwoOutLosslessPath topic:
Quote from: a1ex on March 06, 2019, 12:10:40 AM
I had many attempts to get it working on DIGIC 4, but didn't document them, because... it just didn't work in LiveView.

Anyway--drifting off topic.

Right now the raw_video_10bit_12bit_LVState branch is working with 5D2 and 50D. My 7D branch is also working but it has some ugly hacks and the other platforms won't compile on it. It should be possible to get 10/12-bit working on all of the other ML supported Digic 4 cameras. Finding the stubs was pretty easy on the 500D and 550D so let's document that:

platform/500D.111/stubs.S
/** LiveView RAW patches **/
NSTUB(0xff1f7154, StartImagePass_x1_SetEDmac)
NSTUB(0xff1f7dc0, StartImagePass_x5_SetEDmac)


platform/550D.109/stubs.S
/** LiveView RAW patches **/
NSTUB(0xff242f04, StartImagePass_x1_SetEDmac)
NSTUB(0xff243cc4, StartImagePass_x5_SetEDmac)


Anyone care to verify that? Test builds on my Bitbucket downloads page.

How about finding these stubs for the 60D and 600D?

[EDIT] Just remembered that the 60D and 600D are EVF_STATE and not LV_STATE so this doesn't apply. Is 10/12bit already working on these cameras?

Danne

Camera 500D:
Tested 10bit and 12bit on mlv_rec. Completely scrambled
tested 10bit mlv_lite Completely scrambled

Cam went back into work cupboard. No more tests until monday on my part...

Edit.
600D already working.

dfort

Hum--I'll double check everything. On Monday could you check if the patches are being applied? I can't get it to show up in QEMU.

I guess there's no point including mlv_lite on these Digic 4, LV State test builds.

IDA_ML

I have a question to those that may be able to help.  The 7D now provides a nice preview in the magnified RAW video (MLV) mode which makes framing possible.  My question concerns the preview during recording which now is 5x-magnified.  Would it be possible to make it WySiWyG, even if it is only black and white and with a reduced frame rate?  WySiWyG preview works quite well with the 100D.  Maybe, it could be implemented into the 7D too.  If that happens, this would further enhance framing, especially when you move the camera and need precise framing to avoid unwanted objects entering the scene.  I am sure, 7D users will greatly appreciate such a preview enhancement.

dfort

Mirrored copy, long jumps -- re-reading Reply #1772 maybe the 500D and 550D need to be booted using the "classic" method like what worked for the 7D?

DeafEyeJedi

Quote from: dfort on March 07, 2019, 07:24:11 PM
...maybe the 500D and 550D need to be booted using the "classic" method like what worked for the 7D?

Sounds about right...
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109

domo94

Holy crap,

I got busy for 1-2 weeks and you guys flipped the switch so hard on the 7D.

Y'all are such a blessing! Wow.

Thank you so much for your interest and hard work on the 7d though I know it's a hardcore camera.
I can't wait to start shooting with this camera, it seems the low light on it is better than 14 bit, based on Jedi's videos he uploaded.

Time to run some tests. Having 10-12 bit raw capabilities is RIDICULOUS for this camera. Oh man, the stability and security of recording this camera is going to provide is amazing.
I may not need to sell after all...

domo94

Just ran some slow-mo tests.

Go to Canon menu and drop to 720 fps, shoot at maximum resolution possible, bring aspect ratio down to 2.20:1 / 2.35:1 and you get continuous slow-mo, 10-bit raw footage, no corruptions, no dropped frames, excellent footage.

1600 is max ISO for 7D still. You can bump to 2000 as well, 2500 + is total crap.

Funny though when you get to 6400 ISO, you actually get less grain/artifact than anything below. Would only use in very necessary times where I just NEED some footage of something. or maybe even just risk some footage and do heavy post work to make it look clean.