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
106 stars 11 forks source link

use better gps measurement for videos #108

Closed inode64 closed 1 year ago

inode64 commented 1 year ago

It has happened to me in many videos that the first GPS measurements result in incorrect locations, I have analyzed the tags and seen that when the speed is 0 it is not a correct GPS value

I get the data with exiftool -ee video.mp4

example:

.
.
.
GPS Measure Mode                : 3-Dimensional Measurement
GPS Date Time                   : 2023:02:18 13:39:35.100
GPS Horizontal Positioning Error: 1.64
GPS Latitude                    : 0 deg 0' 0.00" N
GPS Longitude                   : 0 deg 0' 0.00" E
GPS Altitude                    : -17 m
GPS Speed                       : 0
GPS Speed 3D                    : 0
GPS Measure Mode                : 3-Dimensional Measurement
GPS Date Time                   : 2023:02:18 13:39:35.300
GPS Horizontal Positioning Error: 1.64
GPS Latitude                    : 19 deg 32' 54.09" N
GPS Longitude                   : 12 deg 56' 8.08" W
GPS Altitude                    : 3369.107 m
GPS Speed                       : 0
GPS Speed 3D                    : 0
GPS Measure Mode                : 3-Dimensional Measurement
GPS Date Time                   : 2023:02:18 13:39:35.400
GPS Horizontal Positioning Error: 1.64
GPS Latitude                    : 32 deg 11' 3.69" N
GPS Longitude                   : 14 deg 28' 14.32" W
GPS Altitude                    : 3977.121 m
GPS Speed                       : 0.008
GPS Speed 3D                    : 0
GPS Measure Mode                : 3-Dimensional Measurement
GPS Date Time                   : 2023:02:18 13:39:37.400
GPS Horizontal Positioning Error: 1.64
GPS Latitude                    : 40 deg 46' 8.78" N
GPS Longitude                   : 0 deg 19' 44.77" E
GPS Altitude                    : 721.89 m
GPS Speed                       : 0.011
GPS Speed 3D                    : 0.02
GPS Measure Mode                : 3-Dimensional Measurement
GPS Date Time                   : 2023:02:18 13:39:37.500
GPS Horizontal Positioning Error: 1.64
GPS Latitude                    : 40 deg 46' 8.78" N
GPS Longitude                   : 0 deg 19' 44.77" E
GPS Altitude                    : 722.055 m
GPS Speed                       : 0.014
GPS Speed 3D                    : 0.01
GPS Measure Mode                : 3-Dimensional Measurement
GPS Date Time                   : 2023:02:18 13:39:37.700
GPS Horizontal Positioning Error: 1.64
GPS Latitude                    : 40 deg 46' 8.78" N
GPS Longitude                   : 0 deg 19' 44.77" E
GPS Altitude                    : 722.004 m
GPS Speed                       : 0.013
GPS Speed 3D                    : 0.01
GPS Measure Mode                : 3-Dimensional Measurement
GPS Date Time                   : 2023:02:18 13:39:37.800
GPS Horizontal Positioning Error: 1.64
GPS Latitude                    : 40 deg 46' 8.78" N
GPS Longitude                   : 0 deg 19' 44.77" E
GPS Altitude                    : 722.193 m
GPS Speed                       : 0.031
GPS Speed 3D                    : 0.03
GPS Measure Mode                : 3-Dimensional Measurement
GPS Date Time                   : 2023:02:18 13:39:39.800
GPS Horizontal Positioning Error: 1.62
GPS Latitude                    : 40 deg 46' 8.77" N
GPS Longitude                   : 0 deg 19' 44.77" E
GPS Altitude                    : 722.134 m
GPS Speed                       : 0.022
GPS Speed 3D                    : 0.02
.
.
.
.

but with the timelapse videos that there is little speed, below 0 it does not locate the video It looks like a problem with the gopro-utils/telemetry library, but I don't get that far in Go

Example:

