Author Topic: 12-bit (and 10-bit) RAW video development discussion  (Read 470900 times)

reddeercity

  • Contributor
  • Hero Member
  • *****
  • Posts: 2045
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #625 on: December 02, 2016, 07:17:17 AM »
I can confirm on 5D2 1880 does work in all bit ranges , of course it's only stable/uncorrupted in 14bit
10 , 12 have issue of course but liveview never froze up . I didn't have time today to recompile
the 10_12bit expermential branch so I tested out dfort build as it seem to be update .
Set liveview to Auto , FYI . I made 3 short 20 second test videos (h264) from 10 ,12 ,14 bit
in my Dropbox  https://www.dropbox.com/sh/lh5lxr74moyrnj5/AAAFDzHGYxoafVLWkX71R5R0a?dl=0
you can there download (50MB each) or watch them in dropbox
Beware ! 10 & 12 bit may made you sea sick  :P

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3715
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #626 on: December 02, 2016, 08:58:20 AM »
@reddeercity

Are you using mlv_rec or raw_rec (MLV Lite)? I've gotten better results on the EOSM from raw_rec.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12241
  • Maintenance mode
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #627 on: December 02, 2016, 11:02:55 AM »
Did some changes to raw_rec (mlv lite), not really related to bit depth, but since this became the "de facto" bleeding edge branch for raw recording, I've merged them. The functional ones are:

- fix for this issue (may affect recording times if - and only if - global draw is on).

- a change borrowed from mlv_rec (async edmac calls) that might help with general frame corruption issues (that already happen in unified in some edge cases); it will not help with frame corruptions related by bit depth changes.

Currently benchmarking these changes; will post results here.

For new builds, I recommend including only those cameras that can record without corrupted frames, at least at some settings. For the cameras that show corruption every other frame, the behavior will be unchanged. I know the cause and already suggested possible fixes a month ago. Until somebody implements one of these fixes (hint: see how it was done on EOS M), reports of image corruption (repeated for every new build), for those models that are already known not to work, are simply not useful.

Peter Linov

  • New to the forum
  • *
  • Posts: 23
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #628 on: December 02, 2016, 11:35:27 AM »
5DMIII 1.2.3 
CRASH 00-
ASSERT: hLvJob->hJpegMemSuiteat ./Epp/Vram/VramStage.c:891, task Epplv:1 mode:3
Magic Lantern version : Nightly.2016Dec01.5D3123 Mercurial changeset   
: 385bc44ed158+b3dfbe7194f3+ (5D3-113_123_10bit_12bit) tip
Built on 2016-12-01 23:09:48 UTC by rosiefort@RosieFoComputer.
Free Memory  : 146K + 3712K
CRASH01-
ASSERT: IsSuiteSignature( hSuite ) at ./PackMemory/PackMem.c:599, task Epp
lv:0 mode:3Magic Lantern version : Nightly.2016Dec01.5D3123
Mercurial changeset   : 385bc44ed158+b3dfbe7194f3+ (5D3-113_123_10bit_12bit) tip
Built on 2016-12-01 23:09:48 UTC by rosiefort@RosieFoComputer.
Free Memory  : 146K + 3728K
CRASH02-
ASSERT: hLvJob->hJpegMemSuiteat ./Epp/Vram/VramStage.c:891, task Epp
lv:1 mode:3 Magic Lantern version : Nightly.2016Dec01.5D3123
Mercurial changeset   : 385bc44ed158+b3dfbe7194f3+ (5D3-113_123_10bit_12bit) tip
Built on 2016-12-01 23:09:48 UTC by rosiefort@RosieFoComputer.
Free Memory  : 153K + 3719K



dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3715
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #629 on: December 02, 2016, 04:10:40 PM »
@Peter_Linov

Didn't think it was going to work but it was worth a shot. What were the conditions that caused the crash?

Looks like for now we should limit the test builds to the 5D3.113 and EOSM.202 and make sure we're in raw_rec instead of mlv_rec. These test builds don't have the mlv_rec and mlv_snd modules to avoid confusion.

https://bitbucket.org/daniel_fort/magic-lantern/downloads/magiclantern-10bit_12bit_raw_twk_crop_rec.2016Dec01.5D3113.zip
https://bitbucket.org/daniel_fort/magic-lantern/downloads/magiclantern-10bit_12bit_raw_twk_crop_rec.2016Dec01.EOSM202.zip
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

