Repository navigation
Match samples to videos of the same name by their paths - #910
Merged
caglarpir merged 1 commit intoOct 24, 2026
Merged
Conversation
sample_video writes the samples of a video in a folder named after it, at the video's path relative to the folder of videos it samples: the samples of VIDEOS/x/clip.mp4 go to OUT/x/clip.mp4/. The legacy gopro_videos, blackvue_videos and camm sources, and exiftool_xml with a pattern in video_process, matched samples to videos by the name of that folder alone, so all the samples of videos of the same name in different folders were taken for those of one of them. With two BlackVue videos named clip.mp4 in the folders x and y, `video_process VIDEOS OUT --geotag_source blackvue_videos` placed the 13 samples of one along the track of the other, up to 2.1 km off, and failed the 50 samples of the other, with exit 0; exiftool_xml did the same. Match a sample to the video whose path, relative to the deepest folder that holds all the videos, its folder ends with, the longest of them if several do. A sample whose folder ends with none of them, which could be of any of them, is failed with "Cannot tell which of the 2 videos named clip.mp4 this is a frame of", rather than placed along one of them: such as the samples of one of the videos sampled alone, and geotagged by the folder of both. That is a geotagging error, which a later source can still replace. With a single video of a name, its samples are found wherever they are, as before. A sample that two videos match equally well, such as videos of the same name on different drives, which no path tells apart, is failed the same way. Paths are made absolute before they are compared, also where they do not exist: Path.resolve() leaves those relative on Windows with Python 3.9 and 3.10. On the two videos, the 63 samples are now geotagged by the legacy source and by exiftool_xml as by the video's own GPS (0 m off), and as exiftool_xml geotags the samples of each video alone. So are those of two videos of the same name one above the other (VIDEOS/clip.mp4 and VIDEOS/x/clip.mp4, and VIDEOS/a/clip.mp4 and VIDEOS/a/b/clip.mp4). process of the frames of videos of different names, by their legacy sources, of a single video by its file or folder, of a mixed folder and an image sequence, and video_process with the default sources, the legacy source and exif, do not change.
caglarpir
force-pushed
the
match-samples-by-relative-path
branch
from
October 24, 2026 12:55
6ed7492 to
8fc58cc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #909; review the last commit.
sample_video writes the samples of a video in a folder named after it,
at the video's path relative to the folder of videos it samples: the
samples of VIDEOS/x/clip.mp4 go to OUT/x/clip.mp4/. The legacy
gopro_videos, blackvue_videos and camm sources, and exiftool_xml with a
pattern in video_process, matched samples to videos by the name of that
folder alone, so all the samples of videos of the same name in
different folders were taken for those of one of them. With two
BlackVue videos named clip.mp4 in the folders x and y,
video_process VIDEOS OUT --geotag_source blackvue_videosplaced the 13 samples of onealong the track of the other, up to 2.1 km off, and failed the 50
samples of the other, with exit 0; exiftool_xml did the same.
Match a sample to the video whose path, relative to the deepest folder
that holds all the videos, its folder ends with, the longest of them if
several do. A sample whose folder ends with none of them, which could
be of any of them, is failed with "Cannot tell which of the 2 videos
named clip.mp4 this is a frame of", rather than placed along one of
them: such as the samples of one of the videos sampled alone, and
geotagged by the folder of both. That is a geotagging error, which a
later source can still replace. With a single video of a name, its
samples are found wherever they are, as before.
On the two videos, the 63 samples are now geotagged by the legacy source
and by exiftool_xml as by the video's own GPS (0 m off), and as
exiftool_xml geotags the samples of each video alone. So are those of
two videos of the same name one above the other (VIDEOS/clip.mp4 and
VIDEOS/x/clip.mp4, and VIDEOS/a/clip.mp4 and VIDEOS/a/b/clip.mp4).
process of the frames of videos of different names, by their legacy
sources, of a single video by its file or folder, of a mixed folder and
an image sequence, and video_process with the default sources, the
legacy source and exif, do not change.
Unit and integration tests, doctests,
mypy --python-version 3.9,ruff check,ruff format --checkandusort diffare clean.