.
.
.
.
GPS Date Time                   : 2023:02:18 13:39:35.100
GPS Horizontal Positioning Error: 1.64
GPS Latitude                    : 0 deg 0' 0.00" N
GPS Longitude                   : 0 deg 0' 0.00" E
GPS Altitude                    : -17 m
GPS Speed                       : 0
GPS Speed 3D                    : 0
GPS Measure Mode                : 3-Dimensional Measurement
GPS Date Time                   : 2023:02:18 13:39:35.300
GPS Horizontal Positioning Error: 1.64
GPS Latitude                    : 19 deg 32' 54.09" N
GPS Longitude                   : 12 deg 56' 8.08" W
GPS Altitude                    : 3369.107 m
GPS Speed                       : 0
GPS Speed 3D                    : 0
GPS Measure Mode                : 3-Dimensional Measurement
GPS Date Time                   : 2023:02:18 13:39:35.400
GPS Horizontal Positioning Error: 1.64
GPS Latitude                    : 32 deg 11' 3.69" N
GPS Longitude                   : 14 deg 28' 14.32" W
GPS Altitude                    : 3977.121 m
GPS Speed                       : 0.008
GPS Speed 3D                    : 0
GPS Measure Mode                : 3-Dimensional Measurement
GPS Date Time                   : 2023:02:18 13:39:37.400
GPS Horizontal Positioning Error: 1.64
GPS Latitude                    : 40 deg 46' 8.78" N
GPS Longitude                   : 0 deg 19' 44.77" E
GPS Altitude                    : 721.89 m
GPS Speed                       : 0.011
GPS Speed 3D                    : 0.02
GPS Measure Mode                : 3-Dimensional Measurement
GPS Date Time                   : 2023:02:18 13:39:37.500
GPS Horizontal Positioning Error: 1.64
GPS Latitude                    : 40 deg 46' 8.78" N
GPS Longitude                   : 0 deg 19' 44.77" E
GPS Altitude                    : 722.055 m
GPS Speed                       : 0.014
GPS Speed 3D                    : 0.01
GPS Measure Mode                : 3-Dimensional Measurement
GPS Date Time                   : 2023:02:18 13:39:37.700
GPS Horizontal Positioning Error: 1.64
GPS Latitude                    : 40 deg 46' 8.78" N
GPS Longitude                   : 0 deg 19' 44.77" E
GPS Altitude                    : 722.004 m
GPS Speed                       : 0.013
GPS Speed 3D                    : 0.01
GPS Measure Mode                : 3-Dimensional Measurement
GPS Date Time                   : 2023:02:18 13:39:37.800
GPS Horizontal Positioning Error: 1.64
GPS Latitude                    : 40 deg 46' 8.78" N
GPS Longitude                   : 0 deg 19' 44.77" E
GPS Altitude                    : 722.193 m
GPS Speed                       : 0.031
GPS Speed 3D                    : 0.03
GPS Measure Mode                : 3-Dimensional Measurement
GPS Date Time                   : 2023:02:18 13:39:39.800
GPS Horizontal Positioning Error: 1.62
GPS Latitude                    : 40 deg 46' 8.77" N
GPS Longitude                   : 0 deg 19' 44.77" E
GPS Altitude                    : 722.134 m
GPS Speed                       : 0.022
GPS Speed 3D                    : 0.02
.
.
.
.

Type:

Camera:

Component:

Checklist before approval:

KonradIT commented 1 year ago

Not sure if this is the way to go, considering the speed variable can be 0 and the location be correct (if the camera is stationary). Adjust your gps_accuracy value in the config like so:

$ cat ~/.mmt.yaml
gopro:
    gps_accuracy: 400 # 500 by default, lower is better
inode64 commented 1 year ago

ok, I'll try that parameter, But if you see the first log, you will see that first it is in a GPS location

GPS Date Time : 2023:02:18 13:39:35.300 GPS Horizontal Positioning Error: 1.64 GPS Latitude : 19 deg 32' 54.09" N GPS Longitude : 12 deg 56' 8.08" W GPS Altitude : 3369.107 m GPS Speed : 0 GPS Speed 3D : 0

and then jump to the correct location.

GPS Date Time : 2023:02:18 13:39:37.500 GPS Horizontal Positioning Error: 1.64 GPS Latitude : 40 deg 46' 8.78" N GPS Longitude : 0 deg 19' 44.77" E GPS Altitude : 722.055 m GPS Speed : 0.014 GPS Speed 3D : 0.01

and about the fixed camera, I have always seen GPS errors because they do not have a professional quality. And even then when done for precision measurements it leaves for several minutes to improve accuracy (but that's another level of GPS).

look at the second log and you will see that there is always a speed even if it is 0.014, 0.013, 0.022, etc...

KonradIT commented 1 year ago

Just confirmed with a static camera on the roof of a building, it does lead to

GPS Speed                       : 0.042
GPS Speed 3D                    : 0.05

Being set. So speed == 0 would indeed eliminate bad readings.