The video analysis capabilities you describe constitute a whole active field of research/engineering called (visual) simultaneous localization and mapping (SLAM or VSLAM for short). The pathfinding would be the easy part compared to constructing the map from video data.
Many frameworks/tools/libraries for such analyses exist. To my knowledge, none of them are really reliable or easy to use at this point in time (2023) and a lot of them need powerful hardware to perform the necessary processing in a reasonable amount of time. But I could be wrong and it can be fun to experiment with them yourself in any case.
You can find some freely available open-source VSLAM frameworks, libraries and tools e.g. under the visual-slam topic on GitHub. For instance, stella_vslam is one example, but there are many more and new ones come out all the time.
I expect that the most polished of this kind of software is being developed behind closed doors for commercial/industrial/military use - not something ordinary people can get their hands on.