Raw Burst on the 50D

Started by smeangol, May 18, 2013, 12:55:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

smeangol

Since the 50D got a CF Interface, it is a interesting partner for upcoming raw video :)
www.smeangol.com/autoexec.bin - NOW new with RAW Video!

To enable you need to copy [Modules]
http://www.smeangol.com/MODULES.zip
to your ML directory on your CF card -
Then go to the ML menu .. at the Top are the different categories .. like movie , debug, etc .. on the right side there will be a "M" .. go there and activate the "modules" -
Then go to the movie menu ..you will have to scroll down until you see new entries. Have fun!

Andy600

Have you shot with it? Interested to see what the DNGs look like and how many you get
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

nanomad

submit a pull request or post a patch so that  I can merge your code into the main repository :)
EOS 1100D | EOS 650 (No, I didn't forget the D) | Ye Olde Canon EF Lenses ('87): 50 f/1.8 - 28 f/2.8 - 70-210 f/4 | EF-S 18-55 f/3.5-5.6 | Metz 36 AF-5

a1ex

Patch here. Needs some cleanup, since 50D does not support display filters.


diff -r 33e2dcdef271 modules/raw_rec/Makefile
--- a/modules/raw_rec/Makefile Fri May 17 19:17:25 2013 +0300
+++ b/modules/raw_rec/Makefile Sat May 18 07:53:44 2013 +0100
@@ -6,6 +6,7 @@
MODULE_NAME=raw_rec
MODULE_OBJS=raw_rec.o

+
# include make environment
include $(TOP_DIR)/Makefile.top
include $(TOP_DIR)/Makefile.inc
diff -r 33e2dcdef271 platform/50D.109/Makefile
--- a/platform/50D.109/Makefile Fri May 17 19:17:25 2013 +0300
+++ b/platform/50D.109/Makefile Sat May 18 07:53:44 2013 +0100
@@ -63,6 +63,9 @@
beep.o \
vsync-lite.o \
afma.o \
+ raw.o \
+ chdk-dng.o \
+

#include generic rules and definitions
#TOP_DIR defined in upper Makefile
diff -r 33e2dcdef271 platform/50D.109/features.h
--- a/platform/50D.109/features.h Fri May 17 19:17:25 2013 +0300
+++ b/platform/50D.109/features.h Sat May 18 07:53:44 2013 +0100
@@ -3,6 +3,12 @@
// 50D movie hacks
#define FEATURE_MOVIE_RECORDING_50D
#define FEATURE_MOVIE_RECORDING_50D_SHUTTER_HACK
+#define FEATURE_RAW_ZEBRAS
+#define FEATURE_RAW_HISTOGRAM
+#define FEATURE_RAW_SPOTMETER
+// silent pic
+#define FEATURE_SILENT_PIC_RAW_BURST
+//#define FEATURE_SILENT_PIC_RAW  ---> Set Burst or single not both! 
//~ #define FEATURE_LVAE_EXPO_LOCK // unreliable, and we have full manual controls now

// no audio at all
diff -r 33e2dcdef271 platform/50D.109/internals.h
--- a/platform/50D.109/internals.h Fri May 17 19:17:25 2013 +0300
+++ b/platform/50D.109/internals.h Sat May 18 07:53:44 2013 +0100
@@ -113,3 +113,6 @@

/** We can record movies in regular photo modes - M, P, Tv, Av... */
#define CONFIG_NO_DEDICATED_MOVIE_MODE
+
+
+/** Here comes the sun! ... raw video .. not yet*/
diff -r 33e2dcdef271 src/raw.c
--- a/src/raw.c Fri May 17 19:17:25 2013 +0300
+++ b/src/raw.c Sat May 18 07:53:44 2013 +0100
@@ -24,7 +24,7 @@
  * To find it, call("lv_save_raw") and look for an EDMAC channel that becomes active (Debug menu)
  **/

-#if defined(CONFIG_5D2) || defined(CONFIG_600D)
+#if defined(CONFIG_5D2) || defined(CONFIG_600D) || defined(CONFIG_50D)
#define RAW_LV_EDMAC 0xC0F04508
#endif

@@ -33,6 +33,8 @@
#define RAW_LV_EDMAC 0xC0F26208
#endif

+
+
/**
  * Photo-mode raw buffer address
  * On old cameras, it can be intercepted from SDSf3 state object, right after sdsMem1toRAWcompress.
@@ -50,6 +52,10 @@
#define RAW_PHOTO_EDMAC 0xc0f04808
#endif

+#if defined(CONFIG_50D)
+#define RAW_PHOTO_EDMAC 0xc0f04A08 // definetly false, has to be found :)
+#endif
+
static uint32_t raw_buffer_photo = 0;

/* called from state-object.c, SDSf3 or SSS state */
@@ -133,6 +139,15 @@
      -975, 10000,     2039, 10000,    6148, 10000
