Skip to content

Layout

Binary format parsing: file header, flight metadata, and auxiliary blocks.

Prefix

Prefix dataclass

Prefix(_detail_offset: int, version: int)

Log file header containing version and offset information.

Binary layout (100 bytes, little-endian)::

detail_offset : u64
detail_length : u16
version       : u8
unknown       : u8
encrypt_magic : u64
reserved      : [u8; 80]

from_bytes classmethod

from_bytes(data: bytes) -> Prefix

Parse prefix from the first 100 bytes of a log file.

recover_detail_offset

recover_detail_offset(offset: int) -> None

Override detail_offset (used for v13+ when original is zero).

detail_offset

detail_offset() -> int

Byte offset where the details/auxiliary section starts.

records_offset

records_offset() -> int

Byte offset where records begin.

records_end_offset

records_end_offset(file_size: int) -> int

Byte offset where records end.

Details

Details dataclass

Details(sub_street: str = '', street: str = '', city: str = '', area: str = '', is_favorite: bool = False, is_new: bool = False, needs_upload: bool = False, record_line_count: int = 0, detail_info_checksum: int = 0, start_time: datetime = (lambda: datetime(1970, 1, 1, tzinfo=(timezone.utc)))(), longitude: float = 0.0, latitude: float = 0.0, total_distance: float = 0.0, total_time: float = 0.0, max_height: float = 0.0, max_horizontal_speed: float = 0.0, max_vertical_speed: float = 0.0, capture_num: int = 0, video_time: int = 0, moment_pic_longitude: list[float] = (lambda: [0.0] * 4)(), moment_pic_latitude: list[float] = (lambda: [0.0] * 4)(), take_off_altitude: float = 0.0, product_type: ProductType = ProductType.NONE, aircraft_name: str = '', aircraft_sn: str = '', camera_sn: str = '', rc_sn: str = '', battery_sn: str = '', app_platform: Platform = (lambda: Platform(0))(), app_version: str = '')

Flight metadata parsed from the log Details header block.

These values are written by the DJI app at the end of a flight and are available without decryption. Most are reliable; total_distance, capture_num, and video_time are notable exceptions — see their field notes below.

total_distance Converted from the binary header (stored as kilometres, exposed here in metres). Reasonably accurate in most logs — verified against frame-computed cumulative_distance across 440+ flights with a consistent 1:1 ratio. A small number of logs carry stale or cumulative values from previous flights. The DJI C++ reference library ignores this field and recomputes from the GPS track, so prefer FrameOSD.cumulative_distance from the last decoded frame when decrypted records are available.

capture_num As stored in the binary header. The DJI Fly app does not populate this field — it is always 0 across all tested aircraft (Mavic Air 2, Mini 4 Pro). Per-frame photo events are available via FrameCamera.is_photo in the decrypted record stream.

video_time Raw value from the binary header. This is not the per-flight recording duration — the ratio to actual in-frame recording time ranges from 1x to over 100x with no consistent unit. The DJI C++ reference library does not use it. Per-frame recording state is available via FrameCamera.is_video in the decrypted record stream.

from_bytes classmethod

from_bytes(data: bytes, version: int) -> Details

Parse a Details block from data according to log version.

ProductType

ProductType

Bases: IntEnum

DJI aircraft product types.

battery_cell_num property

battery_cell_num: int

Number of cells per battery for this product type.

battery_num property

battery_num: int

Number of batteries for this product type.

Platform

Platform

Bases: IntEnum

App platform that recorded the log.

AuxiliaryInfo

AuxiliaryInfo dataclass

AuxiliaryInfo(version_data: int, info_data: bytes, signature_data: bytes)

Auxiliary Info block (magic 0): contains XOR-encrypted Details data.

from_bytes classmethod

from_bytes(data: bytes) -> AuxiliaryInfo

Parse from XOR-decoded bytes.

AuxiliaryVersion

AuxiliaryVersion dataclass

AuxiliaryVersion(version: int, department: Department)

Auxiliary Version block (magic 1): department and version metadata.

from_bytes classmethod

from_bytes(data: bytes) -> AuxiliaryVersion

Parse version block from raw bytes.

Department

Department

Bases: IntEnum

DJI department that produced the log.