Extracting GPS Information from .MP4?

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

Previous topic - Next topic

StarGeek

Just add the -ee (extractEmbedded) option to get all the data in readable format.  If you want to limit the output to just the GPS data, add -GPS*.

To get it in a useful geo track file, such as gpx or kml, download the appropriate format file from github and drop it in the same directory as exiftool.  You can then run
exiftool -p gpx.fmt FILE.mp4 > out.gpx
and exiftool with create a geotrack.  Replace gpx.fmt with kml.fmt if you want a kml type geotrack.

See Inverse Geotagging for more details.
"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

leonard_zh


sjytribe

Trying to use the exiftool to extract the GPS from a GoPro MP4 file and using various options but appear to be struggling with "large file support not enabled"

Currently using the following options

exiftool.exe -p gpx.fmt GH015087.mp4 > out.gpx


Am I missing something ?

Phil Harvey

Try this:

exiftool.exe -api largefilesupport -ee -p gpx.fmt GH015087.mp4 > out.gpx

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

johnichan

Any body tried decoding lukas ace 7900 videos gps location? The default extractor gives only locations 1 minute away while I need 1 second location to upload to Mapillary. The default viewer shows the lcoations and accelerometer during playback but no option to export.  I contributed about 800km videos to mapillary from another 70mai dash camera, but this proprietery standard is not allowing

Any who wanted to have a look at the viewer and sample files at https://drive.google.com/open?id=0B-_IfqQwPO0AbWFfaUx4aGxYQms

Phil Harvey

#65
I think I can see the GPS in this video, but it will take some work to be able to decode it.

The precision of the coordinates seems to be 0.006 seconds, which is pretty good.

Give me some time to work on this.

- Phil

Edit:  Ah.  Looking at your CSV file I see you mean 1 minute in time, not 1 minute coordinate precision.  Yes.  The positions are recorded every second in the AVI file.
...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 ($).

johnichan

Phil, Thanks in Advance..  Be safe.. I have 1.6TB video waiting to uploaded to Mapillary after converting.

Phil Harvey

ExifTool 11.96 is now available, and should extract the GPS from these AVI files with the -ee option.

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

johnichan

need details like which mp4 file and how you know gps data is inside. Searching in the file without any clue whether data is inside is difficult.

Phil Harvey

I don't understand.

Quote from: johnichan on April 24, 2020, 01:28:56 PM
need details like which mp4 file

Both AVI files that you posted.  If you send an MP4 then I didn't see it.

Quotehow you know gps data is inside.

You can see it by running exiftool -ee on these files.

QuoteSearching in the file without any clue whether data is inside is difficult.

How are you searching in the file?  I don't understand what you want to do.

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

johnichan

Hi Phil,

Sorry for the confusion. I am a fool to reply to a very old message to amal on 2013 listed below,seeing a 'newbie' tag. Ignore it...

"Re: Extracting GPS Information from .MP4?
« Reply #14 on: November 21, 2013, 05:48:38 AM »"

johnichan

#71
Hi Phil,
I got another clue that the gps data is present in junk section when opened in the riffpad. Now we need a way to batch extract junk section & process the gps co ordinates. Can you please help to do riff extract? I have given the riff extracted format in the same google drive link  https://drive.google.com/open?id=0B-_IfqQwPO0AbWFfaUx4aGxYQms

Phil Harvey

Again, I don't understand.

Are you looking for a utility other than ExifTool to extract this information?  Or is ExifTool not extracting it in the format that you want?  If the latter, then I can show you how to extract it in any format you want if you are more specific about what you require.

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

johnichan

#73
Hi Phil,

