ExifTool Forum

ExifTool => Newbies => Topic started by: Vmjs on June 30, 2020, 02:57:34 AM

Title: Extracting coordinates from group of mp4-files
Post by: Vmjs on June 30, 2020, 02:57:34 AM
Hi,
Ok the problem I'm having is that I have a numerous folders that contain numerous mp4-files and I want to extract latitude and longitude from each of the mp4-files.
I know that its possible with exiftool or at least using exiftool by perl. So if I'm honest the real problem is that I'm not smart enough to do it myself :)

So what I would like to do is extract the information from one folder at a time. For example folded is named "February 2020" and it contains mp4-files that are named 20200210.mp4, 20200214.mp4, 20200215.mp4... and so on
And as a result I need a text file or csv from each of the mp4-files that has information in columns.
Or one csv-file that has the information from all of the mp4-files in the folder and the columns would be: Filename, latitude, longitude.

I have tried example this in exiftool: exiftool -ee -api -largefilesupport=1 -n -filename -gpslatitude -gpslongitude 20200604 > out.csv
But It doesn't work. It prints the infromation in rows and it does it maybe for one file and then it's out of memory.
I have read from some thread that the out of memory problem could be avoided by using Perl but I barely know how to use exiftool so....

And the reason for all of this is that I want to check that all of my videos has the coordinates, plus when I get the coordinates out of the files a can draw gps lines from them in Qgis and make a shape or geoadatabase out of it.
I belive that this is quite simple for some one who knows how to use exiftool and perl and I would appreciate highly if some one could help me.
Title: Re: Extracting coordinates from group of mp4-files
Post by: Phil Harvey on June 30, 2020, 05:33:09 AM
Try this:

exiftool -ee -api -largefilesupport=1 -n -p "$filename,$gpslatitude,$gpslongitude" -w %d%f.csv -ext mp4 20200604

- Phil

Edit: Added missing space before -w
Title: Re: Extracting coordinates from group of mp4-files
Post by: Vmjs on June 30, 2020, 07:50:52 AM
That doesn't work. First it gives "Error: File not found - %d%f.csv"
and then it gives these "Warning: [Minor] Tag 'Doc91899:filename' not defined - 20200604/VID_20200604_02.mp4"
and these "Warning: End of processing at large atom (LargeFileSupport not enabled) - 20200604/VID_20200604_32.mp4
Warning: [Minor] Tag 'gpslatitude' not defined - 20200604/VID_20200604_32.mp4
Warning: End of processing at large atom (LargeFileSupport not enabled) - 20200604/VID_20200604_47.mp4
Warning: [Minor] Tag 'gpslatitude' not defined - 20200604/VID_20200604_47.mp4"

and in the end "Out of memory!"

And I tried to do that the exiftool.exe is at folder "videos" and the mp4-files are in dir "videos\20200604"
Title: Re: Extracting coordinates from group of mp4-files
Post by: Phil Harvey on June 30, 2020, 09:38:46 AM
Sorry.  Somehow I missed a space before -w.  I've edited my post to fix this.

The warnings can be ignored, and the out-of-memory problem should be fixed by running the 64-bit version of the alternate Windows exe (https://oliverbetz.de/pages/Artikel/ExifTool-for-Windows).

- Phil
Title: Re: Extracting coordinates from group of mp4-files
Post by: Vmjs on July 01, 2020, 01:04:03 AM
No go yet.
When to code is running I can se a csv-file by the video name on the folder and then it does many lines of those minor warnings "Warning: [Minor] Tag 'Doc99997:filename' not defined - 20200604/VID_20200604_111.mp4
Warning: [Minor] Tag 'Doc99998:filename' not defined - 20200604/VID_20200604_111"

And after that the csv-file disappears
And in the end it does these. The largesupportfile should be enabled so I don't understand that warning at least..?
Warning: End of processing at large atom (LargeFileSupport not enabled) - 20200604/VID_20200604_131.mp4
Warning: [Minor] Tag 'gpslatitude' not defined - 20200604/VID_20200604_131.mp4
Warning: End of processing at large atom (LargeFileSupport not enabled) - 20200604/VID_20200604_135.mp4
Warning: [Minor] Tag 'gpslatitude' not defined - 20200604/VID_20200604_135.mp4


But the "Out of memory" doesn't come any more, so something good at least :)
Title: Re: Extracting coordinates from group of mp4-files
Post by: Phil Harvey on July 01, 2020, 07:44:44 PM
Wow. 100k documents.  That's extreme.

And right, Filename is only in the main document, so you should use: -p "$main:filename,$gpslatitude,$gpslongitude"

- Phil
Title: Re: Extracting coordinates from group of mp4-files
Post by: Vmjs on July 02, 2020, 01:32:45 AM
Now it does it to some of the videos but it seems that when the filesize is over 4gt it doesn't work.
Can this be solved?
Title: Re: Extracting coordinates from group of mp4-files
Post by: obetz on July 08, 2020, 01:33:23 AM
Quote from: Vmjs on July 02, 2020, 01:32:45 AM
Now it does it to some of the videos but it seems that when the filesize is over 4gt it doesn't work.

Did you use my 64 bit version Phil mentioned above?

What is the exact error message?
Title: Re: Extracting coordinates from group of mp4-files
Post by: Vmjs on July 08, 2020, 06:32:39 AM
Hi, I forgot to write an update about this. I got it working with the config-file that is in this post: https://exiftool.org/forum/index.php?topic=3916.0
my full command that worked is:
exiftool -config mp4.config -ee -api -largefilesupport=1 -n -p "$main:filename,$gpslatitude,$gpslongitude" -w %d%f.csv -ext mp4 20200604

So HUGE thanks to Phil for the advice!