The Definitive [Xiaomi Yi RAW] Guide

Discussion in 'Yi Action Camera' started by schnurbi, Jul 31, 2015.

  1. fufu74

    fufu74 New Member

    Messages:
    1
    Likes Received:
    0
    Country:
    France
    Same issue for me
     
  2. Pol Leke

    Pol Leke New Member

    Messages:
    1
    Likes Received:
    0
    Location:
    Steenbergen
    Country:
    Netherlands
    Dash Cam:
    Xiaomi Yi (SN: Z22L)
    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: Oct 29, 2016
  3. am777

    am777 New Member

    Messages:
    1
    Likes Received:
    0
    Country:
    Germany
    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.
     
  4. plre

    plre New Member

    Messages:
    4
    Likes Received:
    1
    Country:
    Russian Federation
    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: Apr 4, 2017
    jokiin likes this.
  5. plre

    plre New Member

    Messages:
    4
    Likes Received:
    1
    Country:
    Russian Federation
    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
     
  6. plre

    plre New Member

    Messages:
    4
    Likes Received:
    1
    Country:
    Russian Federation
    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.
     
Loading...

Share This Page