Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements to error handling, logging, and user feedback throughout the Mapillary tools codebase, with a focus on making validation messages clearer and more user-friendly. It also refactors the handling of maximum capture speed and improves exception management for video processing. The most important changes are grouped below:
User Feedback and Logging Improvements:
humanizelibrary to present file sizes and time deltas in a more readable format in logs and error messages (e.g., "2.3 MB" instead of raw bytes, "3 hours ago" instead of a timestamp). [1] [2] [3] [4] [5] [6]Error Handling and Exception Improvements:
MapillaryInvalidVideoErrorexception and improved error propagation for invalid or corrupt MP4 files by catching specific exceptions from bothsimple_mp4_parserandconstruct_mp4_parser. [1] [2] [3] [4] [5]Capture Speed and Sequence Validation Refactor:
MAX_CAPTURE_SPEED_KMHconstant (in km/h) instead ofMAX_AVG_SPEED(in m/s), and updated all related validation and error messages for clarity and consistency. [1] [2] [3] [4] [5] [6]General Code Quality Improvements:
RuntimeError) with more specific ones (ValueError) for invalid metadata handling.These changes together make the tool's output more understandable for users and developers, improve error diagnosis, and ensure more robust handling of edge cases during video and sequence processing.