time4tea / gopro-dashboard-overlay

Programs to process GoPro MP4 & Generic GPX/FIT files and create video dashboards & maps
GNU General Public License v3.0
383 stars 52 forks source link

Lib fails when timedata seems not match format. #169

Closed robertoalcantara closed 10 months ago

robertoalcantara commented 10 months ago

MP4 file is direct output from Hero8. For some reason the datetime from this record is wrong and the software crash.

gopro-to-gpx.py --only-locked GH015226.MP4 parte1.gpx Loading GoPro GH015226.MP4 Loading GoPro Data Track: 5,087,828 [ 4.9 MiB] [186.6 MiB/s]
Timer(GPMD - Called: 1, Total: 0.51831, Avg: 0.51831, Rate: 1.93)

Found GPS5 Joined file detected... adjusting by Timeunit ms=276923.369 Joined file detected... adjusting by Timeunit ms=560728.297 Joined file detected... adjusting by Timeunit ms=848720.969 Joined file detected... adjusting by Timeunit ms=1172386.665 Joined file detected... adjusting by Timeunit ms=1508438.889 Joined file detected... adjusting by Timeunit ms=1864755.113 Joined file detected... adjusting by Timeunit ms=2228742.921 Joined file detected... adjusting by Timeunit ms=2606810.217 Joined file detected... adjusting by Timeunit ms=2990906.889 Joined file detected... adjusting by Timeunit ms=3379834.473 Joined file detected... adjusting by Timeunit ms=3777883.113 Joined file detected... adjusting by Timeunit ms=4210148.393 Joined file detected... adjusting by Timeunit ms=4647015.817 Joined file detected... adjusting by Timeunit ms=5087022.729 Joined file detected... adjusting by Timeunit ms=5538002.185 Joined file detected... adjusting by Timeunit ms=5995126.825 Joined file detected... adjusting by Timeunit ms=6483283.337 Joined file detected... adjusting by Timeunit ms=6976089.577 Timer(extract GPS - Called: 1, Total: 1.14485, Avg: 1.14485, Rate: 0.87) Timer(parsing - Called: 1, Total: 1.66333, Avg: 1.66333, Rate: 0.60) Traceback (most recent call last): File "/home/roberto/.pyenv/versions/gopro/bin/gopro-to-gpx.py", line 64, in gopro = loader.load(source) ^^^^^^^^^^^^^^^^^^^ File "/home/roberto/.pyenv/versions/3.11.4/envs/gopro/lib/python3.11/site-packages/gopro_overlay/loading.py", line 51, in load frame_meta = parse_gopro( ^^^^^^^^^^^^ File "/home/roberto/.pyenv/versions/3.11.4/envs/gopro/lib/python3.11/site-packages/gopro_overlay/framemeta_gpmd.py", line 132, in parse_gopro gps_frame_meta = gps_framemeta(gpmd, units, datastream=datastream, gps_lock_filter=gps_lock_filter) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/roberto/.pyenv/versions/3.11.4/envs/gopro/lib/python3.11/site-packages/gopro_overlay/framemeta_gpmd.py", line 40, in gps_framemeta gpmd.accept( File "/home/roberto/.pyenv/versions/3.11.4/envs/gopro/lib/python3.11/site-packages/gopro_overlay/gpmf/gpmf.py", line 26, in accept item.accept(visitor) File "/home/roberto/.pyenv/versions/3.11.4/envs/gopro/lib/python3.11/site-packages/gopro_overlay/gpmf/gpmf.py", line 270, in accept i.accept(container_visitor) File "/home/roberto/.pyenv/versions/3.11.4/envs/gopro/lib/python3.11/site-packages/gopro_overlay/gpmf/gpmf.py", line 270, in accept i.accept(container_visitor) File "/home/roberto/.pyenv/versions/3.11.4/envs/gopro/lib/python3.11/site-packages/gopro_overlay/gpmf/gpmf.py", line 315, in accept getattr(visitor, method)(self) File "/home/roberto/.pyenv/versions/3.11.4/envs/gopro/lib/python3.11/site-packages/gopro_overlay/gpmf/visitors/gps.py", line 98, in vi_GPSU self._basetime = item.interpret() ^^^^^^^^^^^^^^^^ File "/home/roberto/.pyenv/versions/3.11.4/envs/gopro/lib/python3.11/site-packages/gopro_overlay/gpmf/gpmf.py", line 310, in interpret return interpret_item(self, scale=scale) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/roberto/.pyenv/versions/3.11.4/envs/gopro/lib/python3.11/site-packages/gopro_overlay/gpmf/gpmf.py", line 226, in interpret_item return interpreters[item.fourcc](item, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/roberto/.pyenv/versions/3.11.4/envs/gopro/lib/python3.11/site-packages/gopro_overlay/gpmf/gpmf.py", line 108, in _interpret_gps_timestamp return datetime.datetime.strptime( ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/roberto/.pyenv/versions/3.11.4/lib/python3.11/_strptime.py", line 568, in _strptime_datetime tt, fraction, gmtoff_fraction = _strptime(data_string, format) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/roberto/.pyenv/versions/3.11.4/lib/python3.11/_strptime.py", line 349, in _strptime raise ValueError("time data %r does not match format %r" % ValueError: time data '1980000970000.00' does not match format '%y%m%d%H%M%S.%f'

time4tea commented 10 months ago

Hi. Thanks for your interest in the software. This is a known issue in the gopro firmware and has been reported to them.you can find more info in #141 - right now I haven't created a workaround for this problem... it maybe its time...

time4tea commented 10 months ago

There is a workaround for this in 0.124.0 - Should be available in PyPI very soon.