teatotalTED

  • New to the forum
  • *
  • Posts: 35
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #630 on: December 02, 2016, 06:35:17 PM »
The 550D is also very close, 12bit works fine, 10bit image intact just 16 pixel offset to right every other frame, (mlvrec not rawrec which looks to be a trainrec on the 550D)

A1ex suggests above that there's a fix for this from a month ago or should this be brought up on the 550D camera specific thread instead of here where priorities seem weighted elsewhere, I guess because of ownership of EOS-M & 5D3? There's many more 550D ML users than EOS-M and for good reason?

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 3171
  • 5D3 / M1 / 7D / 70D / SL1 / M2
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #631 on: December 02, 2016, 06:42:04 PM »
... There's many more 550D ML users than EOS-M and for good reason?

I'd take an EOSM over 550D on any given day and no pun intended.
5D3.113 • 5D3.123 • EOSM.203 • 7D.203 • 70D.112 • 100D.101 • EOSM2.*

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3715
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #632 on: December 02, 2016, 07:26:00 PM »
The 550D is also very close...

I didn't know that. Here's a test build for the 550D without mlv_rec and mlv_snd like the other test builds I recently posted.

https://bitbucket.org/daniel_fort/magic-lantern/downloads/magiclantern-10bit_12bit_raw_twk_crop_rec.2016Dec01.550D109.zip
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

hammermina

  • New to the forum
  • *
  • Posts: 46
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #633 on: December 02, 2016, 08:58:35 PM »
@dfort

550d build works :)12 bit all resolutions :) :)
10 bit frames are messed up...

go for it :)

teatotalTED

  • New to the forum
  • *
  • Posts: 35
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #634 on: December 02, 2016, 09:08:26 PM »
12bit worked great via mlvrec in dforts build from before, so 12bit now works in rawrec to.

10bit in rawrec is vertically jumping up and down 16 pixels every other frame rather than moving to the right 16 pixels every other frame as with the mlvrec module from dforts earlier build.

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3715
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #635 on: December 02, 2016, 10:29:12 PM »
@teatotalTED

Actually it is the same build. What you are reporting is the difference between mlv_rec and raw_rec (MLV Lite).
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

reddeercity

  • Contributor
  • Hero Member
  • *****
  • Posts: 2045
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #636 on: December 03, 2016, 04:08:42 AM »
@reddeercity
Are you using mlv_rec or raw_rec (MLV Lite)? I've gotten better results on the EOSM from raw_rec.
raw_rec (mlv lite) actually it's getting better on 5D2  , 10bit used to be totally pink noise & 12bit ever other frame was totally pink noise.
But ever once in a while I have perfect recording + clean liveview mostly in Crop mode . I would say crop mode on 5d2 is more stable right now .

teatotalTED

  • New to the forum
  • *
  • Posts: 35
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #637 on: December 03, 2016, 07:20:48 AM »
The same build? As yours from yesterday posted at 12.08:58? How can it be the latest doesn't have mlvrec and mlvsnd in it? Might be same code base but a new build? 12bit on 550D worked fine on yesterdays build of 12.08:58 via mlvrec, all I was saying was that 12bit working on 550D was nothing new to the latest rawrec only build. And finally yes I was comparing 12.08:58 build 10bit 550D via mlvrec 16 pixel shift horizontal with latest rawrec only build 10bit 16 pixel shift vertical, both very close to solution for 550D, so to first say only concentrate on EOS-M and 5D3, then say only concentrate on rawrec, with regard to 550D either which way makes little difference its so close. Does the latest rawrec build include possible fix highlighted by A1ex in post #627, is that what we're supposed to be testing here in the latest build?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12241
  • Maintenance mode
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #638 on: December 03, 2016, 10:10:02 AM »
That's a race condition working in your favor :)

The process is very sensitive to timing, and will be so until the real issue is addressed. The DMA channel is configured for 14-bit image size, we only copy 12-bit (or 10-bit) data from it, and what happens with the excess data... Canon knows. That's the cause of the artifacts you describe. It is a random process, as the LiveView timings are not very exact (I think the image capture is done at fixed intervals, but the processing timing is affected by the task scheduler, to some extent).

So, just because it works for you in some (lucky) conditions, that doesn't mean it's getting any closer.

teatotalTED

  • New to the forum
  • *
  • Posts: 35
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #639 on: December 03, 2016, 10:55:11 AM »
Yeah anticipated the response to presumption of 'so close', in reality I'm well aware it ain't that simple, just would like to see 550D in the running, 10bit on cameras with restricted write speeds is a good priority to many users, for me my 50D is go to and barely use the 550D. Lucky settings, there's no blackmagic, pun intended, in the combination of settings, just chose mlvrec 10bit and it either works or doesn't, don't consider myself a tester just have bit of time at the moment to mess.

kyrobb

  • Member
  • ***
  • Posts: 131
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #640 on: December 04, 2016, 05:44:28 AM »
Tried out dfort's latest build on the 550D. In 10 bit every second frame is perfect, but in the others only the top 3rd is correct. The bottom 2/3rds are just a repeat of the 1st frame I believe. Liveview still works great and the record times are awesome!

zcream

  • New to the forum
  • *
  • Posts: 40
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #641 on: December 04, 2016, 11:10:15 AM »
From Post #22
>>
Reading this: http://francoismalan.com/2011/10/raw-12bit-or-14bit-lossy-or-lossless/
... i guess that it would only make a very very slight difference!

If this is really working... I just dont have words for how awesome this is...
>>

Here is the other argument..
>>
There is a difference between underexposed sunny scene and shooting in pitch dark interiors or at night.

I did the tests myself and 14 bit has huge advantage under extreme dark conditions.

Compression concerns the highlights only and I assume it works the same way for the high-key scenes – white on white.

It’s true, in every-day outdoors shooting, 14bit/uncompressed doesn’t really matter.

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3715
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #642 on: December 04, 2016, 07:12:36 PM »
New test builds:

https://bitbucket.org/daniel_fort/magic-lantern/downloads/magiclantern-raw_video_10bit_12bit.2016Dec04.5D3113.zip
https://bitbucket.org/daniel_fort/magic-lantern/downloads/magiclantern-raw_video_10bit_12bit.2016Dec04.EOSM202.zip

Seems like we may be adding too much into the recent test builds like crop_rec and raw_twk and reporting the results in this topic. How about we test just a few things at a time like raw_rec and mlv_rec and make sure to indicate which one you are using in your reports.

Also, cameras other than the 5D3.113 and EOSM.202 should be updated before making more test builds for those platforms:

For new builds, I recommend including only those cameras that can record without corrupted frames, at least at some settings. For the cameras that show corruption every other frame, the behavior will be unchanged. I know the cause and already suggested possible fixes a month ago. Until somebody implements one of these fixes (hint: see how it was done on EOS M), reports of image corruption (repeated for every new build), for those models that are already known not to work, are simply not useful.
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3715
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #643 on: December 04, 2016, 07:39:02 PM »
Did some more research and it seems that the cameras that have the fewest issues are the ones that have CONFIG_EDMAC_RAW_SLURP. Looks like dmilligan got it working on the EOSM.

According to the features list the 60D and 600D have this feature. Anyone out there want raw_video_10bit_12bit builds of those platforms to test?
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1472
  • 6d - Nightly build user
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #644 on: December 04, 2016, 07:53:11 PM »
I've recorded in 10bit, many times, on the 6d and there are no corrupted frames, both in raw_rec and mlv_rec modules.
Only problem is that liveview freezes (no config_edmac_raw_slurp).
I'm stuck with figuring out how to find the address for the 6d to configure config_edmac_raw_slurp(see few post back in this topic).
http://www.magiclantern.fm/forum/index.php?topic=5601.msg175682#msg175682

But I can assure, that there are no corrupted frames on the 6d with 10bit recording.
Although 12bit has sometimes the purple banding issues on every frame.

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3143
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #645 on: December 04, 2016, 08:59:14 PM »
Only problem is that liveview freezes (no config_edmac_raw_slurp).

disabled raw_twk module?
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

Levas

  • Contributor
  • Hero Member
  • *****
  • Posts: 1472
  • 6d - Nightly build user
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #646 on: December 04, 2016, 09:23:21 PM »
With and without raw_twk enabled, live view freezes during 10bit recording on 6d.
But as far as I know, you need to configure config_raw_edmac_slurp to fix this.
At the moment this only done for 4 cams, 5d3, eosm, 60d and 600d

With 14 bit, live view works like it should be.

dfort

  • Developer
  • Hero Member
  • *****
  • Posts: 3715
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #647 on: December 04, 2016, 10:36:05 PM »
@Levas - I'm trying to do the same with the 700D and seem to be stuck in the same spot you were in a week ago.

