Author Topic: Extracting GPS Information from .MP4?  (Read 33692 times)

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14425
    • ExifTool Home Page
Re: Extracting GPS Information from .MP4?
« Reply #15 on: November 21, 2013, 07:53:07 AM »
I did spend some time working on this, but it was more work than I had hoped.  Maybe this would be a good project for me over the Christmas holiday.  I'll move it back up to the top of my to-do list.

- 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 ($).

amal

  • Newbie
  • *
  • Posts: 2
Re: Extracting GPS Information from .MP4?
« Reply #16 on: December 05, 2013, 06:49:12 AM »
Thanks Sir.

dvazquez

  • Newbie
  • *
  • Posts: 5
Re: Extracting GPS Information from .MP4?
« Reply #17 on: December 07, 2013, 08:40:17 AM »
Hi guys,

I'm trying to extract the GPS information from a .mov file but I'm not able. Maybe it is something similar to your problem with .mp4? I could send you some videos if needed.

There are some applications that can read the GPS information from my videos but I would have to extrac the info video by video and I would like to use exiftool api to extract the info by myself ino my application.

Thanks in advance

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14425
    • ExifTool Home Page
Re: Extracting GPS Information from .MP4?
« Reply #18 on: December 07, 2013, 08:59:46 AM »
I have responded to your other post

- 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 ($).

DJPhrost

  • Newbie
  • *
  • Posts: 5
Re: Extracting GPS Information from .MP4?
« Reply #19 on: August 05, 2016, 03:51:05 AM »
Any progress on this yet?
I'm desperately needing GPS location pulled from an MP4 recorded on a smart phone, not sure if Android or iPhone, in the mp4 format.

Thank you,

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14425
    • ExifTool Home Page
Re: Extracting GPS Information from .MP4?
« Reply #20 on: August 05, 2016, 07:27:49 AM »
Sorry, no progress :(
...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 ($).

DJPhrost

  • Newbie
  • *
  • Posts: 5
Re: Extracting GPS Information from .MP4?
« Reply #21 on: August 05, 2016, 12:18:35 PM »
Curiously then, is there a specific reason?
I see this has been requested for many years now and seems to be very difficult to do, surely MP4s have geotags as well, or am I wrong?

What makes it so difficult to extract?

Just for personal edification.

I found a video of my now ex-fiance and another gentleman and was hoping the issue had been resolved so as to figure out whom it may have been. Oh well!

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14425
    • ExifTool Home Page
Re: Extracting GPS Information from .MP4?
« Reply #22 on: August 05, 2016, 02:51:45 PM »
Maybe ExifTool already does what you want.  ExifTool extracts all metadata from MP4 videos, included the GPS position if written to the metadata.

The initial post is requesting extraction of the full GPS track, which is embedded in the video stream.  Extracting anything from the video stream is difficult.  I have done this H264 stream in a M2TS container, and it was a real pain (lack of documentation, complex format, etc).  Naively I would have thought that this would be easy to apply to the H264 stream in MP4 videos, but sadly this was not the case.

- 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 ($).

DJPhrost

  • Newbie
  • *
  • Posts: 5
Re: Extracting GPS Information from .MP4?
« Reply #23 on: August 07, 2016, 02:43:33 AM »
Oh.. I guess I misread the initial post.. Sorry!
I've not slept one wink since the 28th of last month, when I found out about this, more or less. Heh.

Let me post my own thread as to not hijack this one, sorry!

jmurch

  • Newbie
  • *
  • Posts: 1
Re: Extracting GPS Information from .MP4?
« Reply #24 on: August 25, 2016, 04:05:44 PM »
Hi Phil,

I've been following this thread because this is pretty much the same thing I need to do re: extract the ongoing gps info from the mp4 stream.  I did go what I think is the obvious easy route that being use ffmeg to convert the mp4 to m2ts and then try to extract the gps info from the mt2s stream. So.... how do I use xiftool to do that?

Thanks, Jeff


OK RTFM.... found it I think but I get the following message:

exiftool -ee -p '$gpslatitude, $gpslongitude, $gpstimestamp' apgar.m2ts

Warning: [Minor] Tag 'gpslatitude' not defined - apgar.m2ts


#3:   I guess the tags are contingent on what they are named in the stream?  Is there anything I can use for a wildcard?   Here is the gpx that was extracetd by virb:

<trk>
    <name>apgar area</name>
    <extensions>
      <gpxx:TrackExtension>
        <gpxx:DisplayColor>DarkGray</gpxx:DisplayColor>
      </gpxx:TrackExtension>
    </extensions>
    <trkseg>
      <trkpt lat="48.521992899477482" lon="-113.98851854726672">
        <ele>989.4000244140625</ele>
        <time>2015-09-22T22:34:34Z</time>
      </trkpt>

#4 When this does work it just appears to be that same info from the metadata not the stream.
« Last Edit: August 25, 2016, 04:33:29 PM by jmurch »

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2368
Re: Extracting GPS Information from .MP4?
« Reply #25 on: August 25, 2016, 05:11:14 PM »
Is there anything I can use for a wildcard?

Try
exiftool -gps* File

The tags may not be named gpslatitude, gpslongitude, etc.  Some video files have a single tag with all the info. 
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

Victor

  • Newbie
  • *
  • Posts: 1
Re: Extracting GPS Information from .MP4?
« Reply #26 on: November 19, 2016, 05:58:15 AM »
I faced a similar requirement and have opted for a rather brute force solution.  Instead of reverse engineering the video stream I have extracted the GPS information from the video overlay (of course this assumes that the GPS information is being shown overlayed on the video frame itself).  The extracted data is saved to a GPX file.  The advantage of this method is that it can easily be customised to any video file, the disadvantage is that it is slower to extract the data.  If you are interested, you can download the software from here http://bigbugisoftware.jigsy.com/gpx-extractor.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14425
    • ExifTool Home Page
Re: Extracting GPS Information from .MP4?
« Reply #27 on: January 04, 2018, 04:44:02 PM »
ExifTool 10.72 (just released) has the ability to extract GPS from MOV/MP4 videos using the -ee option.  Please send me a sample if it doesn't extract it for your camera (phil at owl.phy.queensu.ca).

- 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 ($).

Insta

  • Newbie
  • *
  • Posts: 1
Re: Extracting GPS Information from .MP4?
« Reply #28 on: February 28, 2018, 09:00:40 AM »
ExifTool 10.72 (just released) has the ability to extract GPS from MOV/MP4 videos using the -ee option.  Please send me a sample if it doesn't extract it for your camera (phil at owl.phy.queensu.ca).

- Phil

Hello! Can you help me to extract GPS data drom mp4 video using -ee processing feature? what should i insert? exiftool -ee 1.mp4?

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14425
    • ExifTool Home Page
Re: Extracting GPS Information from .MP4?
« Reply #29 on: February 28, 2018, 11:02:45 AM »
Yes.  If that doesn't work, send me a sample video and I'll see what I can do to extract the GPS.  (my email is phil at owl.phy.queensu.ca)

- 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 ($).