dji-telemetry 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,299 @@
1
+ Metadata-Version: 2.4
2
+ Name: dji-telemetry
3
+ Version: 1.0.0
4
+ Summary: Parse DJI drone SRT telemetry files and overlay flight data onto video footage
5
+ Author: jetervaz
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/jetervaz/dji-telemetry
8
+ Project-URL: Repository, https://github.com/jetervaz/dji-telemetry
9
+ Project-URL: Issues, https://github.com/jetervaz/dji-telemetry/issues
10
+ Keywords: dji,drone,telemetry,video,overlay,gpx,srt
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: End Users/Desktop
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Multimedia :: Video
23
+ Classifier: Topic :: Scientific/Engineering :: GIS
24
+ Requires-Python: >=3.8
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: opencv-python>=4.5.0
28
+ Requires-Dist: numpy>=1.19.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=7.0; extra == "dev"
31
+ Requires-Dist: pytest-cov; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ # DJI Telemetry
35
+
36
+ A Python library to parse DJI drone SRT telemetry files, export flight data, and overlay telemetry onto video footage.
37
+
38
+ Tested with **DJI Neo 2** but should work with other DJI drones that generate SRT telemetry files.
39
+
40
+ ## Features
41
+
42
+ - **Parse** DJI SRT telemetry files (per-frame metadata)
43
+ - **Calculate** horizontal/vertical speeds from GPS data
44
+ - **Export** to CSV, JSON, or GPX formats
45
+ - **Overlay** telemetry data onto video footage
46
+ - **Generate** transparent overlay videos or frame sequences
47
+
48
+ ## Installation
49
+
50
+ ```bash
51
+ pip install dji-telemetry
52
+ ```
53
+
54
+ Or install from source:
55
+
56
+ ```bash
57
+ git clone https://github.com/jetervaz/dji-telemetry.git
58
+ cd dji-telemetry
59
+ pip install -e .
60
+ ```
61
+
62
+ ## Quick Start
63
+
64
+ ### Python Library
65
+
66
+ ```python
67
+ from dji_telemetry import parse_srt, process_video, export
68
+
69
+ # Parse telemetry data
70
+ telemetry = parse_srt('flight.SRT')
71
+
72
+ # Show flight stats
73
+ print(f"Duration: {telemetry.duration_seconds:.1f}s")
74
+ print(f"Distance: {telemetry.total_distance:.1f}m")
75
+ print(f"Max altitude: {telemetry.max_altitude:.1f}m")
76
+ print(f"Max speed: {telemetry.max_speed * 3.6:.1f} km/h")
77
+
78
+ # Export to different formats
79
+ export(telemetry, 'flight.csv')
80
+ export(telemetry, 'flight.json')
81
+ export(telemetry, 'flight.gpx')
82
+
83
+ # Process video with overlay
84
+ process_video('flight.MP4', telemetry, 'flight_with_telemetry.mp4')
85
+ ```
86
+
87
+ ### Command Line
88
+
89
+ ```bash
90
+ # Process video with telemetry overlay
91
+ dji-telemetry overlay video.MP4 --audio
92
+
93
+ # Generate transparent overlay video (for compositing)
94
+ dji-telemetry overlay-only video.SRT -o overlay.mp4 --width 3840 --height 2160
95
+
96
+ # Generate PNG frame sequence (for video editors)
97
+ dji-telemetry frames video.SRT -o frames/ --width 1920 --height 1080
98
+
99
+ # Export telemetry data
100
+ dji-telemetry export video.SRT -o telemetry.csv
101
+ dji-telemetry export video.SRT -o telemetry.json
102
+ dji-telemetry export video.SRT -o flight.gpx
103
+
104
+ # Show file information
105
+ dji-telemetry info video.SRT
106
+ dji-telemetry info video.MP4
107
+ ```
108
+
109
+ ## API Reference
110
+
111
+ ### Parsing
112
+
113
+ ```python
114
+ from dji_telemetry import parse_srt, TelemetryData, TelemetryFrame
115
+
116
+ # Parse SRT file
117
+ telemetry: TelemetryData = parse_srt('flight.SRT')
118
+
119
+ # Access frames
120
+ for frame in telemetry.frames:
121
+ print(f"Alt: {frame.rel_alt}m, Speed: {frame.h_speed * 3.6:.1f} km/h")
122
+
123
+ # Get frame at specific time
124
+ frame = telemetry.get_frame_at_time(5000) # 5 seconds
125
+
126
+ # Flight statistics
127
+ telemetry.duration_seconds
128
+ telemetry.total_distance
129
+ telemetry.max_altitude
130
+ telemetry.max_speed
131
+ telemetry.start_coordinates
132
+ telemetry.end_coordinates
133
+ ```
134
+
135
+ ### Exporting
136
+
137
+ ```python
138
+ from dji_telemetry import parse_srt, export, to_csv, to_json, to_gpx
139
+
140
+ telemetry = parse_srt('flight.SRT')
141
+
142
+ # Auto-detect format from extension
143
+ export(telemetry, 'data.csv')
144
+ export(telemetry, 'data.json')
145
+ export(telemetry, 'track.gpx')
146
+
147
+ # Or use specific exporters
148
+ to_csv(telemetry, 'data.csv', include_all_fields=True)
149
+ to_json(telemetry, 'data.json', indent=2)
150
+ to_gpx(telemetry, 'track.gpx', name='My Flight')
151
+ ```
152
+
153
+ ### Video Processing
154
+
155
+ ```python
156
+ from dji_telemetry import (
157
+ parse_srt,
158
+ process_video,
159
+ generate_overlay_video,
160
+ generate_overlay_frames,
161
+ add_audio,
162
+ OverlayConfig
163
+ )
164
+
165
+ telemetry = parse_srt('flight.SRT')
166
+
167
+ # Custom overlay configuration
168
+ config = OverlayConfig(
169
+ show_altitude=True,
170
+ show_speed=True,
171
+ show_vertical_speed=True,
172
+ show_coordinates=True,
173
+ show_camera_settings=True,
174
+ show_timestamp=True,
175
+ show_speed_gauge=True,
176
+ gauge_max_speed_kmh=60.0,
177
+ )
178
+
179
+ # Process video with overlay
180
+ process_video(
181
+ 'flight.MP4',
182
+ telemetry,
183
+ 'output.mp4',
184
+ config=config,
185
+ progress_callback=lambda cur, total: print(f"{cur}/{total}")
186
+ )
187
+
188
+ # Add audio from original
189
+ add_audio('output.mp4', 'flight.MP4', 'output_with_audio.mp4')
190
+
191
+ # Generate overlay-only video (black background, for compositing)
192
+ generate_overlay_video(
193
+ telemetry,
194
+ 'overlay.mp4',
195
+ width=3840,
196
+ height=2160,
197
+ fps=30.0,
198
+ config=config
199
+ )
200
+
201
+ # Generate PNG frame sequence (with transparency)
202
+ generate_overlay_frames(
203
+ telemetry,
204
+ 'frames/',
205
+ width=1920,
206
+ height=1080,
207
+ fps=30.0,
208
+ format='png'
209
+ )
210
+ ```
211
+
212
+ ### Overlay Configuration
213
+
214
+ ```python
215
+ from dji_telemetry import OverlayConfig
216
+
217
+ config = OverlayConfig(
218
+ # Toggle elements
219
+ show_altitude=True,
220
+ show_speed=True,
221
+ show_vertical_speed=True,
222
+ show_coordinates=True,
223
+ show_camera_settings=True,
224
+ show_timestamp=True,
225
+ show_speed_gauge=True,
226
+
227
+ # Speed gauge
228
+ gauge_max_speed_kmh=50.0,
229
+
230
+ # Styling
231
+ font_scale_factor=1.0,
232
+ text_color=(255, 255, 255), # BGR: White
233
+ shadow_color=(30, 30, 30), # BGR: Dark gray
234
+ gauge_color=(255, 255, 255), # BGR: White
235
+ gauge_needle_color=(255, 200, 0), # BGR: Orange
236
+ )
237
+ ```
238
+
239
+ ## Overlay Layout
240
+
241
+ The default overlay displays:
242
+
243
+ ```
244
+ ┌─────────────────────────────────────────────────────────────┐
245
+ │ ALT: 57.2m ISO 100 │
246
+ │ H.SPD: 12.5 km/h 1/1250.0s │
247
+ │ V.SPD: +1.2 m/s f/2.2 │
248
+ │ EV -1.3 │
249
+ │ │
250
+ │ │
251
+ │ │
252
+ │ │
253
+ │ ┌───┐ │
254
+ │ │ 12│ │
255
+ │ │kmh│ │
256
+ │ └───┘ │
257
+ │ 29.685883S 53.777843W 09:58:21 │
258
+ └─────────────────────────────────────────────────────────────┘
259
+ ```
260
+
261
+ ## DJI SRT Format
262
+
263
+ DJI drones generate SRT files with per-frame telemetry:
264
+
265
+ ```
266
+ 1
267
+ 00:00:00,000 --> 00:00:00,033
268
+ <font size="28">FrameCnt: 1, DiffTime: 33ms
269
+ 2026-01-30 09:58:21.637
270
+ [iso: 100] [shutter: 1/1250.0] [fnum: 2.2] [ev: -1.3] [ct: 6700]
271
+ [latitude: -29.685883] [longitude: -53.777843]
272
+ [rel_alt: 57.200 abs_alt: 204.644] ...</font>
273
+ ```
274
+
275
+ ### Supported Fields
276
+
277
+ | Field | Description |
278
+ |-------|-------------|
279
+ | `iso` | ISO sensitivity |
280
+ | `shutter` | Shutter speed |
281
+ | `fnum` | Aperture (f-number) |
282
+ | `ev` | Exposure compensation |
283
+ | `ct` | Color temperature (Kelvin) |
284
+ | `latitude` | GPS latitude |
285
+ | `longitude` | GPS longitude |
286
+ | `rel_alt` | Relative altitude (from takeoff) |
287
+ | `abs_alt` | Absolute altitude (sea level) |
288
+
289
+ ### Calculated Fields
290
+
291
+ | Field | Description |
292
+ |-------|-------------|
293
+ | `h_speed` | Horizontal speed (calculated from GPS) |
294
+ | `v_speed` | Vertical speed (calculated from altitude) |
295
+ | `distance` | Cumulative distance traveled |
296
+
297
+ ## License
298
+
299
+ This project is licensed under the [MIT License](LICENSE).
@@ -0,0 +1,11 @@
1
+ dji_telemetry/__init__.py,sha256=lws648TXtrIaICFxTJ9PrVm8E2KKQmk7T_Z52cEog-E,1481
2
+ dji_telemetry/exporter.py,sha256=farq3ahf2fgBlrAqE4YK1iu7NBw63vCJ3-CVbNTuK3U,6350
3
+ dji_telemetry/overlay.py,sha256=N-smtpR00q0lUFLHKNQYMn8jRdrjhUJeCmSxL9o0hBE,10102
4
+ dji_telemetry/parser.py,sha256=7Y1TRL4oC0GwinBbiopOPX2cIjOVlf1jiR_QGVRiiNA,8659
5
+ dji_telemetry/video.py,sha256=L7QbITXIQIE-mHkYCPeM_fZ0WEoxfhuGmZcUw_M3uRA,9014
6
+ dji_telemetry-1.0.0.dist-info/licenses/LICENSE,sha256=QKpnloDzfmpUlKMUonYqvM45JUW5yrElk-ty4iLY2BQ,1151
7
+ dji_telemetry-1.0.0.dist-info/METADATA,sha256=8QhaH4pdZ27JSu-lUzmCbNXroW0oO8ynwVQStoYzwek,8422
8
+ dji_telemetry-1.0.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
9
+ dji_telemetry-1.0.0.dist-info/entry_points.txt,sha256=fERd7nBWWPs2uHjw-mrTb9-P1-7uGWZgEb1XgFID5Sw,43
10
+ dji_telemetry-1.0.0.dist-info/top_level.txt,sha256=66xYvAl0Z6EtrOtOpnaWapSQc5ENTQMF2P8FUs1FMFY,14
11
+ dji_telemetry-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.10.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ dji-telemetry = cli:main
@@ -0,0 +1,25 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 jetervaz
4
+
5
+ Contact: jetervaz@gmail.com
6
+ Website: https://jetervaz.com
7
+ Substack: https://jtrvz.io
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ dji_telemetry