Author Topic: Extracting GPS data from INSV file  (Read 5876 times)

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16878
    • ExifTool Home Page
Re: Extracting GPS data from INSV file
« Reply #45 on: October 08, 2019, 11:51:39 AM »
This command should work for you:

./exiftool -api largefilesupport -ee -p '$gpsdatetime,$gpslatitude,$gpslongitude'  'rawvideos/VID_002.insv' > VID_002.csv

I tested it with a smaller INSV file and it works fine.

If you want to list all available tags, you can use this command:

./exiftool -s -ee rawvideos/VID_002.insv

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

yamuna

  • Jr. Member
  • **
  • Posts: 13
Re: Extracting GPS data from INSV file
« Reply #46 on: October 08, 2019, 12:05:59 PM »
Hi Phil,

Thanks a lot for all your support.
I am getting results now.
However the result from Linux is different than the windows.
Linux: 2019:10:02 14:09:38Z,40 deg 38' 24.62" N,73 deg 58' 1.64" W
Windows: 2019:10:02 13:06:07Z 40.69177316 -73.99179094

Is it possible to get the same windows format from linux?

Thanks,
Yamuna.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16878
    • ExifTool Home Page
Re: Extracting GPS data from INSV file
« Reply #47 on: October 08, 2019, 12:16:06 PM »
You are using a config file on windows to change the default coordinate format.
...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 ($).

yamuna

  • Jr. Member
  • **
  • Posts: 13
Re: Extracting GPS data from INSV file
« Reply #48 on: October 08, 2019, 03:02:14 PM »
Hi Phil,

No I am not using any config in windows. Just downloaded the exe and executed.

Thanks,
yamuna.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16878
    • ExifTool Home Page
Re: Extracting GPS data from INSV file
« Reply #49 on: October 08, 2019, 05:36:43 PM »
You will only get that result with the Windows command if you use a config file.  There must be a default config file named ".ExifTool_config" in either your home directory or the exiftool app directory.

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

Kajuna

  • Newbie
  • *
  • Posts: 3
Re: Extracting GPS data from INSV file
« Reply #50 on: July 30, 2020, 04:12:20 AM »
Hello everyone, fantastic job, Phil!

I've been extracting the Insta360 data successfully. It's my first time using Exiftool and I find the interface very user friendly. I have a couple of questions.

- I am using the -m option in order to extract all the accelerometer data. That seems to work well, but am I going to hit the Windows output size limitation with large files? Is there a way to prevent that, like requesting the data chunk by chunk, with an increasing offset or something similar?

- The accel data is "timecode" based. The timecode is in seconds but it does not start at zero. I have tried assuming the first samples correspond to the first frame, but there seems to be a slight offset (the data seems a bit delayed, so maybe some data samples before the first video frame are retained). Does anyone know what that timecode is relative to? The video track timecode does start at zero, and I cannot find any tag that resembles that value, to use as a base offset

Really appreciated

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16878
    • ExifTool Home Page
Re: Extracting GPS data from INSV file
« Reply #51 on: July 30, 2020, 06:19:45 AM »
- I am using the -m option in order to extract all the accelerometer data. That seems to work well, but am I going to hit the Windows output size limitation with large files? Is there a way to prevent that, like requesting the data chunk by chunk, with an increasing offset or something similar?

Currently it is all or nothing.  If you run into memory limitations, you can switch to the 64-bit version.

Quote
- The accel data is "timecode" based. The timecode is in seconds but it does not start at zero. I have tried assuming the first samples correspond to the first frame, but there seems to be a slight offset (the data seems a bit delayed, so maybe some data samples before the first video frame are retained). Does anyone know what that timecode is relative to? The video track timecode does start at zero, and I cannot find any tag that resembles that value, to use as a base offset

I'll take a look at my Insta360 samples when I get a chance to see if I can see anything, but I think the chances are small that I'll see anything obvious.  Do you have any software that shows the accelerometer data at the correct time?

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

Kajuna

  • Newbie
  • *
  • Posts: 3
Re: Extracting GPS data from INSV file
« Reply #52 on: July 30, 2020, 10:36:50 AM »
If you run into memory limitations, you can switch to the 64-bit version.

That will work, thanks!

