Extracting GPS data from INSV file

Started by SM26, February 13, 2019, 09:41:18 AM

Previous topic - Next topic

Phil Harvey

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/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

yamuna

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

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/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

yamuna

Hi Phil,

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

Thanks,
yamuna.

Phil Harvey

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/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Kajuna

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

Quote from: Kajuna on July 30, 2020, 04:12:20 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/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Kajuna

Quote from: Phil Harvey on July 30, 2020, 06:19:45 AM
If you run into memory limitations, you can switch to the 64-bit version.

That will work, thanks!

Quote from: Phil Harvey on July 30, 2020, 06:19:45 AM
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

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/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Kajuna

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

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

martincarlin87

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


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


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

#57
Hi Martin,

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

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

martincarlin87

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



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*



no matches found: -gps*


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

Phil Harvey

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/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).