The Definitive [Xiaomi Yi RAW] Guide

I am totaly stuck on this.
I can make RAW photos with my Yi, but i can't convert them to DNG files.
Every time i get the ERROR: unsupported format. :mad:
What am i doing wrong? :(
I'm using the Ximode scripts from XS-Sol site.

EDIT: oct 29............... nobody?????????
 
Last edited:
I am totaly stuck on this.
I can make RAW photos with my Yi, but i can't convert them to DNG files.
Every time i get the ERROR: unsupported format. :mad:
What am i doing wrong? :(
I'm using the Ximode scripts from XS-Sol site.

EDIT: oct 29............... nobody?????????

I had the same "unsupported format" error when converting with raw2dng . A factory reset of the cam via Xiaomi App solved this. Afterwards the script produces 30 MB raw files instead of 13 MB raws and convertig is working again.
 
I tried to decompress 13M RAW files with DPCM 8-10, DPCM 8-12, RLE and A-Law... no go :(
I'm struck because of some oddities I'm noticing. The IMX206 sensors send RAW10 or RAW12 (or DPCM 10-8) datas to the A7LS. So is the compression done by the image processing DSP and not by the sensor? And why in the TXT of pictures took with "t cal -raw" I can read "system.raw_resolution 14"? Why 14? And why a row lenght of 3904? (moreover, I suspect that the last 20 bytes of every line contains some information and not RGGB values). The compression is surely row by row.

Have you tried DPCM 12-7-12 scheme as defined by the MIPI CSI-2 draft? The spec states that it provides about 42% percent bit rate reduction (so it should provide about the same reduction in file size IMO).

After inspecting compressed and uncompressed RAWs more closely, it is easy to notice one peculiar detail: compressed RAWs are 43.51% smaller in size, than an uncompressed RAW would be, if it would store 12 bits per pixel in a tightly packed manner (and not sparse 16 bits).

The math behind this is really simple:
Each image has 15925248 pixels.
The spec for the IMX206 sensor states, that max data output is 12bit, so raw data (really raw, straight from the DAC, or just stored in packed format) would be 15925248 * 12 / 8, or 23887872 bytes.
And compressed RAW files have the size of 13492224 bytes, which is 43% lower.

This might be a long shot, but it's worth a try. I'll try to verify this, but no promises.
 
Last edited:
No luck so far.

Assuming that the encoding is done line by line, the length of each encoded line should be 3904 bytes. However, for 7-byte encoding, it must be 4032 bytes. 3904-byte length gives 6.78 bits per pixel, so
- either this is not DPCM
- there is an additional compression step

I've also has been able to find evidence, that the camera firmware uses only following DPCM modes:
- 12-8-12
- 10-8-12
 
No actual success, just thought I'd share the (likely final) update. The compression seems to be 6.75 bits per pixel, which (most likely) corresponds to a Huffman shift coding with dictionary size of 16. Without either analyzing the source code or reverse-engineering the firmware, trying to guess the data structure inside that 13M binary blob doesn't seem like a promising prospect.
 
Hi guys,
Yes, I know it's a kind of of archeo, but....................

Since last 8 months I'am using Yi Control Script Pro app, and all problems has dissappeard.
This app is really helpfull, gives a lot of possibilities to create (almost) any script and very easy to use......

regards,
massud
 
Back
Top