I'll take a look at my Insta360 samples when I get a chance to see if I can see anything, but I think the chances are small that I'll see anything obvious.  Do you have any software that shows the accelerometer data at the correct time?

Thanks for having a look. I'm not aware of any software that displays the accelerometer data. Insta's own software uses it for stabilisation, but nothing more, as fas as I know. I created this visualization to show the offset: https://youtu.be/z6aFhLs3wHo

And in case it's useful, here's the original file https://we.tl/t-DJjjrpeV2Y

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16878
    • ExifTool Home Page
Re: Extracting GPS data from INSV file
« Reply #53 on: July 30, 2020, 01:02:50 PM »
Run this command to see everything that is available, and how it is grouped:

exiftool -ee -G3 FILE

You can modify the gpx.fmt file to write anything you want.

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

Kajuna

  • Newbie
  • *
  • Posts: 3
Re: Extracting GPS data from INSV file
« Reply #54 on: July 30, 2020, 01:55:12 PM »
The only tag that I can imagine having that sort of data would be

[Main]          Parameters                      : 1 2576.934 2014.997 1506.038 0.291 -0.115 89.496 4056 3040 1058

Are those parameters known?

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16878
    • ExifTool Home Page
Re: Extracting GPS data from INSV file
« Reply #55 on: July 30, 2020, 04:05:43 PM »
Not by me.
...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 ($).

martincarlin87

  • Newbie
  • *
  • Posts: 3
Re: Extracting GPS data from INSV file
« Reply #56 on: August 25, 2020, 06:43:02 AM »
Hi,

I have been trying to extract the GPS data from an insv file and found ExifTool and this forum by extension (thank you btw), so I have been trying to follow the posts in this thread but I can't quite get it to work, but I'm not sure if it's because the data isn't actually present in the video, and not user error.

(On OS X) I ran:


exiftool -api largefilesupport -ee -p '$gpsdatetime,$gpslatitude,$gpslongitude'  'VID_20200511_143314_10_002.insv' > test.csv


and I get

Code: [Select]
Warning: [Minor] Tag 'gpsdatetime' not defined - VID_20200511_143314_10_002.insv

The resulting csv file is also empty.

If I run:


exiftool -s -ee VID_20200511_143314_10_002.insv


I get

Code: [Select]
ExifToolVersion                 : 12.03
FileName                        : VID_20200511_143314_10_002.insv
Directory                       : .
FileSize                        : 2.9 GB
FileModifyDate                  : 2020:08:24 17:36:34+01:00
FileAccessDate                  : 2020:08:24 17:36:34+01:00
FileInodeChangeDate             : 2020:08:24 17:37:15+01:00
FilePermissions                 : rw-r--r--
FileType                        : MP4
FileTypeExtension               : mp4
MIMEType                        : video/mp4
MajorBrand                      : MP4 Base w/ AVC ext [ISO 14496-12:2005]
MinorVersion                    : 0.0.0
CompatibleBrands                : avc1, isom
Warning                         : End of processing at large atom (LargeFileSupport not enabled)

Is there something I'm doing wrong or is it just that the GPS data isn't actually present?

Cheers,
Martin

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16878
    • ExifTool Home Page
Re: Extracting GPS data from INSV file
« Reply #57 on: August 25, 2020, 06:44:14 AM »
Hi Martin,

Try adding -api largefilesupport to that last command (and maybe add "-gps*" to avoid getting all the other tags).

- Phil
« Last Edit: August 25, 2020, 06:55:19 AM by Phil Harvey »
...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 ($).

martincarlin87

  • Newbie
  • *
  • Posts: 3
Re: Extracting GPS data from INSV file
« Reply #58 on: August 25, 2020, 08:02:41 AM »
Hi Phil,

Thanks for taking the time to reply - much appreciated.

That seems to work:


exiftool -s -ee VID_20200511_143314_10_002.insv -api largefilesupport


