The DJI Mini 2 and subtitles in Final Cut


Subtitling your Mini 2 Movies
First off, please understand that this page relates to the DJI Mini 2, Final Cut Pro and a Mac. I don't know if it equally relates to other DJI drones or indeed drones from other manufacturers. I also explain how I wrote software to convert this data, with the original "out of the box" subtitles:



to this:





A little background and explanation
If you look in the menu system of the DJI Fly app, you will find under Camera, an item called Video Subtitles. The first step on this journey is therefore to set this to On. Now, whenever you fly and record video, subtitle data such as seen in the first of my two screenshots above will be saved along with the video frames. Don't expect this data to magically show up when you edit your video though - the data must be extracted.

The easiest way I've found to extract a subtitle file is to visit DJI Telemetry Overlay where there is the means to get the subtitles. Simply drag your video file into the box and it will happen. The video itself is not uploaded (a good thing - they come out around 4 Gb), the file is read in place. A minute or so later you can download the subtitle file, with extension .srt, known as a SubRip file.

Next, in Final Cut, start a new event and project and import your Mini video footage into it. Next, in the FCP menu, select Import and then Captions. Here you'll be able to import your srt file. It will automatically appear on the timeline, so all you have to do is drag the video clip onto the timeline, lining it up with the grey box representing the SubRip.

Not quite there yet! When you go to share the video out to Master file, or whichever format you choose, you need to go into the Roles tab of the Share dialog, click on captions, and the popup which appears, select English (SRT) in the Burn in captions field. Then proceed to export the video, and you'll get - in due course - a video file with real-time subtitles, showing various flight parameters, changing with a frequency of one second.


But do we really want all that info?
See my first screenshot above. It's showing the camera aperture: useless: it's a fixed 2.8. It's showing SS - I confess I don't know what that is. It's showing EV - you set it, so presumably you know what it is: mine is always -0.3. It shows DZOOM; I don't know about you, but I never use that. The GPS coordinates are there: I have no interest in real time coordinate updates; in any case I can get all that in a KML for Google Earth from Airdata. Vertical speed is there; not very interesting to be honest.

No, what I'm really interested in are Distance, Altitude and Speed. And I want them in Imperial, not metric please. Note that even though my Mini is set to Imperial in its menu system, the srt is always metric.


There was only one way
I could see no alternative. The srt format was baked into the firmware of the drone, and you got what you got. So, I thought, what exactly is an srt file? Expecting to find a whole load of fishheads, diamonds and Greek letters, I opened one up in Text Edit. To my great surprise it looked like this:

1
00:00:00,000 --> 00:00:01,000
F/2.8, SS 456.97, ISO 100, EV -0.3, DZOOM 1.000, GPS (-1.2937, 51.3736, 18), D 0.27m, H 2.70m, H.S 0.00m/s, V.S -0.00m/s

2
00:00:01,000 --> 00:00:02,000
F/2.8, SS 407.84, ISO 100, EV -0.3, DZOOM 1.000, GPS (-1.2937, 51.3736, 18), D 0.31m, H 2.70m, H.S 0.00m/s, V.S -0.00m/s

3
00:00:02,000 --> 00:00:03,000
F/2.8, SS 263.03, ISO 100, EV -0.3, DZOOM 1.000, GPS (-1.2937, 51.3736, 18), D 0.40m, H 2.70m, H.S 0.00m/s, V.S -0.00m/s

4
00:00:03,000 --> 00:00:04,000
F/2.8, SS 280.69, ISO 100, EV -0.3, DZOOM 1.000, GPS (-1.2937, 51.3736, 18), D 0.41m, H 2.70m, H.S 0.00m/s, V.S -0.00m/s

5
00:00:04,000 --> 00:00:05,000
F/2.8, SS 288.39, ISO 100, EV -0.3, DZOOM 1.000, GPS (-1.2937, 51.3736, 17), D 0.34m, H 2.70m, H.S 0.00m/s, V.S -0.00m/s


So you have a serial number on the first line, the time code on the second line, exactly what the subtitle will look like on line 3, and a blank line.


How hard can it be?
Donning my programming trousers and hat, and opening up XOJO, my preferred language, I set to work. I wanted to be able to import the original srt, offer the option of keeping the metric or converting to imperial, and only output the items I really wanted, all into a new srt. My second screenshot shows exactly what I envisaged.

It turned out to be quite simple: load the original srt, and read it line by line. If it was a number, just write it to the new file; if it was the time code, again, just write it out; similarly with blank lines. The real work came with line 3, the actual data. My processing consisted of interpreting the elements of the line, ignoring the DZOOM and GPS etc, and separating out the bits I wanted. Then changing D to Distance, H to Altitude, and S to Speed. If Imperial had been selected I then need to do the required calculations, to two decimal places, and substitute m for feet, and mph for m/s. Put all these three elements together, stick in some commas, and write the result out. This is how the final output file looks:

1
00:00:00,000 --> 00:00:01,000
Distance 0.89ft, Altitude 8.86ft, Speed 0.00mph

2
00:00:01,000 --> 00:00:02,000
Distance 1.02ft, Altitude 8.86ft, Speed 0.00mph

3
00:00:02,000 --> 00:00:03,000
Distance 1.31ft, Altitude 8.86ft, Speed 0.00mph

4
00:00:03,000 --> 00:00:04,000
Distance 1.35ft, Altitude 8.86ft, Speed 0.00mph

5
00:00:04,000 --> 00:00:05,000
Distance 1.12ft, Altitude 8.86ft, Speed 0.00mph

It was done! But would it work? Only one way to find out! Yes, it works very well, and the second screenshot shows a still taken from a Final Cut movie with my new subtitles added. Pretty neat don't you think?

This is how the progam looks:



To translate an srt which accompanies a 5 minute clip takes about a second. So there you have it - an interesting little exercise.