ExifTool Forum

ExifTool => Newbies => Topic started by: kayasaman on April 11, 2024, 08:33:51 AM

Title: DJI Osmo Action 4 GPS information
Post by: kayasaman on April 11, 2024, 08:33:51 AM
Hi,

I have an Action4 action camera from DJI with the remote controller which provides GPS information which I believe gets embedded into the video file itself rather then using a separate text file to store the data....

At present I have attempted to use the command:

exiftool -p /usr/share/perl-image-exiftool/fmt_files/gpx.fmt -ee  -api largefilesupport=1 -ext MP4 -w %f.gpx .
to extract the information into a GPX file.

Unfortunately there seems to be nothing written in the GPX file other then the standard XML markup.

If I add the -V3 option I get much more output:

Unknown meta format (dbgi)
Track4 Type='meta' Format='dbgi', Sample 51624 of 51642 (7335 bytes)
4019372eb: 12 a4 39 0a a1 39 0a 0a 10 a1 cd cb b9 05 18 d6 [..9..9..........]
4019372fb: 94 03 12 25 08 35 12 21 4f 56 34 38 43 34 30 5f [...%.5.!OV48C40_]
40193730b: 42 49 4e 32 5f 34 30 33 32 5f 33 30 32 34 5f 35 [BIN2_4032_3024_5]
40193731b: 30 30 30 50 5f 43 50 48 59 1a 28 08 4e 12 24 54 [000P_CPHY.(.N.$T]
40193732b: 50 4c 47 5f 4f 56 34 38 43 34 30 5f 56 49 44 45 [PLG_OV48C40_VIDE]
    [snip 7255 bytes]

which by the looks of it seems like the meta information is not supported?


I am just uploading a sample video file right now to my GDrive and will post it here once ready as it will take some time as it's quite large and will post once ready.


Can anything be done in EXIFTool in order to read the output I wonder?


Many thanks.
Title: Re: DJI Osmo Action 4 GPS information
Post by: kayasaman on April 11, 2024, 08:50:30 AM
Here's a sample video:

https://drive.google.com/file/d/10CvcltTMcmF6grNbJYWikVOzC6xCrQac/view?usp=sharing
Title: Re: DJI Osmo Action 4 GPS information
Post by: kayasaman on April 14, 2024, 09:18:55 AM
Hi, I wonder if there is any feedback on this?

Is it possible or do I need to use another tool like Telemetry Extractor?
Title: Re: DJI Osmo Action 4 GPS information
Post by: StarGeek on April 14, 2024, 11:13:37 AM
This will require Phil's attention. It looks like I tried everything you did and I got the same, empty results.
Title: Re: DJI Osmo Action 4 GPS information
Post by: Phil Harvey on April 14, 2024, 09:36:08 PM
I haven't yet seen 'dbgi' information like this, but I'll see what I can do.

- Phil
Title: Re: DJI Osmo Action 4 GPS information
Post by: Phil Harvey on April 15, 2024, 03:39:23 PM
I've taken a more in-depth look.  There is unknown timed 'djmd' metadata as well as the unknown 'dbgi', and one tonne of each.  A lot of it looks like telemetry data (accelerations for example), but I haven't been able to find the GPS yet.  This will take some time.  I'll post back here if I discover anything.

What type of information are you able to see in this file using the DJI software?

- Phil
Title: Re: DJI Osmo Action 4 GPS information
Post by: Phil Harvey on April 18, 2024, 10:15:10 AM
I've spend a few hours on this now.  I can decode 7 accelerometer readings from the 'djmd' data, but I don't think this decoding is reliable enough to include in ExifTool.  The problem is that they are using variable-length integers in their records, and the byte positions of the data change whenever one of these variable-length values rolls over.  Also, there are many different record types, and all of them require a-priori knowledge of the record length.  So the data cannot be parsed if you don't know the length of one of the records.

I've looked for GPS coordinates, but I seriously doubt that this is written in the video.  I can't see anything that looks like GPS.

If anyone has any detailed information about the 'dbgi' or 'djmd' information, please let me know and I'll see about adding the ability to decode this.

- Phil
Title: Re: DJI Osmo Action 4 GPS information
Post by: Lrk on September 28, 2024, 08:30:36 AM
Hi Phil,

If it helps, DJI released a whitepaper in 2020 named "DJI Media File Metadata WhitePaper" (https://developer.dji.com/onboard-sdk/documentation/introduction/announcement.html).

In part 3, chapter 3, they say they used Google Protocol buffer for timed metadata in videos.
They also provide protobuf schemas with the whitepaper zip archive.
Title: Re: DJI Osmo Action 4 GPS information
Post by: Lrk on September 28, 2024, 11:12:13 AM
I did some test with the protobuf schemas provided with the whitepaper.


Extracted video stream 2 (djmd) from an osmo action4 video which was recorded with the osmo remote control, provinding GPS + other sensors data.

The protobuf schema seems imcomplete or outdated and i can't find any recent version.

some fields are deserialized correctly if i tinker with offsets but, as-is it's pretty much useless.
Title: Re: DJI Osmo Action 4 GPS information
Post by: Lrk on September 28, 2024, 03:06:50 PM
After a few hours of tinkering, i did manage to read the djmd track and data seem legit.

I can confirm that it's protobuf, but the schema is far more complex than in the whitepaper and is device dependent, or at least device type dependent.

In the start of the track data there is a protobuf file name present that will need to be processed in order to know the correct protobuf schema.

the dbgi track seems to be debug data and is also protobuf, but i did not find the schema for that one but the telemetry is present in the djmd track.
Title: Re: DJI Osmo Action 4 GPS information
Post by: Lrk on October 01, 2024, 01:25:15 PM
Quote from: kayasaman on April 11, 2024, 08:50:30 AMHere's a sample video:

https://drive.google.com/file/d/10CvcltTMcmF6grNbJYWikVOzC6xCrQac/view?usp=sharing

the link is down, would you like to share it again ?
i'd like to try with videos other than mine.
Title: Re: DJI Osmo Action 4 GPS information
Post by: Phil Harvey on October 01, 2024, 04:11:42 PM
Could you send me some details about what you have done?  Either post here or email philharvey66 at gmail.com

I would re-up the other sample for you but it is 4GB in size and I don't have enough time to do it right now.  Maybe tonight.

- Phil
Title: Re: DJI Osmo Action 4 GPS information
Post by: Lrk on October 01, 2024, 05:08:12 PM
Quote from: Phil Harvey on October 01, 2024, 04:11:42 PMCould you send me some details about what you have done?  Either post here or email philharvey66 at gmail.com

I would re-up the other sample for you but it is 4GB in size and I don't have enough time to do it right now.  Maybe tonight.

- Phil

Email sent.

Don't bother to reupload 4Gb of video, just a small 5sec will be enough,if you use ffmpeg copy.
 
Title: Re: DJI Osmo Action 4 GPS information
Post by: StarGeek on October 02, 2024, 10:55:48 AM
Quote from: Lrk on October 01, 2024, 05:08:12 PMDon't bother to reupload 4Gb of video, just a small 5sec will be enough,if you use ffmpeg copy.

ffmpeg will strip away any GPS (and EXIF) data. The problem is that there really isn't a standard for embedding a GPS track in a video* Currently, exiftool reads 74 77 different ways that a GPS track can be in a video and there are about half a dozen more in which the format hasn't been decoded. I have yet to find a program that will embed a GPS track into a video file.

* Technically, there is a standard by Google, but nobody follows it, and I've never found any software that write this format. I mention it in this Exiftool forum's post (https://exiftool.org/forum/index.php?msg=69582).
Title: Re: DJI Osmo Action 4 GPS information
Post by: cosmo on November 13, 2024, 04:45:17 PM
Any new information on this subject?
Title: Re: DJI Osmo Action 4 GPS information
Post by: Phil Harvey on November 13, 2024, 08:20:05 PM
No more progress here.  Lrk was unable to share what he had done due to licensing restrictions.  Also the format is device-dependent, and without proper documentation it would need to be reverse-engineered from the data for each device.

- Phil
Title: Re: DJI Osmo Action 4 GPS information
Post by: Phil Harvey on December 04, 2024, 11:32:31 AM
I have managed to extract the GPS coordinates from the timed djmd metadata for a couple of DJI models including the Osmo Action 4.  ExifTool 13.05 will have the ability to extract this, plus the ability to extract all unknown djmd metadata with the -u option (plus unknown dbgi debug information with -U).

Please let me know if you discover the meaning of any useful unknown tags and I'll add the definitions to allow these to be extracted as well.

- Phil
Title: Re: DJI Osmo Action 4 GPS information
Post by: penginex on December 23, 2024, 03:50:06 AM
I'm trying to export gpx from a DJI Osmo Action 5 video, but it fails:

exiftool -api largefilesupport=1 -p "C:\Windows\System32\gpx.fmt" -ee3 H:\DJI\DJI_20241220110455_0032_D_ZP1.MP4 > H:\DJI\DJI_20241220110455_0032_D_ZP1.gpx
exiftool -api largefilesupport=1 -ee3 H:\DJI\DJI_20241220110455_0032_D_ZP1.MP4 > H:\DJI\DJI_20241220110455_0032_D_ZP1.txt
exiftool -api largefilesupport=1 -ee3 -u H:\DJI\DJI_20241220110455_0032_D_ZP1.MP4 > H:\DJI\DJI_20241220110455_0032_D_ZP1-u.txt
Files:https://drive.google.com/drive/folders/1IN7LtFC6jiZQDExVfDu_Y2SWktpXvbz4?usp=sharing
Title: Re: DJI Osmo Action 4 GPS information
Post by: Phil Harvey on December 23, 2024, 08:50:15 AM
Thanks for the sample.  It seems that the Osmo Action 5 uses a new protobuf schema.  I will add support for this in ExifTool 13.11, but until then you can extract the latitude/longitude like this:

exiftool -ee -u -p "${Dvtm_ac204_3-4-2-1-2;s/.* //;tr/)//d} ${Dvtm_ac204_3-4-2-1-3;s/.* //;tr/)//d}" FILE

- Phil

Edit: And GPSDateTime may be extracted with "${dvtm_ac204_3-4-2-6-1;tr/-/:/}"
Title: Re: DJI Osmo Action 4 GPS information
Post by: penginex on December 23, 2024, 10:25:49 PM
Quote from: Phil Harvey on December 23, 2024, 08:50:15 AMThanks for the sample.  It seems that the Osmo Action 5 uses a new protobuf schema.  I will add support for this in ExifTool 13.11, but until then you can extract the latitude/longitude like this:

exiftool -ee -u -p "${Dvtm_ac204_3-4-2-1-2;s/.* //;tr/)//d} ${Dvtm_ac204_3-4-2-1-3;s/.* //;tr/)//d}" FILE

- Phil

Edit: And GPSDateTime may be extracted with "${dvtm_ac204_3-4-2-6-1;tr/-/:/}"

thx  :)  expect ExifTool 13.11