Change incorrect GPS location for MP4 files

Started by pmcabinet, November 06, 2024, 10:29:23 PM

Previous topic - Next topic

pmcabinet

I first noticed this problem with a smallish MP4 file with incorrect GPS coordinates (the camera got it wrong). If I call up the map and drag the location marker to the correct position then the pencil icon will appear on the thumbnail - but each time I click to write back, the location marker moves straight back to its original position.

This happens whichever method I use to assign the new location. Then I discovered none of my MP4 files will allow changes to location.

Metadata Analyst app does not show any metadata errors apart from ' XMP-exif GPS Altitude missing' - which I don't think is relevant(?) The files are not protected. Why only MP4 files?

I don't think I have enough experience to dive into the Metadate Mechanic (if that is relevant), so I'm wondering how I can correct the location(s)?

axel.hennig

Hard to tell without an example file. Can you upload a sample file (just 1 or 2 secs, showing "nothing") to your cloud and post the link here.


Mario

Do you use IMatch for longer, e.g. before version 2021?
Are these new MP4 files?

Did you follow the instructions to import XMP data into the MP4 file: Importing XMP Metadata
In 2021, IMatch switched XMP metadata for MP4, MOV and QT files from external storage (XMP sidecar files) to embedded XMP.

If you have an XMP file for the MP4 file, it will "override" the embedded XMP metadata.
Check with Windows Explorer. Follow the instructions in the help topic linked to above.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

axel.hennig

I've imported your video, but it does not have any GPS metadata in it. Then I set the location marker to somewhere and clicked the "Apply" button in the Map panel. Pencil appears -> Write-back metadata. Everything fine. Re-locate location marker to somewhere else. Apply-button -> Pencil appears -> Write-back metadata. Again, everything fine. Location marker does not move back.

I think the problem with your uploaded video is that Google manipulated the metadata within your video after uploading. So I have your video with different metadata compared to the original video on your Computer.

Please do the following:
  • Check if what Mario wrote in his post solves your problem.
  • zip your video file (*.zip, *.7z,...) and upload the zipped-file again to your Cloud and post the link here (hopefully this will not "destroy" the metadata again)

Just to show that Google (might) have changed your video-metadata (or you have done something with the video in another software-program):

sc.jpg


pmcabinet

I first used iMatch in the 2021 version when MP4 files to that date were imported automatically in setting up iMatch. Actually, I have very few MP4 files (which span the years 2014-2024) in my database and they are mostly incidental, i.e. of no real importance in my work (apart from a few). So, some old without location data, some new with fairly accurate location.

Most of the files which do contain GPS data have it fairly accurately; it was when I spotted a wrong one that my curiosity was aroused.

I tried the processing indicated in Mario's reply but all the files were skipped - so I presume there is no .XMP file associated. In the default metadata panel only the create date and GPS co-ordinates are listed - adding a description and keywords writes back OK, but checking the GPS details gives the warning (screenshot). How to find and delete these duplicate tags?

Google is a complete pain in messing with files; here is a Zip file (OneDrive) of MP4 in question: 
https://1drv.ms/u/s!AuMD4Qmq_SZhg_0vTuFJs-YYX5_HJA?e=0G07fM

