Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash due to bad timestamp in MP4 #40

Closed
tve opened this issue Jun 18, 2022 · 7 comments
Closed

Crash due to bad timestamp in MP4 #40

tve opened this issue Jun 18, 2022 · 7 comments
Labels
wontfix This will not be worked on. This is unlikely to change. Never say never, but unlikely

Comments

@tve
Copy link

tve commented Jun 18, 2022

Either the parsing is pulling out the wrong bytes or the camera output garbage, I haven't checked. File uploaded to https://s3.amazonaws.com/s3.voneicken.com/GH010359.MP4 ...
Using a fresh checkout of 0bc244d (current as of 6/17).

> gopro-dashboard.py GH010359.MP4 GH010359-ov.mp4
Input file has size Dimension(x=2704, y=1520)
Timer(loading timeseries - Called: 1, Total: 1.46173, Avg: 1.46173, Rate: 0.68)
Timer(program - Called: 1, Total: 1.46179, Avg: 1.46179, Rate: 0.68)
Traceback (most recent call last):
  File "gopro-dashboard.py", line 91, in <module>
    gopro_frame_meta = framemeta_from(
  File "framemeta.py", line 204, in framemeta_from
    return parse_gopro(gpmd_from, units, metameta)
  File "framemeta.py", line 199, in parse_gopro
    return framemeta_from_meta(GoproMeta.parse(gpmd_from), units, metameta=metameta)
  File "framemeta.py", line 185, in framemeta_from_meta
    meta.accept(
  File "gpmd.py", line 306, in accept
    item.accept(visitor)
  File "gpmd.py", line 184, in accept
    i.accept(container_visitor)
  File "gpmd.py", line 184, in accept
    i.accept(container_visitor)
  File "gpmd.py", line 229, in accept
    getattr(visitor, method)(self)
  File "gpmd_visitors_gps.py", line 72, in vi_GPSU
    self._basetime = interpret_item(item)
  File "gpmd.py", line 140, in interpret_item
    return interpreters[item.fourcc](item, scale)
  File "gpmd.py", line 46, in _interpret_gps_timestamp
    return datetime.datetime.strptime(item.rawdata.decode('utf-8', errors='replace'), '%y%m%d%H%M%S.%f').replace(
  File "/usr/lib/python3.10/_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "/usr/lib/python3.10/_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '2225525525425525' does not match format '%y%m%d%H%M%S.%f'
@time4tea
Copy link
Owner

Please do send me the video if possible. I'm on vacation right now till next week. I don't really know how to approach this problem without an example, as a code review didn't really give any clues.

@tve
Copy link
Author

tve commented Jun 21, 2022

The download link is/was in the issue above. Does it not work for you?

@time4tea
Copy link
Owner

Ah. I think maybe I read a previous version that said "upload coming"? I'll download it when I'm back! Thanks!

@time4tea time4tea added the investigating Under investigation label Jun 27, 2022
@time4tea
Copy link
Owner

I have raised an issue in the GoPro project to ask about this a bit more: gopro/gpmf-parser#162

@time4tea time4tea added the awaiting-upstream Need information/changes from an upstream source label Jun 30, 2022
@time4tea
Copy link
Owner

@tve - question from the GoPro folks - have you seen this error more than once? I think maybe you raised this in #22 but is this a repeat of the same occurrence or a new one?

@time4tea
Copy link
Owner

Looking at the filenames you shown - it looks like it is a new occurrence of the same problem.
I can see that the previous time, the "bad" data was also "2225525525425525". I'll pass this on.

@time4tea
Copy link
Owner

time4tea commented Jul 5, 2022

I think probably that this wouldn't be productive to fix - while processing corrupted streams can be useful in some cases, the added complexity around detecting and handling data corruption doesn't seem worthwhile for this project, and there is quite a lot of benefit in just crashing out when there is a problem, as it makes bugs easy to spot.
It may be possible to patch affected files by looking for a known binary sequence and replacing it with a valid GPS timestamp.

@time4tea time4tea closed this as completed Jul 5, 2022
@time4tea time4tea added wontfix This will not be worked on. This is unlikely to change. Never say never, but unlikely and removed investigating Under investigation awaiting-upstream Need information/changes from an upstream source labels Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on. This is unlikely to change. Never say never, but unlikely
Projects
None yet
Development

No branches or pull requests

2 participants