A library / cli for parsing DJI txt logs
- Supports all log versions and encryptions
- Parse records and extract embedded images
- Export flight tracks to GeoJSON and KML
Starting with version 13, log records are AES encrypted and require a specific keychain for decryption. This keychain must be obtained from DJI using their API. An apiKey is necessary to access the DJI API.
To acquire an apiKey, follow these steps:
- Visit DJI Developer Technologies and log in.
- Click
CREATE APP
, chooseOpen API
as the App Type, and provide the necessary details likeApp Name
,Category
, andDescription
. - After creating the app, activate it through the link sent to your email.
- On your developer user page, find your app's details to retrieve the ApiKey (labeled as the SDK key).
Download binary from latest release
dji-log DJIFlightRecord_YYYY-MM-DD_\[00-00-00\].txt --api-key __DJI_API_KEY__ > records.json
or with an output arg
dji-log DJIFlightRecord_YYYY-MM-DD_\[00-00-00\].txt --api-key __DJI_API_KEY__ --output records.json
Use %d
in the images or thumbnails option to specify a sequence.
dji-log DJIFlightRecord_YYYY-MM-DD_\[00-00-00\].txt --api-key __DJI_API_KEY__ --images image%d.jpeg --thumbnails thumbnail%d.jpeg --output records.json
dji-log DJIFlightRecord_YYYY-MM-DD_\[00-00-00\].txt --api-key __DJI_API_KEY__ --kml track.kml --output records.json
dji-log DJIFlightRecord_YYYY-MM-DD_\[00-00-00\].txt --api-key __DJI_API_KEY__ --geojson track.json --output records.json
Initialize a DJILog
instance from a byte slice to access version information and metadata:
let parser = DJILog::from_bytes(&bytes).unwrap();
println!("Version: {:?}", parser.version);
println!("Info: {:?}", parser.info);
Decrypt records based on the log file version. For versions prior to 13:
let records = parser.records(DecryptMethod::None);
For version 13 and later:
let records = parser.records(DecryptMethod::ApiKey("__DJI_API_KEY__"));
For scenarios like caching, offline use, or custom server communication, the library exposes the internal keychain retrieval process:
let keychain_request = parser.keychain_request().unwrap();
let keychains = keychain_request.fetch("__DJI_API_KEY__").unwrap();
let records = parser.records(DecryptMethod::Keychains(keychains));
Note: Replace __DJI_API_KEY__
with your actual apiKey
For more information, including a more detailed overview of the log format, visit the documentation.
dji-log-parser is available under the MIT license. See the LICENSE.txt file for more info.