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

13757
23
09-09-2018 07:27 PM
Labels (1)
CodyBenkelman
Esri Regular Contributor
6 23 13.8K

For FMV in ArcGIS (ArcGIS Pro 2.2 or later 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.  Information is here http://esriurl.com/misb, 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.

Running the Video Multiplexer is straightforward if you have the required metadata in the proper format, so that is the key challenge. 

Esri has an app available at http://esriurl.com/SSEE that can be used to plan and control drone flights.  This app for iPad is free for users with an ArcGIS Online or Enterprise account, and it will automatically record the metadata required for the Video Multiplexer on any video flight (manual or autonomous).  Drones supported by this app are listed at https://esriurl.com/SiteScanSupportedDrones.    

For users that require Android, Esri business partner CompassDrone has built an application called CIRRUAS that will capture video metadata required for FMV support.  CIRRUAS is available at https://compassdrone.com/cirruas/.

Note that the required metadata must be captured at the time of the drone flight.  If you have videos that were previously captured without using this app, it may be possible to extract the required metadata, but there are limitations and our experience has shown that it is challenging.  Further discussion is included below.

DJI drones write a binary formatted metadata file with extension *.dat or *.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.   That ASCII file could then be manually edited for compatibility with ArcGIS Pro as described below.  If you decide to pursue this editing and reformatting, please see this blog for additional advice: http://esriurl.com/MultiplexerTipsTricks.


Key points:

  • Esri has not tested and cannot endorse the free DatCon 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 the DJI 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 and *.srt files were created for the purpose of troubleshooting; they were NOT designed 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 incomplete and/or inaccurate results, unless you apply manual effort to identify the temporal gaps and fill in your own estimated or interpolated values for the missing times and missing fields.
  • This blog was first 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.

NEW UPDATE September 2022:  if any portion of your video aims above the horizon, the features of FMV may not be suitable for your needs.  See resources in post below from 09-20-2022.

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

23 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 III

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.

### UPDATE ADDED June 2022 ###  We have published a tech article regarding how to apply corrections for height values in flight logs (most typically from DJI drones but applicable to any drone presuming you are able to extract the required metadata; Note this new article is ONLY about correcting height values, not about interpreting drone flight logs to FIND or FORMAT the metadata).   See http://esriurl.com/CorrectDroneZ


Cody B

LanNguyen1
New Contributor III

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
Occasional Contributor III

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 III

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 III

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 II

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.

MichaelBruening
Occasional Contributor

I know this is an older thread/blog, but I was wondering if anyone has found an easy and workable means of using a DJI drone video with FMV?

I have attempted to use the steps within this article only.tonfind that the Cirruas app has been removed from the Google store and that the Datcon program will not perform on my laptop with windows 10 pro. I have the correct version of sun java software and installed and it does not recognize it and returns an error.

I have attempted to find any article or blog or informational piece of material that could possibly help me out, but I have not been able to find any means of being able to use my Pixel 6 Pro and a DJI drone within FMV.

Any help or information would be greatly appreciated.

CodyBenkelman
Esri Regular Contributor

I inserted this comment above, but repeating it here for anyone simply scrolling down to the latest post.

### UPDATE ADDED June 2022 ###  We have published a tech article regarding how to apply corrections for height values in flight logs (most typically from DJI drones but applicable to any drone, presuming you are able to extract the required metadata; Note this new article is ONLY about correcting height values, not about interpreting drone flight logs to FIND or FORMAT the metadata).   See http://esriurl.com/CorrectDroneZ

Also repeating from above - Esri does provide a free flight planning and flight control app (for iPad only) that will automatically record metadata in the required format for any video flight.  See at http://esriurl.com/SSLE

Cody B.

CodyBenkelman
Esri Regular Contributor

### ADDING ANOTHER UPDATE September 20, 2022 ###

On the general subject of "Using video in ArcGIS" many of you may be interested to learn about Oriented Imagery.  This is a capability designed specifically for images and video that cannot be mapped onto the ground - e.g. if any portion of your video aims above the horizon, some of the features of FMV in ArcGIS aren't applicable (e.g. "zoom to extent of video footprint" will zoom out to 1:1 million scale because the footprint extends to the horizon). 

If you are capturing video with a drone, dashcam, etc. aimed toward the horizon (even if there's a building in the view and you can't see the horizon) Oriented Imagery may provide a better solution for working with your video in ArcGIS.

A good starting point is this resource https://doc.arcgis.com/en/imagery/workflows/resources/managing-and-visualizing-oriented-imagery.htm and note it points to other documentation (See Imagery Workflows resources) including public sample web apps (including some video datasets) at https://esriurl.com/OIgallery 

IMPORTANT SUMMARY:  
Oriented Imagery supports video aimed partially or completely above the horizon, but all of the discussion in this blog above regarding the format and completeness of suitable metadata (XYZ location, heading, and field of view of the sensor) is still applicable.  Oriented Imagery does not provide a solution for missing or improperly formatted metadata.

Cody B.

Clemens_Naderer
New Contributor II

There is a really simple way to do this:

DJI Drone Video for Esri MISB FMV Video Multiplexer with LineVision Desktop - YouTube

Simple workflow and tool.