Code: [Select]
ExifToolVersion                 : 12.03
FileName                        : VID_20200511_143314_10_002.insv
Directory                       : .
FileSize                        : 2.9 GB
FileModifyDate                  : 2020:08:24 17:36:34+01:00
FileAccessDate                  : 2020:08:24 17:36:34+01:00
FileInodeChangeDate             : 2020:08:24 17:37:15+01:00
FilePermissions                 : rw-r--r--
FileType                        : MP4
FileTypeExtension               : mp4
MIMEType                        : video/mp4
MajorBrand                      : MP4 Base w/ AVC ext [ISO 14496-12:2005]
MinorVersion                    : 0.0.0
CompatibleBrands                : avc1, isom
MediaDataSize                   : 3119186880
MediaDataOffset                 : 48
MovieHeaderVersion              : 0
CreateDate                      : 2020:05:11 21:33:04
ModifyDate                      : 2020:05:11 21:33:04
TimeScale                       : 48000
Duration                        : 0:08:19
PreferredRate                   : 1
PreferredVolume                 : 100.00%
MatrixStructure                 : 1 0 0 0 1 0 0 0 1
PreviewTime                     : 0 s
PreviewDuration                 : 0 s
PosterTime                      : 0 s
SelectionTime                   : 0 s
SelectionDuration               : 0 s
CurrentTime                     : 0 s
NextTrackID                     : 3
TrackHeaderVersion              : 0
TrackCreateDate                 : 2020:05:11 21:33:04
TrackModifyDate                 : 2020:05:11 21:33:04
TrackID                         : 1
TrackDuration                   : 0:08:19
TrackLayer                      : 0
TrackVolume                     : 0.00%
MatrixStructure                 : 1 0 0 0 1 0 0 0 1
ImageWidth                      : 2880
ImageHeight                     : 2880
MediaHeaderVersion              : 0
MediaCreateDate                 : 2020:05:11 21:33:04
MediaModifyDate                 : 2020:05:11 21:33:04
MediaTimeScale                  : 30000
MediaDuration                   : 0:08:19
HandlerType                     : Video Track
HandlerDescription              : Ambarella AVC
GraphicsMode                    : srcCopy
OpColor                         : 0 0 0
CompressorID                    : avc1
SourceImageWidth                : 2880
SourceImageHeight               : 2880
XResolution                     : 72
YResolution                     : 72
CompressorName                  : Ambarella AVC encoder
BitDepth                        : 24
PixelAspectRatio                : 1:1
Stereoscopic3D                  : Monoscopic
MetadataSource                  : .AMBA Spherical Video
PoseYawDegrees                  : 0
PosePitchDegrees                : 0
PoseRollDegrees                 : 0
ProjectionBoundsTop             : 0
ProjectionBoundsBottom          : 0
ProjectionBoundsLeft            : 0
ProjectionBoundsRight           : 0
VideoFrameRate                  : 29.97
Spherical                       : true
Stitched                        : true
StitchingSoftware               : AMBA Spherical Video
ProjectionType                  : equirectangular
StereoMode                      : mono
SourceCount                     : 2
TrackHeaderVersion              : 0
TrackCreateDate                 : 2020:05:11 21:33:04
TrackModifyDate                 : 2020:05:11 21:33:04
TrackID                         : 2
TrackDuration                   : 0:08:19
TrackLayer                      : 0
TrackVolume                     : 100.00%
MatrixStructure                 : 1 0 0 0 1 0 0 0 1
MediaHeaderVersion              : 0
MediaCreateDate                 : 2020:05:11 21:33:04
MediaModifyDate                 : 2020:05:11 21:33:04
MediaTimeScale                  : 48000
MediaDuration                   : 0:08:19
HandlerType                     : Audio Track
HandlerDescription              : Ambarella AAC
Balance                         : 0
AudioFormat                     : mp4a
AudioChannels                   : 2
AudioBitsPerSample              : 0
AudioSampleRate                 : 48000
ImageSize                       : 2880x2880
Megapixels                      : 8.3
AvgBitrate                      : 50 Mbps
Rotation                        : 0


to filter the noise:


exiftool -s -ee VID_20200511_143314_10_002.insv -api largefilesupport -gps*


Code: [Select]
no matches found: -gps*

so, no GPS data? At least it explains why - thanks for the help!

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16878
    • ExifTool Home Page
Re: Extracting GPS data from INSV file
« Reply #59 on: August 25, 2020, 08:15:32 AM »
The "no matches found" error is from the shell, not ExifTool:  The -gps* requires quotes: "-gps*"

But in the full output, I don't see any GPS tags.

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