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

POC - Restructure video processing and add gpx, nmea and exiftool runtime support #654

Merged
merged 19 commits into from
Sep 6, 2023

Conversation

malconsei
Copy link
Contributor

@malconsei malconsei commented Aug 18, 2023

This PR is a proof of concept covering video processing (process command applied to videos)

Restructuring:

  • Extract common logic for track handling
  • Consider all track sources the same

New features:

  • Support GPX and NMEA tracks for videos
  • Support invoking exiftool internally
  • Support chaining multiple parsers and/or the same parser with different options
  • Support defining filename patterns for data sources based on the original video filename
    • %f: full video filename
    • %g: video filename without extension
    • %e: video extension (inclusive of .)

Examples:

# short format
python -m mapillary_tools.commands --verbose  process --video_geotag_source exiftool_runtime  videos/insta360/

# long format - with options
python -m mapillary_tools.commands --verbose  process --video_geotag_source {"source": "exiftool_xml", "pattern": "../%g.insv.xml"}  videos/insta360/converted/

# multiple sources
python -m mapillary_tools.commands --verbose  process --video_geotag_source {"source": "gpx", "pattern": "../%g.gpx"} --video_geotag_source {"source": "gpx", "pattern": "../%g.xml"}  videos/gopro/

TODO:

  • Tests
  • Fixes :P

Copy link
Member

@ptpt ptpt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. This is pretty much a redo of all the geotag_* modules but much more clear and well organized!

mapillary_tools/commands/process.py Show resolved Hide resolved
mapillary_tools/commands/process.py Outdated Show resolved Hide resolved
):
vars_args["duplicate_angle"] = 360
if vars_args["geotag_sources"]:
# gpx:format=A,exif:format=B -> [{source: 'gpx', 'format': 'A'}, {'source': 'exif', format': 'B'}]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move all the parsing logic to process_geotag_properties.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's part of "Wire them better" in the TODO list :) but I first wanted to define the options format. We can maybe discuss it tomorrow.

mapillary_tools/geotag/geotag_images_from_nmea_file.py Outdated Show resolved Hide resolved
@malconsei malconsei force-pushed the refactor-poc branch 4 times, most recently from a4a4ed6 to e45ff97 Compare August 25, 2023 13:10
@malconsei malconsei force-pushed the refactor-poc branch 2 times, most recently from db20813 to c06854c Compare August 25, 2023 14:11
mapillary_tools/commands/process.py Show resolved Hide resolved
@malconsei malconsei merged commit 7c895e4 into main Sep 6, 2023
13 checks passed
@malconsei malconsei deleted the refactor-poc branch September 6, 2023 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants