Exiftool Command To Extract Only Latitude and Longitude from a MP4 file.

Started by blackmumu, March 12, 2022, 08:52:28 PM

Previous topic - Next topic

blackmumu

Hello,

I'm trying to extract only the latitude and longitude from an MP4 file with the format to use directly on google maps. Ex.: 10.xxxxxx, -10.xxxxxx (per line)

How can I do that?


Phil Harvey

Try this:

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

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

blackmumu

Phil,

Thank you so much it worked perfectly!

Another question: I have a folder with JPG files ordered by number, how can I insert these coordinates on the photos?

Best regards,

Marcos

StarGeek

The same coordinate for all the files?

exiftool -GPSLatitude*=40.6892 -GPSLongitude*=-74.0445 /path/to/files/

If you're on Mac/Linux, put single quotes around the options
exiftool '-GPSLatitude*=40.6892' '-GPSLongitude*=-74.0445' /path/to/files/

This command creates backup files.  Add -Overwrite_Original to suppress the creation of backup files.  Add -r to recurse into subdirectories.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

blackmumu

Quote from: StarGeek on March 12, 2022, 09:17:36 PM
The same coordinate for all the files?

exiftool -GPSLatitude*=40.6892 -GPSLongitude*=-74.0445 /path/to/files/

If you're on Mac/Linux, put single quotes around the options
exiftool '-GPSLatitude*=40.6892' '-GPSLongitude*=-74.0445' /path/to/files/

This command creates backup files.  Add -Overwrite_Original to suppress the creation of backup files.  Add -r to recurse into subdirectories.

StartGeek,

Each LAT LONG a different JPG.

I'm using windows CMD to run the commands.

Phil Harvey

Hi Marcos,

I assume you want to geotag the images from the track stored in the MP4.

If the JPEG images are timestamped, you can create a GPX file from the MP4 video, then use this file with the -geotag option to geotag the JPEG images.

If the JPEG images aren't timestamped, then it would involve an extra step to do this.  There are many threads where this is described, here is one, and another, and another.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

blackmumu

Quote from: Phil Harvey on March 12, 2022, 09:20:02 PM
Hi Marcos,

I assume you want to geotag the images from the track stored in the MP4.

If the JPEG images are timestamped, you can create a GPX file from the MP4 video, then use this file with the -geotag option to geotag the JPEG images.

If the JPEG images aren't timestamped, then it would involve an extra step to do this.  There are many threads where this is described, here is one, and another, and another.

- Phil

Phil,

Thank you once again! I'm checking the tutorials right now.

Best regards,

Marcos