I ran find_free_edmac_channels and found that channels 0 and 8 "seems to work" but I have no idea where to find the DEFAULT_RAW_BUFFER MEM address. I've got an EOSM so I'm looking a disassembly of the ROM1.BIN. Found "lv_raw_dump" but don't understand how dmilligan got MEM(0x404E4 + 0x44) out of that.


Code: [Select]
diff --git a/platform/700D.114/internals.h b/platform/700D.114/internals.h
--- a/platform/700D.114/internals.h
+++ b/platform/700D.114/internals.h
@@ -139,3 +139,7 @@
 
 /** Workaround for menu timeout in LiveView */
 #define CONFIG_MENU_TIMEOUT_FIX
+
+/** this method bypasses Canon's lv_save_raw and slurps the raw data directly from connection #0 */
+#define CONFIG_EDMAC_RAW_SLURP
+
diff --git a/src/edmac-memcpy.c b/src/edmac-memcpy.c
--- a/src/edmac-memcpy.c
+++ b/src/edmac-memcpy.c
@@ -396,6 +396,11 @@
 uint32_t raw_write_chan = 4;
 #endif
 
+#ifdef CONFIG_700D
+// channels 0 and 8 "seems to work"
+uint32_t raw_write_chan = 8;
+#endif
+
 #ifdef CONFIG_EOSM
 uint32_t raw_write_chan = 0x12;
 #endif
diff --git a/src/raw.c b/src/raw.c
--- a/src/raw.c
+++ b/src/raw.c
@@ -118,6 +118,11 @@
 #define DEFAULT_RAW_BUFFER MEM(0x404E4 + 0x44)
 #endif
 
+#ifdef CONFIG_700D
+// copied from EOSM -- need to find 700D address
+#define DEFAULT_RAW_BUFFER MEM(0x404E4 + 0x44)
+#endif
+
 #else
 
 /* with Canon lv_save_raw, just read it from EDMAC */

[EDIT] Seems like this was tried before on the 6D:

http://www.magiclantern.fm/forum/index.php?topic=13155.msg127251#msg127251
5D3.* 7D.206 700D.115 EOSM.203 EOSM2.103 M50.102

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3218
  • 60Da / 1100D / EOSM
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #648 on: December 04, 2016, 11:09:53 PM »
At the beginning of lv_raw_dump on the M there is a call made to a function in ram (branch instruction). On 60D this function call is to ROM not RAM. We can use RAM_OFFSET to find the location of that function in rom (Canon firmware copies some functions to RAM and runs them there rather than running them directly from ROM).
Code: [Select]
#define RAM_OFFSET 0xFFA69590

This leads to this function in ROM:
Code: [Select]
FFA7A184: ldr r0, [pc, #808] ; 0xffa7a4b4: pointer to 0x404e4
FFA7A188: ldr r0, [r0, #68] ; 0x44
FFA7A18C: bx lr

This code loads 0x404e4 into register 0, then adds 0x44 to register 0, then it returns (register 0 is the return value). In C:
Code: [Select]
return 0x404e4 + 0x44;

On 60D:
Code: [Select]
FF0F8B8C: ldr r0, [pc, #732] ; 0xff0f8e70: pointer to 0x4ff8 FF25B020 FF25B360 FF25B3A4 FF25AF2C FF25B31C
FF0F8B90: ldr r0, [r0, #48] ; 0x30
FF0F8B94: ldr r0, [r0]
FF0F8B98: bx lr
Which is equivalent to:
Code: [Select]
return *(0x4ff8 + 0x30);

Then lv_raw_dump uses this return value as a pointer to the location of the raw buffer. The ML macro MEM() is simply a pointer dereference. So Canon firmware always keeps a pointer to the location of the raw buffer at 0x404e4 + 0x44 on the EOS M. The actual raw buffer may be dynamically allocated, but it's current address is always kept at memory address 0x404e4 + 0x44 (yes, this is a pointer to a pointer, on 60D, it's actually a pointer to a pointer to a pointer). I guess these buffer addresses are probably kept in static arrays or structs and the + 0x44 part is the array index or struct offset. If it is indeed a data structure, it might be interesting to look at and around 0x404e4 and see what else might be kept there.

capncannabis

  • New to the forum
  • *
  • Posts: 2
Re: 12-bit (and 10-bit) RAW video development discussion
« Reply #649 on: December 05, 2016, 05:17:58 AM »
Is there a build to test this on the 600d?