#endif

+#ifdef CONFIG_50D // not found yet
+    //~{ "Canon EOS 50D", 0, 0x3d93,
+ //~{ 4920,616,-593,-6493,13964,2784,-1774,3178,7005 } },
+    #define CAM_COLORMATRIX1                       \
+     4920, 10000,      616, 10000,    -593, 10000, \
+    -6493, 10000,    12964, 10000,    2784, 10000, \
+    -1774, 10000,     3178, 10000,    7005, 10000
+#endif
+
struct raw_info raw_info = {
     .api_version = 1,
     .bits_per_pixel = 14,
@@ -230,6 +245,13 @@
         skip_right  = 0;
         skip_bottom = 1;
         #endif
+
+ #ifdef CONFIG_50D
+        skip_top    = 22;
+        skip_left   = 72;
+        skip_right  = 0;
+        skip_bottom = 0;
+        #endif
         
         dbg_printf("LV raw buffer: %x (%dx%d)\n", raw_info.buffer, width, height);
         dbg_printf("Skip left:%d right:%d top:%d bottom:%d\n", skip_left, skip_right, skip_top, skip_bottom);
@@ -338,6 +360,10 @@
     #ifdef CONFIG_6D
     int dynamic_ranges[] = {1143, 1139, 1122, 1087, 1044, 976, 894, 797, 683, 624, 505};
     #endif
+
+ #ifdef CONFIG_50D
+    int dynamic_ranges[] = {1140, 1106, 1051, 965, 872, 772, 679};
+    #endif

     #ifdef CONFIG_600D
     int dynamic_ranges[] = {1146, 1139, 1116, 1061, 980, 898, 806, 728};
@@ -350,6 +376,8 @@
     #ifdef CONFIG_EOSM
     int dynamic_ranges[] = {1121, 1124, 1098, 1043, 962, 892, 779, 683, 597};
     #endif
+
+

/*********************** Portable code ****************************************/

diff -r 33e2dcdef271 src/shoot.c
--- a/src/shoot.c Fri May 17 19:17:25 2013 +0300
+++ b/src/shoot.c Sat May 18 07:53:44 2013 +0100
@@ -1876,14 +1876,15 @@
         display_filter_get_buffers(&src_buf, &dst_buf);
         memset(dst_buf, 0, vram_lv.height * vram_lv.pitch);
         memset(sp_frames[0], 0, raw_info.frame_size);
-        silent_pic_display_buf = CACHEABLE(dst_buf);
-    }
-}
+        //silent_pic_display_buf = CACHEABLE(dst_buf); // deactivated for 50D testing
+    }
+}
+/* // deactivated for 50D testing
static void silent_pic_raw_update_preview()
{
     if (!silent_pic_display_buf) return;

-    /* try to preview the last completed frame; if there isn't any, use the first frame */
+    // try to preview the last completed frame; if there isn't any, use the first frame
     void* raw_buf = sp_frames[MAX(0,sp_num_frames-2) % sp_buffer_count];
     static int first_line = 0;
     int last_line;
@@ -1892,13 +1893,13 @@
     {
         last_line = RAW2LV_Y(sp_slitscan_line);
         if (first_line > last_line) first_line = BM2LV_Y(os.y0);
-        ultra_fast = 0; /* since we only refresh a few lines at a time, we can use better quality */
+        ultra_fast = 0; // since we only refresh a few lines at a time, we can use better quality
     }
     else
     {
         first_line = BM2LV_Y(os.y0);
         last_line = BM2LV_Y(os.y_max);
-        ultra_fast = 1; /* we have to refresh complete frames, so we'll sacrifice quality to gain some speed */
+        ultra_fast = 1; // we have to refresh complete frames, so we'll sacrifice quality to gain some speed
     }
     
     if (silent_pic_mode == SILENT_PIC_MODE_BEST_SHOTS)
@@ -1910,7 +1911,7 @@
     
     raw_preview_fast_ex(raw_buf, silent_pic_display_buf, first_line, last_line, ultra_fast);
}
-
+*/
static int silent_pic_raw_prepare_buffers(struct memSuite * hSuite)
{
     /* we'll look for contiguous blocks equal to raw_info.frame_size */
@@ -8261,5 +8262,4 @@
         }
     }
#endif
-}
-
+}

CFP

Quote from: Andy600 on May 19, 2013, 07:19:16 PMHave you shot with it? Interested to see what the DNGs look like and how many you get
Me too. Once raw_rec will be available for the 50D it might become the cheapest camera that can record RAW video with high resolutions.

But wait, how fast is it? Has anybody run a benchmark already? Doesn't the 50D has something like a 40 Megaybte/s write speed limit? (I am not sure where I read that ...)

