MCPcopy Index your code
hub / github.com/WebODM/WebODM / parse

Method parse

app/video.py:212–348  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

210 return coords, result_ts
211
212 def parse(self):
213
214 # SRT metadata is not standarized, we support the following formats:
215
216 # DJI mavic air 2
217 # 1
218 # 00:00:00,000 --> 00:00:00,016
219 # <font size="36">SrtCnt : 1, DiffTime : 16ms
220 # 2023-01-06 18:56:48,380,821
221 # [iso : 3200] [shutter : 1/60.0] [fnum : 280] [ev : 0] [ct : 3925] [color_md : default] [focal_len : 240] [latitude: 0.000000] [longitude: 0.000000] [altitude: 0.000000] </font>
222 # </font>
223
224 # DJI Mavic Mini
225 # 1
226 # 00:00:00,000 --> 00:00:01,000
227 # F/2.8, SS 206.14, ISO 150, EV 0, GPS (-82.6669, 27.7716, 10), D 2.80m, H 0.00m, H.S 0.00m/s, V.S 0.00m/s
228
229 # DJI Phantom4 RTK
230 # 36
231 # 00:00:35,000 --> 00:00:36,000
232 # F/6.3, SS 60, ISO 100, EV 0, RTK (120.083799, 30.213635, 28), HOME (120.084146, 30.214243, 103.55m), D 75.36m, H 76.19m, H.S 0.30m/s, V.S 0.00m/s, F.PRY (-5.3°, 2.1°, 28.3°), G.PRY (-40.0°, 0.0°, 28.2°)
233
234 # DJI Unknown Model #1
235 # 1
236 # 00:00:00,000 --> 00:00:00,033
237 # <font size="28">SrtCnt : 1, DiffTime : 33ms
238 # 2024-01-18 10:23:26.397
239 # [iso : 150] [shutter : 1/5000.0] [fnum : 170] [ev : 0] [ct : 5023] [color_md : default] [focal_len : 240] [dzoom_ratio: 10000, delta:0],[latitude: -22.724555] [longitude: -47.602414] [rel_alt: 0.300 abs_alt: 549.679] </font>
240
241 # DJI Mavic 2 Zoom
242 # 1
243 # 00:00:00,000 --> 00:00:00,041
244 # <font size="36">FrameCnt : 1, DiffTime : 41ms
245 # 2023-07-15 11:55:16,320,933
246 # [iso : 100] [shutter : 1/400.0] [fnum : 280] [ev : 0] [ct : 5818] [color_md : default] [focal_len : 240] [latitude : 0.000000] [longtitude : 0.000000] [altitude: 0.000000] </font>
247
248 # DJI Unknown Model #2
249 # 1
250 # 00:00:00,000 --> 00:00:00,033
251 # No:1, F/2.8, SS 155.55, ISO 100, EV 0, M.M AE_METER_CENTER, A.T (126,109), Luma 106, Coef(1.000000, 1.000000, 1.000000), FaceDetectTag (0), FaceDetectRect (0,0,0,0,), Gain (1.000000,4096), Index (Ev:10085,Nf:0), E.M 0, AERect(n/a), AeAdvScene (GR:91.000000,GWR:1.000000,LLR:0.196683,RR:0.870551), LeCurve(64) (1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,128,), AfSpd 0/0, Af Rect(X:0, Y:0, W:0, H:0), AfPos 0, AwbMode WB_AUTOMATIC, Awb Gain(R:8206, G:4096, B:7058), ColorTemp 5241, B.L (-1020, -1020, -1020, -1020), IQS (39253, 208), ToneInfo (0,16,33,51,68,85,102,119,136,152,169,185,202,218,234,250,266,282,298,314,330,346,362,378,394,410,425,441,457,473,488,500,514,532,550,567,584,602,619,637,654,671,688,705,721,738,754,770,786,801,817,832,847,862,877,892,907,922,937,951,966,981,995,1011,0,64,134,205,274,342,410,477,544,611,677,743,809,873,937,1002,1066,1130,1194,1258,1322,1385,1449,1512,1576,1640,1703,1766,1829,1893,1952,2003,2058,2130,2201,2270,2339,2410,2479,2548,2616,2685,2753,2820,2886,2952,3016,3080,3144,3207,3270,3329,3391,3451,3511,3571,3630,3688,3748,3807,3866,3924,3983,4044,), Isp Info (PIPE 1,ADJ 0,De 0) GPS (-2.5927, 52.0035, 15), D 0.61m, H 1.00m, H.S 0.00m/s, V.S 0.00m/s
252
253
254 with open(self.filename, 'r', encoding="utf-8") as f:
255
256 iso = None
257 shutter = None
258 fnum = None
259 focal_len = None
260 latitude = None
261 longitude = None
262 altitude = None
263 start = None
264 end = None
265
266 for line in f:
267 # Remove html tags, spaces
268 line = re.sub('<[^<]+?>', '', line).strip()
269

Callers 15

get_entryMethod · 0.95
get_gpsMethod · 0.95
get_linestringMethod · 0.95
extract_gps_from_srtFunction · 0.95
loadCamerasMethod · 0.45
handleFileSelectMethod · 0.45
parseImageMethod · 0.45
componentDidMountMethod · 0.45
ProjectListItemClass · 0.45
componentDidMountMethod · 0.45
constructorMethod · 0.45
ImportExternalPanelClass · 0.45

Calls 2

match_singleFunction · 0.85
appendMethod · 0.80

Tested by

no test coverage detected