200D shoots raw video

Started by names_are_hard, February 09, 2024, 04:08:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

names_are_hard

Several years of learning ML code, trying to understand fragmentary docs, and in some cases writing the docs myself, 200D has raw video:



Bugs / quirks / limitations:
- only 14 bit is tested
- lossless modes are listed and definitely not supported, these should be hidden (this is a problem with mlv_lite code)
- mlv_lite has several hard-coded defaults that don't make sense for 200D (I think we need to make defaults detect cam model and choose behaviour intelligently)
- it records at 19.051 fps.  I have a few guesses as to why and will fix this
- 1280 * 720 is continuous, higher resolutions are not (200D SD interface is limited to about 40MB/s)
- MLV metadata is wrong in some places (bunch of stuff filled in as 0 or MAX_INT, it's a division by zero bug in ML code)

Code is available: https://github.com/reticulatedpines/magiclantern_simplified/compare/dev...200d_raw_draft
That's the changes compared to main branch; changes are fairly small!  This is a good place to look if you're interested in porting raw video to other Digic 7 models.

No direct links to builds yet, but if you ask in discord and have a good reason for using something that certainly hasn't been tested well, I might hand one over.  Otherwise you can wait till I've cleaned it up.

More cameras are in the works...

Frank7D


vastunghia

I think that would make it the best ML-enabled cam in terms of dynamic range -- 13.4 stops according to DxOmark, with the current best ML cam (6D) trailing far behind at 12.1 and the most popular ML cams (M and 5D3) at 11.2 and 11.7 respectively. Only the 5D4 (with 13.6 stops) could beat it -- excluding more recent MILCs of course.

Hooray, kudos and congrats!
5D3 for video
70D for photo

iaburn

Congratulations!!
Big thank you to the incredibly talented and wise devs that have the motivation to keep the ML project alive after so many years and still bringing the magic to new cams  :o ;D

a.sintes

It's too bad she won't live, but then again, who does?

iaburn

Quote from: vastunghia on February 09, 2024, 09:55:17 AM
I think that would make it the best ML-enabled cam in terms of dynamic range

The only downside is that those cameras were more ISO invariant, so they don't get that big boost that dual ISO can give. Also the 200D dynamic range falls very quickly with higher than base ISO

vastunghia

Quote from: iaburn on February 09, 2024, 10:22:27 AM
The only downside is that those cameras were more ISO invariant, so they don't get that big boost that dual ISO can give.

I may be wrong but I think that ISO invariance is the direct consequence of the readout noise being so damn low, making shadows easily recoverable even at base ISO. AFAIK it means that dual ISO (which is a very clever trick, at the end of the day) is nomore necessary -- you don't have to sacrify resolution to gain some DR, as DR is already close to max.

So if I'm right, 200D would be a game changer in DR!
5D3 for video
70D for photo

iaburn

Quote from: vastunghia on February 09, 2024, 11:57:45 AM
So if I'm right, 200D would be a game changer in DR!

You are right that it will be better without dual ISO, but I wouldn't say that the difference will be so important, we'll see ;)
https://www.photonstophotos.net/Charts/PDR.htm#Canon%20EOS%20200D,Canon%20EOS%206D(ML),Canon%20EOS%207D(ML)

heder

Congrats on the success!, I guess with a little SD OC'ing this camera will do just fine.

check firmware for "SDR104" string = 104MB/S,
check firmware for "SDR50" string = 50MB/S,

So I guess that the camera is currently running in SDR50 mode, but is SDR104 string present ? Also i'm Curious to know, If you go into zoom mode (x5,x10) what is the native resolution ?
... some text here ..

theBilalFakhouri

It also might be already in SDR104 mode but running at low clock speed (e.g. 96 MHz).
Comparing 77D vs 200D should help (both are DIGIC 7 and both have similar / identical functions or strings for SD stuff).

names_are_hard

Yup, it wants SD overclock!  I tried a bit, but the SD code looks quite different from older cams to me (but I have little experience in this area).  Certainly the logs during normal startup are different:


   962:   760.027 [SD] SdSwitchVoltage 1
   966:   813.315 [SD] SD initialize end speed=2 clock=2 UHS=1
   967:   813.361 [SD] strength 1111 current 3 mode 2


It knows about UHS, and it has parameters that look tunable.  I can see functions that do switch / case stuff and set registers in weird ways.  So I suspect it can be done, but I didn't get lucky finding equivs to the old registers in the few hours I looked :)

Zoom res check will have to wait, sorry - cam not connected now, and I'm going to be working on documenting EDMAC stuff for the next few days, so the next dev doesn't have to suffer as much.

yourboylloyd

This is the biggest thing I've seen in a while. Nice!
Join the ML discord! https://discord.gg/H7h6rfq

kitor

Quote from: names_are_hard on February 09, 2024, 06:53:20 PM
Zoom res check will have to wait, sorry - cam not connected now, and I'm going to be working on documenting EDMAC stuff for the next few days, so the next dev doesn't have to suffer as much.

