Another use for an SRT file

As many of you probably know, if you enable “Video Captions” in the app, a “.SRT” file is generated along with the video file when capturing a movie. For example, with video captions enabled, you would see a pair of files on your SD card named something like this:

  • DJI_0001.MP4
  • DJI_0001.SRT

With an appropriate player, the contents of that SRT file can then be displayed as video captioning when viewing the video file.

That SRT file, among other things, contains a log of GPS coordinates and altitude information. From that information, one can re-create the path of the flight that was used in capturing that video. One limitation in doing this, results from the fact that neither the heading nor the gimbal pitch angle are stored in the SRT file. As a result, only the path of the drone can be re-created in a waypoint mission.

I have an “Air Data to Litchi Converter” that will convert flight logs into Litchi missions. To that converter, I have added the ability to convert the information contained within an SRT file into a Litchi mission CSV file. That waypoint mission can then be flown using Litchi or converted to a KMZ file and flown with DJI Fly.

If you would like to try this, use my “Air Data to Litchi Converter”.

1 Like

I didn’t know that! I’ll look for it…

… it might be interesting to some that there is a way to strip an srt file from a DjiFly-made video if subtitles are enabled…I’ve used a Windows application “XMediaRecode”- a video converter (and somewhat of an editor too) that has the capability if you look hard. It can run in Linux wine too.

even easier, a tool named “Subtitleedit”

great to hear you have added this, lots of interesting and useful info in the .srt files, for those not aware, VLC can play .srt files where you see the data, as well as a low res video image of the subject. Some of the editing tools including Resolv also enable you to add .srt as overlays.

Interesting, I don’t remember seeing “Video Captions” option, will have to go looking for it(In Litchi and or Fly by chance?).
Did you know that with the DJI Mini SE at least, the .SRT data appears to be stored on a layer within the .MP4 file? Perhaps it would be easy to extract the data from any drone video file and not even have to enable .SRT creation(Maybe the .mp4 subtitle data holds more datafields? seems like a lot there…)? To see it just play a drone video in VLC and select Subtitle | Sub Track | Track 1…

For others reading this/new… If you don’t wish to share location where your filming; it’s important to strip that layer out(I use LossLessCut) and clear exif file location data (exiftool; Windows 8.1 clear exif data does not clear all location fields!, it won’t show you them all in windows details).

This might be advantageous if/when laws change and the nature of people trying to justify their advanced-welfare(government jobs). ie: Says here you were x elevation, park/other border/restriction… They send out fines for youtubers already…

Yes. It is available in DJI Go4, DJI Fly and Litchi.

I did not know that when I wrote the converter but later found that the newer drones store the subtitle information directly in the video file instead of creating a separate SRT file. The embedded subtitle track may be extracted from the video file using the following tool:

1 Like

The embedded srt that DJI video has can also be extracted “offline” with the aforementioned “Subtitleedit” (I corrected the link I hope)

Hi I have been suggested using Litchi for a specific way to display the altitude in Video Captions. I need to get the altitude from the ground level (more precisely, from the take off point will suffice).

I am having a problem of getting the relative altitude just as my controller shows as “height”. The video captions I get from my Mavic 2 Pro apparently all get the altitudes from the sea level in the SRT files. Is there a function in Litchi to overwrite the altitudes for the altitudes from the ground level? As I am new to Litchi and it will cost me some money to test it out, I am reaching out here to see if anyone has used Litchi for such a purpose (overwriting some unwanted formats in SRT files created by Mavic drones to your preferable formats). Thanks

That is definitely possible.

That is not possible. Your drone has no way of knowing how high you are above sea level. The only height it knows is the height above take-off location.

If you are asking if Litchi can create an SRT file with heights other than height above take-off location, the answer is no.

The first thing you should do is determine why you think the heights in the SRT file are anything but height above take-off location. If you are willing to share an SRT file, I would be happy to take a look at it.

Whether it is height above take-off location or height above ground, I have written a utility that uses your flight log from in conjunction with elevation data from Google, to compute the height AGL of a flight and convert that to an SRT file. If you are interested in this, it may be found here:

Hi I have uploaded a video and its SRT on Google drive. The video begins from the ground but the altitude starts from 44m and it flies up several 10m. The drone’s IMU I reckon is using the air pressure.

This is DNG file taken midair.

Hi is there any version of Subtitleedit for Mac?

I need the SRT files that display the relative attitudes (those from the ground/ take-off level). I have just synched my DJI account to and it seems to be displaying precise data including the relative altitude.

Yes. I looked at your video and SRT file. Whatever altitude it is trying to show you is wrong because it starts a “40”.

That is correct. When the drone is powered on it measures the barometric pressure. Then, when flying, it compares the current barometric pressure to what it was when it was powered on. Using that difference in pressure, it determines the drone’s altitude above the take-off location and displays it on your screen. Because the barometric pressure changes with weather patterns, it cannot tell altitude above sea level.

It would be interesting to make a note of the altitude as displayed on your screen and then compare that to what your SRT file is showing.

Then my utility should work for you. Note that, in general, there is a difference between the altitude above ground and altitude above take-off unless you are flying in a very flat area.

I’ve been looking at several flightlogs & corresponding SRT-files from my Mavic 2 Pro.
The altitude in the SRT-files is indeed above sea level.

I came to this conclusion by determining the altitude at the home point on a topographic map on a garmin outdoor GPSr.

The altitude in the first line of the SRT-file (home point) is equal to the altitude on the map at the same location, this for all flights at different locations.

Totally unexpected !?

How could the drone determine the height above sea level?

I asume from the cached satelite imagery.

It may have cached imagery but imagery alone does not provide elevation data. It would need to have actual elevation data but that type of data is generally very large. I could see how there could be a GEOtiff file of the same size as the cached imagery but if that were the case, one would think that DJI would provide an option to use that data to show ASL heights. Three has never been any mention of the drone having this type of capability.

EXIF data from DJI photos does include ASL heights but in another forum those attributes have been shown to contain nonsense.

Then it must be a coincidence.

I have never taken photos with this drone, so I cannot say anything about this.

I think it must be. I normally do not capture SRT files. However, I have seen posts such which strongly suggest that the “Absolute Altitude” captured by DJI drones is completely unreliable:

Well yes I confirmed that ultimately my M2P does actually store the relative altitudes which are not displayed in the video caption (using DJI Go 4)

The problem is the video caption only displays the presumably absolute altitude but not the relative, and I cannot change how it write its own log. I have a client who’s looking to buy videos with video captions of the drone flying 115m above the ground. It would be easy if I could have the video caption written with AGL instead of the other altitude, which seems to be durable from what I’ve been reading here.

Has anyone tried getting video captions using M2P (or Mavic 2 Zoom I believe is the same) with Litchi?