Can I create an XMP file myself? (Naturallly, you don't need to guess I have limited tech knowledge!)

 


Mario

#6
QuoteHow to find and delete these duplicate tags?
Which layout did you use (name?)
Did you follow the advice in release notes to re-import the standard layouts as I have modified them over the years?


QuoteCan I create an XMP file myself? (Naturallly, you don't need to guess I have limited tech knowledge!)
As per XMP standard (aka all major players do it that way) MP4 files use embedded XMP, not XMP in sidecar files. Creating an XMP sidecar files would only cause problems.

I have downloaded the video.
Opened the map panel.
Moved the file marker a bit down and to the right.
From 51.417504,-0.091 to 51.415651,-0.09011
Write back.
ExifTool reports no problems.
The new coordinates of the file "stick".
Even a forced update or removing the file from the database and adding it again retains the coordinates I have assigned.

Repeated the steps, this time changing the "created" GPS coordinates manually in the Metadata Panel, in the "6. IPTC Location" layout.

Writing back. No problems. New coordinates stick and show correctly in the file.

I can see no problem.
Please double-check (in Windows Explorer) that there is no XMP file with the same name as the video in the same folder as the video.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

pmcabinet

This is strange.

I use the Default Metadata layout almost exclusively, occasionally Describe. If the modified standard layouts were not included in iMatch 2023 or subsequent updates, then I have not re-imported any. I do read the release notes for updates, but perhaps not as carefully as I should.

The layout options I have at present are: (screenshot) As you can see, "6. IPTC Location" layout is not present.

iMatch automatically imported the zip file I had created for posting (what does iMatch do with zip files?), and when I checked Windows Explorer there was now a new XMP file with the same name as the MP4. 

I removed the MP4 file and its zip file from my database and deleted the XMP from the containing ('Videos') folder. In Explorer, I unzipped the file to a new folder. iMatch imported the new folder with file. (I thought, by this means, the metadata might be 'rewritten'). Location could be changed on the map until it was written back, when the location marker sloped back to its original position.

Either there is a setting in my database which is preventing change, or something magical is happening to the file when Mario imports it. Which could it be?




axel.hennig

I was able to reproduce the issue of "pmcabinet" sometimes.

What did I do:
- Import the video.
- GPS is at:
sc01.jpg


- Go to the Map-panel and pick another location and click "Apply the target maker coordinates to all selected files" in the Map-panel.
- Now GPS looks the following (out of sync):
sc02.jpg



- Write-back metadata (Pencil).
- Now GPS is (still out of sync):
sc03.jpg



So, right now GPS is out of sync. I don't know why, but sometimes it happened to me that the GPS-marker in the Map-panel "jumped back" and sometimes not. I cannot reproduce it every time... happens or happens not -> might be difficult or nearly impossible to fix.

My suggestion would be: Delete the QuickTime GPS information and just stay with the others. But before doing this, try with a test-database and some test videos and make a backup of everything before applying to your real videos.

axel.hennig

I think I found a way to re-produce this issue every time:

  • Import video
  • Pick another location in the Map-panel (target-marker somewhere else)
  • Click "Apply the target maker coordinates to all selected files"
  • Write-back metadata
  • On the map, still everything seems to be fine.
  • Apply a rating (I've just pressed "5" on the Numpad)
  • Write-back metadata

Now (for me) the target-marker "jumped back" (to UK) and it happend every time I've done this.

Still, I think the problem is the QuickTime GPS metadata, because it gets never updated (out of sync).

Mario

The sample video provided by the OP contains an GPS coordinates in XMP EXIF and IPTCExt. This is what IMatch imports:

[XMP-iptcExt]  Location Created GPS Latitude  : 51 deg 25' 3.01" N
[XMP-iptcExt]  Location Created GPS Longitude  : 0 deg 5' 27.60" W
[XMP-exif]      GPS Latitude                    : 51 deg 25' 3.01" N
[XMP-exif]      GPS Longitude                  : 0 deg 5' 27.60" W
[XMP-exif]      GPS Date/Time                  : 2024:11:07 00:07:52
[Composite]    GPS Latitude                    : 51 deg 25' 3.36" N

Quote from: axel.hennig on November 11, 2024, 10:16:53 AMMy suggestion would be: Delete the QuickTime GPS information and just s
The file has some GPS data in [UserData], which IMatch does not know about or touch (except for importing it).
Changing coordinates in the Map Panel will update native GPS (if the file has native GPS), XMP EXIF GPS and XMP IPTCExt GPS. Not [User Data] or anything else.

QuoteNow GPS looks the following (out of sync):
Which tag did you use for your "QuickTime GPS" element? QuickTime::UserData\\xa9xyz\GPSCoordinates ?

IMatch does not use this tag in any way, except for importing it. the xa9xyz id also indicates that this is a made up tag or a tag that is named differently between QuickTime versions. ExifTool does it that way in this case.

If you want to update this tag for some reason, you can use a Metadata Template.


Quotethat the GPS-marker in the Map-panel "jumped back"
A way to produce this is to move the pin, and while the Map Panel and IMatch are still processing the change and IMatch is about to communicate with the browser to update the map, you move the pin again (must be quick). In that case, the second move may be lost when the browser reloads/updates the map.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

Quote from: axel.hennig on November 11, 2024, 10:33:19 AMI think I found a way to re-produce this issue every time:
Does work just fine here. I can write back any number of times, move the pin or apply a target marker and write back any number of times. The pin stays where I put it. The GPS information in the [User Data] is of no relevance to IMatch.

Most likely I don't see the problem since I use IMatch 2025, which has a number of GPS-related bug fixes and enhancements.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

axel.hennig

Quote from: Mario on November 11, 2024, 10:45:47 AMThe file has some GPS data in [UserData], which IMatch does not know about or touch (except for importing it).
Changing coordinates in the Map Panel will update native GPS (if the file has native GPS), XMP EXIF GPS and XMP IPTCExt GPS. Not [User Data] or anything else.
Yes, but when doing a write-back Exiftool might use the QuickTime GPS and overwrite XMP EXIF GPS (maybe due to some internal prioritization).


Quote from: Mario on November 11, 2024, 10:45:47 AMWhich tag did you use for your "QuickTime GPS" element? QuickTime::UserData\\xa9xyz\GPSCoordinates ?
I've used: {File.MD.QuickTime::UserData\\xa9xyz\GPSCoordinates\0}


Quote from: Mario on November 11, 2024, 10:45:47 AMA way to produce this is to move the pin, and while the Map Panel and IMatch are still processing the change and IMatch is about to communicate with the browser to update the map, you move the pin again (must be quick). In that case, the second move may be lost when the browser reloads/updates the map.
I haven't done this. Waited long enough for IMatch to update everything. Could re-produce the issue still every time by following the steps in my above post (using the Rating).

axel.hennig

Quote from: Mario on November 11, 2024, 10:51:14 AMDoes work just fine here. I can write back any number of times, move the pin or apply a target marker and write back any number of times. The pin stays where I put it. The GPS information in the [User Data] is of no relevance to IMatch.
Have you also tried with the Rating-step mentioned in my post above?


Quote from: Mario on November 11, 2024, 10:51:14 AMMost likely I don't see the problem since I use IMatch 2025, which has a number of GPS-related bug fixes and enhancements.
Maybe, but something we can't check.

Mario

Quote from: axel.hennig on November 11, 2024, 11:31:54 AMHave you also tried with the Rating-step mentioned in my post above?
Yes. I changed the rating and wrote back. Changed the label and wrote back. Applied an AutoFill and wrote back. Pin sticks. I can see what IMatch is writing via the ExifTool output panel and also what's in the file afterwards.

QuoteMaybe, but something we can't check.
If this still persists in the 2025 version, I will look into it.
Probably changing the rating or other metadata in IMatch 2023 triggered a situation where GPS data was not updating in the database in certain situations due to a non-reset flag. A bug I have fixed in the 2025 code base.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

pmcabinet

Some interesting info here. Thanks for looking into it so closely (credit to axel.hennig in particular).

At least I can let it rest now - until 2025!