Hopefully the 70D will take CF cards again ...  ;D

Andy600

I read it's UDMA 6 - 133MB/s. Plenty fast enough and has a big buffer too
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

smeangol

Here you are:

www.smeangol.com/50Dsilentraw_normal.DNG - RAW taken when not zoomed in in LV (X5 X10) - 59 pics until buffer is full
www.smeangol.com/50Dsilentraw_Zoomed.DNG - RAW taken when zoomed in in LV (X5 X10) - 53 pics until buffer is full


Andy600

Thanks :) That's interesting. At closest file size and dimensions on my 600d (1734*1156 - 3.76mb) I'm getting just under half the amount of frames (26). This looks very promising. Are you able to benchmark your CF card?

I'm even more tempted to pick up a 50d now ::)

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

smeangol

QuoteAre you able to benchmark your CF card?
With RAW silent picture - the buffer is just filled up, the recording happens afterwards - so CF Card speed wont affect the number of possible frames :) The cF Card i use is really slow .. maybe 15MB/s ;-)

The 50D is some nice piece of camera ;-)   

Andy600

It sounds great. If the maths add up there won't be much of a bottleneck and I reckon it will be matching the 5d MkII at least and possibly even better. Are you developing for it? If not maybe the devs need to get one.
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

1%

Look in debug menu -> memory. What is total shoot malloc size?

Andy600

I'll hazard a guess at 180+  ;D

Are you thinking of getting one 1%?
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

1%

Last time I looked at 50D it wasn't cheap. I have 3 bodies to support now, better off making what I have better. 50D always seemed shafted for video so would be cool if its got lots of memory and can make raw like 5d3.

Would also be nice to compare memory on all cameras, I think that's somewhere.

ilguercio

I still got mine, is the raw feature in the latest nightly?
Canon EOS 6D, 60D, 50D.
Sigma 70-200 EX OS HSM, Sigma 70-200 Apo EX HSM, Samyang 14 2.8, Samyang 35 1.4, Samyang 85 1.4.
Proud supporter of Magic Lantern.

1%

Add the patch to the tree and try it.

smeangol

QuoteLook in debug menu -> memory. What is total shoot malloc size?

220M - how much the 5Dmk2 and the 5Dmk3 got?
With the patch - it can do the raw silent single and burst thing only.
Anyone wants to continue the port?
Is there a tutorial how to port the raw_video feature?
When i want to "make" "raw_rec" i get this message:

$ make
[ CC       ]   raw_rec.o
raw_rec.c:20:20: fatal error: module.h: No such file or directory
compilation terminated.
/home/Maximilian/magic-lantern/modules/raw_rec/../../Makefile.inc:756: recipe for target `raw_rec.o' failed
make: *** [raw_rec.o] Error 1






tihon

Ok... Can it rec 24 fps 1080p?
Cinema, cinema, cinema

cobyalon

sorry for the stupid question but, 50D does not have a video rec, so assuming it'll do uncompressed raw video we'd be able to watch the frames on the LV? i mean while recording..


smeangol

The 50D can shoot 1080p at 30p, thanks to ML - the features was implemented by Canon, but absent in the menu.
So the 50D got everything on board.
With FPS override you can bring it down to 24p.

cobyalon

well i have the 60D. but if the 50D shoot 1080p 24fps raw (thanks to ML of course) i definitely will pick up one :)
great work and thanks again ML team for everything you do

a1ex

According to the samples, max resolution on 50D is 1592x1062 in 1x mode and 1992x1080 in crop mode. Not bad.

tihon

Quote from: a1ex on May 20, 2013, 10:49:03 AM
According to the samples, max resolution on 50D is 1592x1062 in 1x mode and 1992x1080 in crop mode. Not bad.

50d  is 1.6 crop. with crop mode to 1992 average crop would be about x2?)

in  1992x1080 crop mode the noise would be upscaled too?
Cinema, cinema, cinema

Andy600

@A1ex - If I get one and can compile (not develop) will it give me raw video capability from the unified build? I was gonna save for a 5d mkIII but I can put that on hold and help with this... although I'm not a programmer.

Update: I guess I'm gonna have to learn a bit more. Just bit the bullet and picked one up w/battery grip and a few accesories for 200 euros. Should be here Wednesday. I thought, if nothing else, it gives me another body to play with :)
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

menoc

Guys, according to firmware update 1.0.9 the 50D supports UDMA 7. Correct me if I'm wrong 'cause I'm about to get a KomputerBay 64gb 1000x . . . .

Andy600

It can use UDMA 7 cards but it's still UDMA 6. The firmware just fixed a compatibility problem with 1000x UDMA CF cards. You will still only get max UDMA 6 speed
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