KonradIT / mmt

Media Management Tool - make importing videos/photos from GoPro and other action cameras/drones a little bit more bearable.
http://mmt.camera
Apache License 2.0
109 stars 12 forks source link

Add missing geotags #107

Open inode64 opened 1 year ago

inode64 commented 1 year ago

As an improvement, a post-production can be carried out after the media import process of the kind https://github.com/fxstein/GoProX which allows a workflow.

After importing the media, the files that have been recorded without geotags are moved to their correct locations to then automatically add the tag to the media that do not have it.

You can add an "add-geotags" command, which checks the destination, inside the location folders and adds the location to those files that do not contain it.

But this can add a problem when importing again, as the files could be copied again being duplicated. For this reason, it would be necessary to store in a small database the files (file, date and time, for example, to distinguish, since you can have several GoPro or repeat the name) that have been copied, so that it is not duplicated and we do not lose the modifications by the "add-geotags" command. With the latter, we also improve the copying process, since we will not copy the files already copied before.

KonradIT commented 1 year ago

I don't get this one.

After importing the media, the files that have been recorded without geotags are moved to their correct locations to then automatically add the tag to the media that do not have it.

How would the program know where the file was shot if the camera does not have a clean GNSS lock?

You can add an "add-geotags" command, which checks the destination, inside the location folders and adds the location to those files that do not contain it.

Again, the program cannot make a lossy association between file and location. Consider this example:

├───25-03-2023
│   ├───Valle de Bravo México
│   │   └───DJI Device
│   │       ├───photos
│   │       └───videos
│   ├───La Boquilla México
│   │   └───DJI Device
│   │       ├───videos
│   │       └───photos
│   ├───El Santuario México
│   │   └───DJI Device
│   │       └───videos
│   ├───Estado de México México
│   │   └───DJI Device
│   │       ├───videos
│   │       └───photos
│   └───HERO11 Black
│       └───videos
│           └───3840x3360 50

The GoPro could not acquire GNSS lock, so mmt wrote the files to the pathn /25-03-2023/HERO11 Black vs /25-03-2023/Valle de Bravo México/HERO11 Black where the footage was shot. You can move the HERO11 Black folder in this case to the correct location if another camera was shooting video at the same time (in my case a drone, which did get GNSS lock).

For this reason, it would be necessary to store in a small database the files (file, date and time, for example, to distinguish, since you can have several GoPro or repeat the name) that have been copied, so that it is not duplicated and we do not lose the modifications by the "add-geotags" command.

MMT is fully stateless, no database or storage will be added barring configuration files

With the latter, we also improve the copying process, since we will not copy the files already copied before.

MMT detects which files have already been copied to the destination directory and skips over them.

inode64 commented 1 year ago

After the import process, you move the files from the folders without GPS data to their corresponding location, so that the system can update the GPS data of the adjacent images using numerical correlation.

Example:

├───25-03-2023 │ ├───Valle de Bravo México │ │ └───DJI Device │ │ ├───photos │ │ └───videos mar 26 07:29 GX010969.MP4 -> GPS OK mar 26 09:45 GX010979.MP4 -> GPS BAD -> fix location from GX010969.MP4 │ ├───La Boquilla México │ │ └───DJI Device │ │ ├───videos mar 26 09:36 GX010978.MP4 -> GPS OK mar 26 09:19 GX010976.MP4 -> GPS BAD -> fix location from GX010978.MP4 or GX010973.MP4 mar 26 09:06 GX010973.MP4 -> GPS OK mar 26 08:57 GX010970.MP4 -> GPS OK mar 26 10:35 GX010989.MP4 -> GPS OK mar 26 10:33 GX010988.MP4 -> GPS OK │ │ └───photos │ ├───El Santuario México │ │ └───DJI Device │ │ └───videos │ ├───Estado de México México │ │ └───DJI Device │ │ ├───videos mar 26 09:59 GX010980.MP4 -> GPS BAD -> fix location from GX010999.MP4 mar 26 11:00 GX010999.MP4 -> GPS OK mar 26 10:56 GX010998.MP4 -> GPS BAD -> fix location from GX010999.MP4 or GX010995.MP4 mar 26 10:47 GX010995.MP4 -> GPS OK mar 26 10:37 GX010991.MP4 -> GPS OK mar 26 10:36 GX010990.MP4 -> GPS OK │ │ └───photos │ └───HERO11 Black │ └───videos │ └───3840x3360 50

inode64 commented 1 year ago

I have found a good solution, it is to use a gpx track and search the media that does not have gpotags and search the track for the time select the gps position at that time. I've already started developing it, as soon as I have it I'll send you a commit

KonradIT commented 1 year ago

Ah not a bad idea!

Something I've developed but not published yet is using Google Maps / Strava / Garmin GPX sources, usually recorded over several hours to match HERO11 Black Mini footage (HERO11 Black has GPS antenna, Mini does not).

inode64 commented 1 year ago

If you have something already done, if you can pass it on, it saves me a little time and we can collaborate. I practice hiking and I had also thought about creating a script to review all my photos and videos that I have and add the geotag to the ones that were missing.

inode64 commented 1 year ago

I have created a script in Go to process my old images without geotags. It was difficult for me, especially when choosing the libraries, many of them are discontinued, especially for storing exif data, in the end I opted for go-exiftool, which I use in linux and it works very well, but when creating the project for windows, now it turns out that it can't find the executable :-(

https://github.com/inode64/SyncMediaTrack

Nothing else I can prepare it for mmt