I am a Hardware engineer and I am not actually trained to write softwares, but doing it as a hobby. Now I found the required information is available in "Junk" tag of the file using riffpad tool,which is graphical. I need exiftool to extract 'Junk' tag as a batch process in command line to get text file output and I will add a perl script to extract to CSV from text output file. The following section from the Junk section which can be used for geo tagging(This is raw gps strings output from gps receiver). The information of every second is available in the string below. .....:...0GDA..e.H...&...........:...0GDA..e.H...-...........9...0GDA4.e.H...%...........:...0GDAk.e.H...K...........9...0GDA..e.H...............9...0GPSt.e.H...............F..@....o..@......H@9$GA,052$GA,052349,A,0949.6572,07635.4297,046,N,E,*4A...$GC,052349,180914,0000955,1,08,1.1,0016,,A*4C...$GA,052350,A,0949.6595,07635.4369,048,N,E,*45...0GPS..e.H.............:.M..@..n.q..@......H@9$GC,052$GC,052350,180914,0000955,1,08,1.1,0017,,A*45...$GA,052351,A,0949.6626,07635.4439,049,N,E,*4C...$GC,052351,180914,0000955,1,08,1.1,0017,,A*44...0GPS..e.H...........f.c]\..@.~j.t..@......F@9$GA,052$GA,052352,A,0949.6660,07635.4504,047,N,E,*4C...$GC,052352,180914,0000955,1,08,1.1,0018,,A*48...$GA,052353,A,0949.6701,07635.4560,045,N,E,*4B...0GPS..e.H............C.lg..@Y.8.u..@......F@9$GC,052$GC,052353,180914,0000955,1,08,1.1,0019,,A*48...$GA,052354,A,0949.6755,07635.4603,045,N,E,*4B...$GC,052354,180914,0000956,1,08,1.1,0020,,A*46...0GPS..e.H.............n....@J..+w..@......H@9$GA,052$GA,052355,A,0949.6818,07635.4634,046,N,E,*4B...$GC,052355,180914,0000956,1,08,1.1,0021,,A*46...$GA,052356,A,0949.6890,07635.4655,049,N,E,*40...0GPS,.e.H.............s....@P..sw..@......I@9$GC,052$GC,052356,180914,0000956,1,08,1.1,0022,,A*46...$GA,052357,A,0949.6967,07635.4666,051,N,E,*41...$GC,052357,180914,0000956,1,07,1.3,0023,,A*4B...0GPSx.e.H...`........w.....@....w..@......K@9$GA,052$GA,052358,A,0949.7049,07635.4671,054,N,E,*49...$GC,052358,180914,0000956,1,07,1.3,0024,,A*43...0GPS..e.H............c]....@.Mb.x..@......M@9$GA,052$GA,052359,A,0949.7134,07635.4678,057,N,E,*49...$GC,052359,180914,0000957,1,07,1.3,0024,,A*43...$GA,052400,A,0949.7221,07635.4690,058,N,E,*4C...0GPS/.e.H..............D...@.-..x..@......M@9$GC,052$GC,052400,180914,0000957,1,07,1.3,0025,,A*49...$GA,052401,A,0949.7306,07635.4712,058,N,E,*42...$GC,052401,180914,0000957,1,07,1.3,0025,,A*48...0GPS..e.H.............._...@..0.z..@......J@9$GA,052$GA,052402,A,0949.7383,07635.4746,055,N,E,*40...$GC,052402,180914,0000957,1,07,1.3,0025,,A*4B...$GA,052403,A,0949.7453,07635.4789,053,N,E,*4E...0GPS..e.H..................@.&1.|..@......L@9$GC,052$GC,052403,180914,0000958,1,07,1.3,0025,,A*45...$GA,052404,A,0949.7518,07635.4845,056,N,E,*4D...$GC,052404,180914,0000958,1,07,1.3,0025,,A*42...0GPS..e.H..................@.-.....@......M@9$GA,052$GA,052405,A,0949.7575,07635.4911,057,N,E,*46...$GC,052405,180914,0000958,1,08,1.1,0025,,A*4E...$GA,052406,A,0949.7625,07635.4985,058,N,E,*41...0GPS..e.H...............(..@.......@......M@9$GC,052$GC,052406,180914,0000958,1,08,1.1,0025,,A*4D...$GA,052407,A,0949.7666,07635.5069,061,N,E,*47...$GC,052407,180914,0000959,1,08,1.1,0025,,A*4D...$GA,052408,A,0949.7698,07635.5155,059,N,E,*4C...0GPSl.e.H.............1w-..@`vO....@......L@9$GC,052$GC,052408,180914,0000959,1,08,1.1,0025,,A*42...$GA,052409,A,0949.7722,07635.5239,057,N,E,*4A...$GC,052409,180914,0000959,1,08,1.1,0025,,A*43...0GPSu.e.H.............W.2..@...Q...@......J@9$GA,052$GA,052410,A,0949.7739,07635.5322,054,N,E,*40...$GC,052410,180914,0000960,1,08,1.1,0026,,A*42...$GA,052411,A,0949.7748,07635.5403,052,N,E,*45...0GPS[.e.H..............g3..@..HP...@......I@9$GC,052$GC,052411,180914,0000960,1,08,1.1,0026,,A*43...$GA,052412,A,0949.7751,07635.5481,050,N,E,*46...$GC,052412,180914,0000960,1,08,1.1,0026,,A*40...0GPSP.e.H..............g3..@EGr....@......F@9$GA,052$GA,052413,A,0949.7750,07635.5555,047,N,E,*48...$GC,052413,180914,0000960,1,08,1.1,0026,,A*41...$GA,052414,A,0949.7751,07635.5624,044,N,E,*48...0GPS=.e.H............'..5..@<.R....@......D@9$GC,052$GC,052414,180914,0000960,1,08,1.1,0026,,A*46...$GA,052415,A,0949.7759,07635.5687,041,N,E,*4D...$GC,052415,180914,0000961,1,08,1.1,0027,,A*47...0GPS..e.H...`.........Y.9..@.&S....@......C@9$GA,052$GA,052416,A,0949.7783,07635.5743,039,N,E,*4F...$GC,052416,180914,0000961,1,08,1.1,0027,,A*44...0GPS..e.H.............^)K..@}..Y...@......D@9$GA,052$GA,052417,A,0949.7820,07635.5792,039,N,E,*44...$GC,052417,180914,0000961,1,08,1.1,0027,,A*45...$GA,052418,A,0949.7867,07635.5834,041,N,E,*44..

Phil Harvey

To extract the raw data of the junk tag you would need to create a user-defined tag in ExifTool.

However, ExifTool 11.96 has the ability to produce a CSV file directly from this information.  For example:

exiftool -p "$gpsdatetime,$gpslatitude,$gpslongitude,$gpsaltitude,$gpsspeed" -n -ee FILE > out.csv

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