-- a1ex, september-november 2018
By default, the 5D Mark IV saves an unusual kind of Bayer data from LiveView - smaller size and with many artifacts. A closer look reveals what they actually are - Dual Pixel RAW frames from LiveView!
Let's decode them.
Background:
lv_raw_dump (after lv_save_raw) saves a file named 46201988.RAW
.
%%shell
wget -c -q https://a1ex.magiclantern.fm/bleeding-edge/5D4/dual-pixel/kichetof/46201988.RAW
wget -c -q https://a1ex.magiclantern.fm/bleeding-edge/5D4/dual-pixel/kichetof/DEBUGMSG.LOG
%%shell
xxd -l 128 46201988.RAW; xxd -o 0x100000 -l 128 46201988.RAW
Smells like 16-bit data.
Let's fire up Octave (4.x with 16-bit image support) to have a closer look.
f = fopen("46201988.RAW");
x = fread(f, "uint16");
fclose(f);
size(x)
From the log file, we'll look for the output of this code snippet, to find out the image size:
#ifdef CONFIG_5D4 /* 1.0.4 */
DryosDebugMsg(0, 15, "Raw buffer size: %d x %d", MEM(0x133FC), MEM(0x13400));
DryosDebugMsg(0, 15, "FPS timer B: %d", MEM(0x12D10));
#endif
%%shell
cat DEBUGMSG.LOG | grep "Raw buffer size" -C 1
x = reshape(x, [1824 774])';
imshow(x, []);