Skip to content

Location (GPS) from videofiles not always correctly parsed #391

@dhlavaty

Description

@dhlavaty

Hi there.

When working with exiftool on a Immich app, I've noticed that some videos' GPS location is not correctly parsed. ( my original issue immich-app/immich#26101 )

After a longer investigation, I found out that exiftool prefers Location Information tag over other metadata to determine a location.

I found out that Location Information often contains <err> value. But other metadata are still good, so correct location can still be extracted. I've found many videos in my library (iPhone 4S, Canon PowerShot S100) with such problem.

I've developed a fix for Immich that works. But the question is whether this should be fixed directly in exiftool? Is it a data issue in those video files, or the tool is not handling data correctly?

Here an example video: https://github.com/user-attachments/files/25212785/immich-gps-problem.mp4.zip

By running exiftool -a -n immich-gps-problem.mp4:

# I only left the location data

GPS Coordinates                 : 37.4039 -122.0131 13
GPS Coordinates (slk)           : 37.4039 -122.0131 13
GPS Coordinates (slk-SK)        : 37.4039 -122.0131 13
Location Information (slk)      : (none) Role=shooting Lat=37.40388 Lon=-122.01309 Alt=13.00 Body=earth Notes=
GPS Altitude                    : 13
GPS Altitude Ref                : 0
GPS Latitude                    : 37.4039
GPS Longitude                   : -122.0131
Location Information            : <err>
GPS Altitude                    : 13
GPS Altitude                    : 13
GPS Altitude                    : 0
GPS Altitude Ref                : 0
GPS Altitude Ref                : 0
GPS Latitude                    : 37.4039
GPS Longitude                   : -122.0131
GPS Latitude Ref                : N
GPS Longitude Ref               : W

Notice the <err> value. By importing such a video file to Immich, it does not parse the location correctly.

So I removed this field using exiftool -LocationInformation= -overwrite_original immich-gps-problem.mp4.

Running exiftool -a -n immich-gps-problem.mp4 now, returns:

# I only left the location data

GPS Coordinates                 : 37.4039 -122.0131 13
GPS Coordinates (slk)           : 37.4039 -122.0131 13
GPS Coordinates (slk-SK)        : 37.4039 -122.0131 13
GPS Altitude                    : 13
GPS Altitude Ref                : 0
GPS Latitude                    : 37.4039
GPS Longitude                   : -122.0131
GPS Altitude                    : 13
GPS Altitude                    : 13
GPS Altitude Ref                : 0
GPS Latitude                    : 37.4039
GPS Longitude                   : -122.0131
GPS Latitude Ref                : N
GPS Longitude Ref               : W
GPS Position                    : 37.4039 -122.0131

By importing video file to Immich now, everything works correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions