Skip to content

Conversation

@UnravelSports
Copy link
Contributor

Hi,

I've rewritten a small part of the SecondSpectrum tracking data parser to hopefully accomodate more meta data formats.

It works with the old data, but it now also works with a broader set of meta data.

I've introduced find_json_key() a function to search metadata a bit more flexibly. For example, some times "pitchLength" exists in the root, while other times it might exist in "Stadium"/"PitchLength". find_json_key will search for a value pitch length (disregarding capital letters) and then return the first found value.

I think an approach like this might be a way forward to allow for way more flexible metadata parsing.

In total my approach does:

  • Search for pitch length and width
  • Search for fps, if it doesn't exist, extract it from the first 25 frames
  • Extract periods if they are in the metadata, if not parse them from the frames using self.__periods_from_raw_data
  • Finally, we also construct home and away team values a bit more flexibly. I'm not 100% satisfied with this approach, but that's mainly because here structures and available information might be all over the place, but I don't know, since I've only got 2 different meta data files.

Eitherway, it should be a lot more flexible already.

UnravelSports [JB] added 2 commits July 5, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant