News:

If this site goes down it is because of the crappy DreamHost web hosting: They will disable your "unlimited traffic" web server if a single bot hammers the site with a moderate load.  If necessary, an alternate ExifTool forum page is available at https://sourceforge.net/p/exiftool/discussion/

Main Menu

Extracting GPS Information from .MP4?

Started by Genesis, June 13, 2013, 03:10:39 AM

Previous topic - Next topic

aluengo

Another question, I have two ".mov" extracted directly from an iPhone6 backup. Customer says that in recording moment the GPS was activated..but I´m unable to recover location data from them (neither it is in Photos.sqlite). Besides maybe it is not truth, is there any special consideration for this ".mov" files?. I attach, as example for one of these files, output for command "exiftool.exe -ee IMG_7924.MOV"

Thanks in advance,

Phil Harvey

You could try -ee3, but it is unlikely to help if the video is indeed directly from an iPhone.  Most often in cases like this the video doesn't contain gps, but I can't say for sure without seeing the video.

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

StarGeek

Quote from: aluengo on April 16, 2021, 09:05:25 AM
but Telegram reencoded it automatically when sharing

Re-encoding will remove all metadata and this is common with social media apps.  But a quick google search seemed to indicate that it would be possible to send it as a file instead of as image/video and that would preserve any metadata.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

aluengo

Quote from: Phil Harvey on April 16, 2021, 10:15:19 AM
You could try -ee3, but it is unlikely to help if the video is indeed directly from an iPhone.  Most often in cases like this the video doesn't contain gps, but I can't say for sure without seeing the video.

- Phil

Greetings Phil, this is the original video recorded from iPhone 12 with GPS enabled: https://cloud.oscarmlage.com/index.php/s/3A8Tje3FoQF8rMD

Thanks for the help.

Phil Harvey

This video is very different from all the iPhone videos I have from other models (which do have GPS, btw).  I can't explain the difference, but I don't see any GPS in the video you posted.

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

DavidK86

Hi Phil

Thanks for the great forum full of information. Has helped a great deal.

I have hit an issue though I hope you may be able to help with?
I have some dashcam footage which I need to extract gps information from csv/txt file ideally, however when I have run it several different ways through exiftool I just get either saying there is no gps data, or just come back with some lat/longs which are obviously incorrect.

The video definitely has gps data as you can follow on a map when viewed with GPSPlayer. Unfortunately I do not know the make/model of camera used, nor do i have access to it to make and send a smaller file. I have emailed a link to philharvey66@gmail.com

Thanks so much for any advice you may be able to offer.

David

ldb707

Hello Phil,

I am trying to extract GPS data from my Vantrue S1 dashcam which records mp4 files. Using the Vantrue Player software, it displays all GPS data: Coordinates, Speed, Accelerometer, and even plots the trace onto a map.

I have read through the forums, and tried using the -ee command and other suggestions, but it doesn't display any of the GPS information (tried both the Windows and Linux versions).
Looking at the raw form with -ee -V3 , I can see some kind of GPS data:

+ [GPS directory, 32768 bytes]
  | 2768a9e0: 00 00 80 00 66 72 65 65 47 50 53 20 78 00 00 00 [....freeGPS x...]
  | 2768a9f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | 2768aa00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | 2768aa10: 68 6f 72 73 6f 6e 74 65 63 68 00 00 00 00 00 00 [horsontech......]
  | 2768aa20: 41 4e 45 00 15 00 00 00 07 00 00 00 02 00 00 00 [ANE.............]
  |     [snip 32688 bytes]


Can I send you the video file to take a look at it when you have time?

Thanks a lot.

- Leonard

Phil Harvey

Hi Leonard,

Sorry for the delay in responding.  I was away for the last week, and unfortunately the site was disabled by dreamhost shortly after I left. :(

Sure.  Send me the file and I'll take a look (philharvey66 at gmail.com)

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

Phil Harvey

Hi Leonard,

I got the file you sent.  ExifTool 12.37 (to be released this week) will have the ability to decode timed GPS from this file.

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

ldb707

Thanks a lot for your work and dedication, Phil!

Keep it up!

Leonard

dh

Hi

I have subtitles (srt) with GPS + proprietary information embedded in Mp4 files. I can extract this with the -text tag, but some files contain other subtitle streams. They all fall into the Quicktime group. Is there a way to specify which stream to extract, using TrackID or HandlerDescription for example, to reduce the workload?

C:\exiftool -G -ee3 -text file.mp4"

Also, is it possible to add/replace this stream with a subrip format text file?

Thanks

StarGeek

Quote from: dh on March 10, 2022, 01:05:57 AM
Also, is it possible to add/replace this stream with a subrip format text file?

Not with exiftool.  You'll have to use ffmpeg for that.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

dh

Thanks. I thought that would be the case, and that's how I got them in there. I'm just trying to reduce the number of tools I need for my workflow, and ExifTool seems to be full of surprises if you can find the right options.

krandino

Let me say that tool is very well made and works great. If I was smart, I wouldn't look a gift horse in a mouth and just use your program. I have been searching for data on the MP4 file format and metadata where the GPS coordinates for the GoPro format on a Hero 9 is stored. It was my intention to decode that information which from the specs that I saw looked fairly benign. I am looking at the metadata and not the image compression that I remember from work research years ago included the DCT transform if I remember correctly. The docs I saw looked as though there was an ASCII codeword "GPS5" and what followed contained the Lat, Long, speed, etc. stored in IEEE 754 format supposedly. I have examined the files and I have used your and other programs that are able to find, and convert the data correctly. Clearly I am doing something wrong with my assumptions/understandings. I understand you are not doing a tutorial service for retired software engineers but if you could point me to a document(s) or source (in C or C+) that would help me do this, I would be very appreciative. Just for the record, my attempt at this is NOT a commercial thing. It is strictly for use on a trip I plan on making and using the GoPro to document the trip and want to create a .gpx file for record of every mp4.

Thanks

StarGeek

Quote from: krandino on April 22, 2022, 09:55:15 PMif you could point me to a document(s) or source (in C or C+) that would help me do this,

From what I understand, the various camera companies don't make such specs publicly available.  Exiftool currently knows 59 different ways that GPS tracks can be embedded and it's thanks to Phil's hard work.

Your best source would be to look over the exiftool source code, though it's in Perl and not C.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).