How do we process video from a DJI drone to bring it into FMV for ArcGIS?

6843
19
09-09-2018 07:27 PM
Labels (1)
CodyBenkelman
Esri Regular Contributor
6 19 6,843

For FMV in ArcGIS (ArcGIS Pro 2.2 with Image Analyst Extension, or ArcMap 10.x with the FMV add-in) to display videos and link the footprint into the proper location on the map, the video must include georeferencing metadata multiplexed into the video stream.  The metadata must be in MISB (motion industry standards board) format, originally designed for military systems.  Information is here http://www.gwg.nga.mil/misb/index.html, but drone users do not need to study this specification.  For non-MISB datasets, Esri has created a geoprocessing tool called the “Video Multiplexer” that will process a video file with a separate metadata text file to create a MISB-compatible video.  This is described more completely (e.g. format for the metadata about camera location, orientation, field of view, etc.) in the FMV Manual at http://esriurl.com/FMVmanual.

 

For those with DJI drones, the challenge then becomes “where is the required metadata?”.  DJI drones write a binary formatted metadata file with extension *.dat (or possibly *.srt, depending on drone and firmware) for every flight.  There is a free utility called “DatCon” at this link https://datfile.net/DatCon/downloads.html which will reportedly convert the DJI files to ASCII format. 

 

Key points:

  • Esri has not tested and cannot endorse this free utility. If you choose to use it, as with any download from the internet, you should check it for viruses etc.
  • DJI has changed the format of the metadata in this file on multiple occasions, so depending on your drone and date of its firmware, you will find differences in the metadata content. Esri does not have a specification for this metadata at any version, so cannot advise you what to expect to be included in (or missing from) this file.
  • Another key point is that the DJI *.dat file was created for the purpose of troubleshooting. It was not created with the intent of supporting geospatial professionals seeking a complete metadata record for the drone, gimbal, and camera.  As a result, users will typically find temporal gaps in the metadata.  As a result, processing this metadata through the FMV Multiplexer will likely generate inaccurate results, unless you are willing to apply manual effort (requiring trial and error, and substantial time) to identify the temporal gaps and fill in your own estimated or interpolated values for the missing times and missing fields.
  • IMPORTANT: This blog was written in September 2018, and it is very possible that DJI will make firmware changes in the future to change the readability and completeness of their metadata.

There is an alternative to this, but it is not an Esri solution.  CompassDrone, an Esri business partner and DJI authorized distributor, has built a flight planning and flight control application called CIRRUAS using the DJI API.  This application has access to the DJI metadata in flight, and (among other features) is explicitly designed to capture complete metadata as defined by Esri for FMV support.  If you are using the CIRRUAS app, a metadata file will be captured and exported from the drone, and this will feed directly into the FMV multiplexer. 

 

The CIRRUAS app is available here https://compassdrone.com/software/dji2fmv-cirruas-app/.  For further discussion, please refer to the blog on this topic written by CompassDrone:  https://compassdrone.com/dat-srt-vs-cirruas/

 

A few final notes:

  • Our testing of the CIRRUAS app has yielded good results, but Esri does not provide technical support for the app.
  • Note that the CIRRUAS app must be used to plan and fly the mission, and this will initiate the recording of complete metadata. It cannot be applied to video that was previously recorded, since the metadata records will not be complete.
  • It is not known if there are other alternatives which provide a solution for processing video from DJI drones for ArcGIS FMV.

Check back in this blog for updates as more capabilities are developed.

#EsriFMVDJI

19 Comments
EdwardGlover1
New Contributor III

I flew my dji mavic pro platinum with the GPS .SRT file logging enabled.  I assumed this would allow me to use FMV, integrating the video captured with our GIS.  I'm realizing this isn't the case, unless I'm missing something.  I'm not aware of the .dat file that's referred to in your blog post.  Can I use the .SRT file to see my drone video or do I need to access the .dat file?

CodyBenkelman
Esri Regular Contributor