Where, by the way, as for yesterday's evening:

     3389:  73978.898 dst, src: 0x4012a000, 0x4014a000
     3390:  73978.905 Pre-copy, *dst, *src: 0x1111, 0xa5a53333
     3403:  73999.170 Post-copy, *dst, *src: 0xa5a53333, 0xa5a53333


That was EOS R EDMAC memcpy. It seems that we'll be able to use it for simple mem-to-mem transfers even without knowledge about all the extra stuff that changed in D8 (and we have no idea how this really works now due to all extra layers).
Too many Canon cameras.
If you have a dead R, RP, 250D mainboard (e.g. after camera repair) and want to donate for experiments, I'll cover shipping costs.

Danne

Wonderful news. Good work. Hard work 👍.

kitor



Yes, that's EOS R. Yes, it is Digic 8. Yes, we said don't count on it as EDMAC is completely different.
Yet here we are  8)

Caveat: it only adds a page into a list of digic 8 instabilities with ML, records roughly 30-60 frames before stops... something related to memory management that I didn't solve yet.
No builds will follow as D8 requires a ton of work before being usable in any way.

But: AF works while recording  :) When 4k is selected in Canon menus, raw buffer is 4K too (unfortunately cropped, as expected).

My PoC on top of @names_are_hard PoC is on my branch: https://github.com/kitor/magiclantern_simplified/commits/raw_draft/
This is shameless "fake it till you make it", thus needs to be redone from scratch after fixing stuff.


There's also a significant progress in understanding D8 EDMAC. Not enough to setup random transfers, but it was more than good enough to get mlv_lite working :)
I'll wait for Names for his EDMAC documentation and update it by my current D8 knowledge.
Too many Canon cameras.
If you have a dead R, RP, 250D mainboard (e.g. after camera repair) and want to donate for experiments, I'll cover shipping costs.

vastunghia

Quote from: iaburn on February 09, 2024, 12:09:04 PMYou are right that it will be better without dual ISO, but I wouldn't say that the difference will be so important, we'll see ;)
https://www.photonstophotos.net/Charts/PDR.htm#Canon%20EOS%20200D,Canon%20EOS%206D(ML),Canon%20EOS%207D(ML)


But why are you charting standard 200D vs Dual-ISO-enabled 6D and 7D?

Check this comparison of 200D with a bunch of ML-capable cams. 200D stems out at ISO 100.
5D3 for video
70D for photo

iaburn

Quote from: vastunghia on March 07, 2024, 09:47:21 PMBut why are you charting standard 200D vs Dual-ISO-enabled 6D and 7D?

Check this comparison of 200D with a bunch of ML-capable cams. 200D stems out at ISO 100.

I did it to compare the maximum dynamic range achievable with magic lantern, because 200D is basically ISO invariant and wouldn't benefit from dual ISO, but the older cams do

names_are_hard

Quote from: iaburn on March 08, 2024, 10:54:46 PMI did it to compare the maximum dynamic range achievable with magic lantern, because 200D is basically ISO invariant and wouldn't benefit from dual ISO, but the older cams do

I have a 200D.  What's the evidence that it's "ISO invariant"?  How would I measure this, and how would I measure dual ISO performance?

I have dual ISO working on 200D but don't know that much about photography, being more of a dev, so don't know how to test the results.

iaburn

Quote from: names_are_hard on March 09, 2024, 12:25:08 AMI have a 200D.  What's the evidence that it's "ISO invariant"?  How would I measure this, and how would I measure dual ISO performance?

I have dual ISO working on 200D but don't know that much about photography, being more of a dev, so don't know how to test the results.

In this web you can check the shadow noise improvement when you rise ISO vs just adjusting exposure in post for some cameras. The flatter the curve, the more ISO invariant.

names_are_hard

Thanks, but that doesn't really mean anything to me, and doesn't explain how I could test what difference dual ISO makes.

iaburn

Quote from: names_are_hard on March 09, 2024, 01:24:45 AMThanks, but that doesn't really mean anything to me, and doesn't explain how I could test what difference dual ISO makes.

For testing what I do is framing a scene where half of the frame is a window with the sun shining outside and different illuminated parts (I have trees with shadows, houses...), and the other half is the much darker interior of my house, where I place objects with textures and colors.

Then I adjust the exposure to preserve most of the highlights at base ISO, and record clips without dual ISO, and with dual ISO on different combinations (i.e. 100/200, 100/400, etc.).

Finally in MLVApp I adjust every clip to have the same exposure, recover the shadows to the max, and visually compare the improvement in shadow details at different settings.

I saw some software that can tell the dynamic range based on numbers, but I care more about visible differences.

I'm a dual ISO lover, did this test with all my cameras one day and it was a great surprise to see the EOS M with dual ISO 100/1600 having visually the same dynamic range as the BMPCC original :o

names_are_hard

Thanks, that I can try and copy :)  Won't be for a while though, got a bunch of tasks queued up.

iaburn

Quote from: names_are_hard on March 09, 2024, 09:54:16 PMThanks, that I can try and copy :)  Won't be for a while though, got a bunch of tasks queued up.
I'm curious to see if there is a visible gain or not with dual ISO on the 200D  :D