ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: whiting123 on September 28, 2020, 05:00:15 PM

Title: Save GPS data from .mov
Post by: whiting123 on September 28, 2020, 05:00:15 PM
Hi,

I am extracting GPS data from a .mov file (KDLINKS X1 dash cam). Using the command exiftool -ee "gps*" FILE I can see all the values but how do I save the data. What I want is a file where the first column is time, second column latitude, third column longitude, ect. Is this possible?
Title: Re: Save GPS data from .mov
Post by: StarGeek on September 28, 2020, 05:27:12 PM
You would list the tags you want in the order you want, use the -csv option (https://exiftool.org/exiftool_pod.html#csv-CSVFILE), and redirect the output into a file.  For example
exiftool -ee -GPSLatitude -GPSLongitude -GPSAltitude -csv /path/to/file.mov >output.csv

Another option would be to create a geotrack, such as a .GPX file.  You can find instructions on how to do so under Inverse Geotagging (https://exiftool.org/geotag.html#Inverse).
Title: Re: Save GPS data from .mov
Post by: Phil Harvey on September 29, 2020, 07:59:17 AM
Unfortunately the -csv option does not work for extracting multiple duplicate tags (eg. timed GPS) from a single file.

For this, you would need to use -p, with a command something like this:

exiftool -n -p "$gpsdatetime,$gpslatitude,$gpslongitude" -ee FILE

- Phil
Title: Re: Save GPS data from .mov
Post by: lavAzza on January 10, 2023, 03:02:12 AM
Hi.
Help me, pls.
I get this output by command
exiftool -ee -G3 2022-12-25-14-22-37.MOV > out.txt...
[Doc1]          Sample Time                    : 0 s
[Doc1]          Sample Duration                : 1.00 s
[Doc1]          Text                            :  $GS:-4038,-2366,-3902 $G:2022-12-25 14:22:36-N51.727145-E54.964781-S000_END
[Doc1]          Text                            : $G:2022-12-25 14:22:36-N51.727145-E54.964781-S000_END
[Doc2]          Sample Time                    : 1.00 s
[Doc2]          Sample Duration                : 1.00 s
[Doc2]          Text                            :  $GS:-4094,-2446,-4094$G:2022-12-25 14:22:37-N51.727144-E54.964780-S000_END
[Doc2]          Text                            : $G:2022-12-25 14:22:37-N51.727144-E54.964780-S000_END
[Doc3]          Sample Time                    : 2.00 s
[Doc3]          Sample Duration                : 1.00 s
[Doc3]          Text                            :  $GS:4032,-2462,-3870$G:2022-12-25 14:22:38-N51.727143-E54.964780-S000_END
[Doc3]          Text                            : $G:2022-12-25 14:22:38-N51.727143-E54.964780-S000_END
...
Is there way to generate file with format
filename-Sample time-N-E
?
Or I need to process this output in Excel?
Title: Re: Save GPS data from .mov
Post by: Phil Harvey on January 10, 2023, 06:47:30 AM
This appears to be a GPS format not supported yet by ExifTool.  Can you send me a sample so I can add support for this?  My email is philharvey66 at gmail.com

- Phil
Title: Re: Save GPS data from .mov
Post by: lavAzza on January 10, 2023, 08:05:20 AM
Quote from: Phil Harvey on January 10, 2023, 06:47:30 AMThis appears to be a GPS format not supported yet by ExifTool.  Can you send me a sample so I can add support for this? 
Thank you, I sent the file.
Title: Re: Save GPS data from .mov
Post by: Phil Harvey on January 11, 2023, 02:09:52 PM
I got the sample and can decode the GPS information.

Two questions:

1. What was the camera make and model?

2. Do you know what these numbers are (typically they are some sort of accelerometer readings, but they seem to jump around a lot in your video)?:

3870 -2560 4038
4046 -2400 -3968
-4094 -2334 -3646
-3998 -2558 -3772
4080 -2496 3936
3854 -2560 -4094
3968 -2462 -3662
-3838 -2366 -3782
3900 -2432 4064
-3974 -2352 -3614
3504 -2400 3696
3710 -2446 3772
4032 -2366 -3598
-4032 -2424 -3598
3824 -2432 -4046
-4032 -2366 -3632
-3968 -2432 -3910
-3998 -2118 -3136
-3998 -2502 -3552
3534 -2544 3998
3390 -2590 4024
4032 -2446 -4032
3710 -2334 3998
3424 -2240 3906
4080 -2296 4094
3854 -2528 3910
3840 -2558 3998
3520 -2366 4064
-3854 -2432 -4094
3902 -2400 -3952
-3936 -2272 -3776
-3808 -2558 -3776
3760 -2496 -3376
3708 -2462 -4094
4046 -2496 -3904
-4024 -2492 -3936
3998 -2544 -3936
-3936 -2366 -3680
-3936 -2366 -3680
3772 -2480 3968
3906 -2306 4034
3710 -2432 3726
-4064 -2400 3936
3902 -2438 4092
3646 -2496 3968

- Phil
Title: Re: Save GPS data from .mov
Post by: lavAzza on January 11, 2023, 11:52:48 PM
Quote from: Phil Harvey on January 11, 2023, 02:09:52 PM1. What was the camera make and model?

2. Do you know what these numbers are (typically they are some sort of accelerometer readings, but they seem to jump around a lot in your video)?:
1. CARCAM Q7 https://carcam.ru/product/carcam_q7.html
2. Unfortunately I dont know what is this data. I dont know typical range of accelerometer sensor data, but this video shooted on bad road. There is win app that can view this video, may be it can help to know. https://datakam.ru/upload/medialibrary/509/bq4v90n9p9rxhr0la7bet693r7hhj256/RegistratorViewer_v.6.0.0.22.zip
Title: Re: Save GPS data from .mov
Post by: Phil Harvey on January 12, 2023, 12:53:46 PM
Thanks.  I think the "G" plot in your screen capture was likely the total G acceleration.  It would be more helpful if the app displayed separate X-Y-Z plots.  I can't run the app myself.  I think these numbers are likely the acceleration components, but I would be guessing at the scaling factor without seeing the separate plots.

- Phil
Title: Re: Save GPS data from .mov
Post by: lavAzza on January 13, 2023, 05:10:30 AM
This app can export data to csv format. If you want I sent it. I tryed to understand relation, but I cant.
https://drive.google.com/drive/folders/1BuZ6-X-vri1GnlLbbro8DZD63r6BDA9l?usp=sharing
Title: Re: Save GPS data from .mov
Post by: Phil Harvey on January 13, 2023, 09:51:50 AM
Got it, thanks.

I can convert the stored numbers to the ones reported by the Win app using these formulas:

my @acc = ( ($2+2432)/1000, ($3 + 361)/1000, ($1-3708)/1000 );
Note that the ordering also changed.  The 1st number reported by the Win app is the 2nd stored number ($2), etc.

ExifTool 12.55 will use this decoding, but I'm a bit worried that the arbitrary constants (2432, 361, -3708) may not be all that constant.  It would be good if you could test this when it is released to see if this conversion works for other videos.

- Phil
Title: Re: Save GPS data from .mov
Post by: lavAzza on January 15, 2023, 04:42:36 AM
Quote from: Phil Harvey on January 13, 2023, 09:51:50 AMExifTool 12.55 will use this decoding, but I'm a bit worried that the arbitrary constants (2432, 361, -3708) may not be all that constant.  It would be good if you could test this when it is released to see if this conversion works for other videos.
Ok, I will.
Thank you very much.
Title: Re: Save GPS data from .mov
Post by: lavAzza on February 14, 2023, 04:11:25 AM
Hello.
How I can get filename in the each string of the output?
When I run
exiftool -n -p "$filename,$gpsdatetime,$gpslatitude,$gpslongitude" -ee FILEI get
Warning: [Minor] Tag 'DocXXX:filename' not definedWith -m key I get first string the filename and other strings are time and coordinates.
Title: Re: Save GPS data from .mov
Post by: StarGeek on February 14, 2023, 10:28:32 AM
Do you get the proper data anyway?  The warning shouldn't affect the output otherwise.

Can you share a sample file?  I don't think I've seen that warning before.
Title: Re: Save GPS data from .mov
Post by: Phil Harvey on February 14, 2023, 09:17:27 PM
Use $main:filename if you want the same filename to appear on each line.  (It is in the Main group, not in a sub-document like the GPS tags.)

- Phil
Title: Re: Save GPS data from .mov
Post by: StarGeek on February 14, 2023, 09:38:47 PM
Ah, I get it now.  I'm a little slow today
Title: Re: Save GPS data from .mov
Post by: lavAzza on February 15, 2023, 05:01:43 AM
Quote from: Phil Harvey on February 14, 2023, 09:17:27 PMИспользуйте $main:filename, если вы хотите, чтобы в каждой строке отображалось одно и то же имя файла. (Он находится в основной группе, а не в поддокументе, как теги GPS.)
Yes, its works. Thank you very much.