Ed - sorry my blog wasn't more complete (I try not to make them too long!) but the above discussion is my best understanding of ANY metadata file written by the DJI drones - I don't know what is different about the *.dat vs. *.srt files. (I've updated the text above)  If time permits, I'm hoping to have an engineer at Esri focus some time on understanding and reading these files, but my understanding is that they may not include complete records without temporal gaps.  

If you have a readable (ASCII) version of the *.srt file, we'd be happy to take a look at it.  It would need to be reformatted for compatibility with our "multiplexer" GP tool (see doc at http://esriurl.com/FMVmanual).

JamesLeidhold1
New Contributor

Hi Cody, is there any way to know if any progress has been made regarding bringing DJI drone video into ArcGIS FMV? I would love a notification or something similar. My research project involves taking drone video and georeferencing it. I am hoping to use ArcGIS FMV to do this, since I understand it will automatically georeference video as long as it has the correct metadata.

CodyBenkelman
Esri Regular Contributor

James

I apologize for the delay - I missed this message over the Thanksgiving break.  Short answer, this Imagery & Remote Sensing group, and specifically this blog, are the best places to check back - you can 'follow' this blog, I believe, and you'll be notified of updates.  If DJI makes changes to their metadata recording and formatting that make FMV integration easier, I'll publish an update here.  

Cody B

BelindaDow
New Contributor

Great read... I will check back in to see if you have any updates. I am looking into incorporating FMV and drone data now. I have been able to access the .srt file , but it does not have all the data I need. I watched the FMV tutorial but it doesn't give you insight on what you get from drone data. The tutorial doesn't give you any sample data or show you what the file should look like.. So hopefully some new updates on integrating drone data in existing platforms will come out soon... 

srt file sample from DJI mavic

CodyBenkelman
Esri Regular Contributor

Belinda

I don't have any new information re: DJI drones, but I want to ask about your comments about the tutorial.  Do you mean the FMV tutorial at http://esriurl.com/FMVtutorial?  That should have a sample video file, and associated metadata in the proper format for using our Video Multiplexer geoprocessing tool.  You can also get information on the multiplexer in http://esriurl.com/FMVmanual (but note these resources are for ArcMap; the latest release of FMV for Pro is coming soon at Pro version 2.3, and the documentation is different, although the fundamentals of the MISB format and the multiplexer are unchanged).

Let me know if you cannot find that sample data - but as I cautioned at top, I agree that your SRT file does not appear to have complete metadata.  However, if you did not pan the camera on the gimbal and you can estimate its view orientation (relative to the drone flight direction and the horizon), you may be able to generate a reasonable geotagged video using those estimated orientation values.  You'll have to estimate the field of view as well, and it will take some work to process the *.srt GPS data into a format usable by our Video Multiplexer . Last, you may want to use https://www.epochconverter.com/ to determine a start time (UNIX time, in microseconds) based on your video start time.

Cody

BelindaDow
New Contributor

Thanks Cody, sorry for the delay.. I saw the ESRI tutorial or workshop through the training website. Its an intro to the FMV add in.. I will be looking into the multiplexer for the data that I do have. I will keep a look out for any new posts... 

LanNguyen1
New Contributor II

Hi all,

After a year researching the FMV, it is still a pain to get everything worked as the sample videos I got with FMV ESRI training. 

What we have: Phantom 4 Pro + CIRRUAS + Arc10.5 + FMV extension.

Planned a mission of 20min to fly at 100m, CIRRUAS broke videos and logs into 5min each.

Mixed  the video with CSV using Video Multiplexer and do not know what to put in the Average elevation if we wanted to calculate four corners.

Tested with 100m (flight height) and 700m (what we found in CSV file) and the outputs were generated but wrong, the marking and measurements on the ground were not correct. or too big or too small. The video seems to be alright comparing to the land marks on the ground.

How to choose the best Average elevation for Video Multiplexer? Or was 100m flight altitude is too low with heavily affect the corner calculation? (the flight altitudes in the ESRI sample videos are about 1000m and more)

Thank you!

CodyBenkelman
Esri Regular Contributor

Support for a DEM was implemented in the Pro version, but for the  FMV 1.4 add-in to ArcMap, the multiplexer will process assuming flat terrain.  I appears your metadata file reports height above sea level (orthometric height), so if 700 is correct for the flight altitude, enter the average elevation for the local terrain into the tool.  If you would prefer to edit the metadata file such that it reports height above launch point, enter 0 for average elevation.  

Note that DJI drones often do not report accurate values for flying height, so you may need to adjust the metadata file to get the proper flight altitudes.


Cody B

LanNguyen1
New Contributor II

Hi Cody, 

Thanks for the quick reply. If you are familiar with CIRRUAS output then please have a look at the picture

I have check with our LiDAR DEM, the average elevation of the ground is 545m ASL and + 100m flight, I think the sensor True altitude should be 645m.

I also updating all Sensor True Altitude in CSV using LiDAR DEM.

In this case, should I use 545m for the Average Elevation in the Multiplexer? I realised that calculating corners will be much tricky if we fly low with inconsistent elevation data. Variation of few meters could cause huge error in XY of the corners. 

Thanks,

CodyBenkelman
Esri Regular Contributor

Lan

This is an example of what I was referring to, regarding inaccurate altitude values in DJI drones.  It appears the altitude values in your metadata may be 80 m too high.

Based on what you said here, I would EITHER:

1) use a calculation to subtract 80 meters from the Sensor True Altitude, then enter 545 m into the tool for "Average Elevation", or

2) leave the *.csv file as is, and enter 625 into the tool for "Average Elevation"

The advantage of 1) is that your metadata.csv file would show the (approximately) correct altitudes - but if you're using MS Excel, be sure to remove the formulas after calculation and write numeric values (not formulas) in your metadata.csv file.  Also be sure to CLOSE the file (not editing in MS Excel) before running the multiplexer.

Cody 

MervynLotter
Regular Contributor

Just to add that the Cirruas app has the option to adjust the take off altitude based on a the location of the drone at take off. Just go to Video info log .., then tap and hold on one of the video log files and you will be provided with the option to "Fix reference altitude". This will then adjust the elevation values across the CSV file when you export it.  

LanNguyen1
New Contributor II

Hi all,

FMV in ArcGIS is rocket science?

1. I fixed the sensor true attitude using DEM Lidar, put it back to CSV, no formula, just copy paste and tried to calculate the cornerXY and Video Multiplexer  said I have wrong datatype or string error...

2.Had to come back with the orginal CSV generated by CIRRUAS, ran Video Multiplexer without calculating corner XY, all good, got the MISB mp4, can play + shows the drone positions on the maps. Wanted to export frame to JPG with the sensor XY injected into EXIF, intended to use these JPGs with Orthomosaic generator Dronedeploy... but non of these tools work

Also tried the Capture function while playing video, did not work, only worked with those have corner XY calculated.

IS THERE ANYWAY TO EXPORT JPG WITH EXIF FROM A MISB (no Corner XY) VIDEO?

THANKS!

Lan

CodyBenkelman
Esri Regular Contributor

Lan

1) First we need to figure out why step 1 did not work.  

2) You'll want to run the multiplexer to calculate the XY coordinates of the frame corners.  Did you deliberately choose to deselect that, or did you have problems and find it would not work unless you deselected that?

You said "None of these tools work".  You tried all 6 tools, and none of them worked?  Extract video frames for Orthomosaic should export JPGs with EXIF metadata, but I have not tested it with the frame corners not calculated.  (Logically the frame corners should not be required, but I would assume you DO want frame corners for the video to be useful).

Am I correct that you did not shoot video at an oblique angle, but it was aimed at or near nadir?  And did you also fly parallel overlapping flightlines?  If my assumptions are not both true, then it is not likely that DroneDeploy will be able to process the single frames.  


Cody B

LanNguyen1
New Contributor II

Hi Cody,

1, Could not figure out why after modifying "Sensor altitude" field in csv file, it did not work with the multiplexer anymore. Even with and without calculating corner XY option.

2, With the original csv, I could "mix" it with the video file with and without calculating corner XY. I did not use the one with XY calculated because it shows wrong XY of the frames anyway.

With the one without XY, I expected to export to JPG with EXIF injected into the header but it did not work.

If you would like to have a look deeper, I could upload raw sample data somewhere and PM you.

Thank you!

Cheers,

Lan

CodyBenkelman
Esri Regular Contributor

Lan

I responded to you in email after reviewing your data, but will repeat it here.

In your data from 17 March, the time stamps have been corrupted, I presume by MS Excel. 

This is a known problem with Excel reformatting 16 bit integers into scientific notation.  see http://esriurl.com/FMVmanual.   It cannot be corrected without returning to an earlier copy of your data to restore the timestamps.

In your 30 March data, everything works fine for me, although there does appear to be a time delta of about 4 seconds between your metadata file and your video.  It sounds like your concern is accuracy - note that FMV does not attempt to improve the accuracy of your input data.  If you do not have an accurate (x,y,z) location AND heading/pitch/roll AND sensor field of view, ArcGIS cannot provide accurate location for the video frame or any points digitized in the video.

Cody

LucasMartinez
New Contributor II

Hello, thanks for these precious informations.

I am planning on working with FMV and a Phantom 4 in order to localize objects from the video image. FMV requires to map data from the flight to specific attributes (The 12 required such as Unix Time Stamp, Sensor Latitude, Sensor Longitude, Sensor Altitude... etc.) but I am having trouble finding the right mapping among the ~120 attributes in the CSV file exported with the DatCon tool.

For example, the resulting CSV file shows various Lat/Long attributes, such as "IMU_ATTI(0):Longitude" or "GPS(0):Long". Values are close until the fourth decimal but not exactly the same. Does anybody have an idea on how to properly map the DJI attributes with the 12 fields required in ArcGIS, or a definition of these metadata written by DJI?

Would really appreciate any help upon this.

Best regards,
Lucas

Will
by
Occasional Contributor

I've created a free online petition for DJI to provide MISB compliant video..  can sign it here:

https://www.change.org/p/dji-please-provide-misb-compliant-drone-video

ChrisCipriani
New Contributor

We might have something that should be able to help out a lot of users with the DJI to Esri ArcGIS FMV process. Remote GeoSystems, an Esri Business Partner, just added a new feature our LineVision Desktop - Ultimate edition that provides an easy way to automatically create a properly formatted CSV with metadata for direct input into the Esri ArcGIS Video Multiplexer tool. Users no longer need to hand-modify or update CSV files - all you need is the DJI Flight Record Log .TXT file and the DJI video.

Here is short How-To video:

https://youtu.be/4DRaNJBBMX0

Get a free trial in the Esri ArcGIS Marketplace:
https://marketplace.arcgis.com/listing.html?id=42de9c1ffb734fb69c48eb50a744eb7f

Any questions - contact us at support@remotegeo.com.