ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: trymeout on May 04, 2021, 02:13:35 PM

Title: Delete all GPS metadata from MP4 file
Post by: trymeout on May 04, 2021, 02:13:35 PM
Is there a way to delete all GPS metadata from a MP4 file?

I found this command another thread but it will not work for my one MP4 video file.

exiftool -overwrite_original "-gps*=" "ShortVideo.mp4"

Any tips will be most appreciated!
Title: Re: Delete all GPS metadata from MP4 file
Post by: StarGeek on May 04, 2021, 08:52:09 PM
As I said here (https://exiftool.org/forum/index.php?topic=12442.msg67309#msg67309), that video has GPS data in the LocationInformation tag.  You'll need to remove that tag as well if you've upgraded your exiftool.

But exiftool doesn't have the ability to strip GPS data that's embedded in the stream.  To remove an embedded GPS track you'll have to remux the file with FFMpeg. 
Title: Re: Delete all GPS metadata from MP4 file
Post by: trymeout on May 05, 2021, 07:45:32 PM
I installed exiftools in Wine by placing the exiftool.exe into my Videos directory and I am using the terminal in Wine and this is what happens when I enter in this command which is the same command but modified with the overwrite original command but it does not seem to find the file in the directory. Even with the overwrite original removed from the command I still says it cannot find the file. I even tried it on a friends Windows computer today and it does not find the file for some reason.

The file is in the directory and when I use exiftool "ShortVideo.mp4" it returns the metadata of the file.

Z:\home\jacob\Videos>exiftool -overwrite_original '-LocationInformation<${LocationInformation;s/Alt=-?\d+\.\d+/Alt=/}' "ShortVideo.mp4"
File not found.
Title: Re: Delete all GPS metadata from MP4 file
Post by: StarGeek on May 05, 2021, 08:26:33 PM
I have no idea about what would happen under Wine, but if you tried it on a Windows computer, you'll need double quotes around each parameter.

Also, as I said here (https://exiftool.org/forum/index.php?topic=12442.msg67312#msg67312), the altitude entry appears to be required, as exiftool would not write the LocationInformation without it when I tried to remove the altitude. 
Title: Re: Delete all GPS metadata from MP4 file
Post by: Phil Harvey on May 06, 2021, 06:39:19 PM
LocationInformation is a binary data structure, so altitude always exists.  The best you can do is set it to zero.

- Phil
Title: Re: Delete all GPS metadata from MP4 file
Post by: StarGeek on May 06, 2021, 09:33:21 PM
Ah, good to know.  I was assuming it was a simple string.
Title: Re: Delete all GPS metadata from MP4 file
Post by: trymeout on May 19, 2021, 07:59:23 PM
I am unable to delete the LocationInformation metadata in general. How would I delete this and all other metadata from the Short Video file?

$ exiftool -overwrite_original "-LocationInformation=" "ShortVideo.mp4"
Warning: Sorry, LocationInformation is not writable
Nothing to do.
Title: Re: Delete all GPS metadata from MP4 file
Post by: Phil Harvey on May 19, 2021, 08:14:54 PM
Update to a more recent version of ExifTool.

- Phil
Title: Re: Delete all GPS metadata from MP4 file
Post by: trymeout on May 19, 2021, 08:51:35 PM
Excellent, this command now works like a charm which will delete all GPS and location metadata from a video file

exiftool -overwrite_original "-gps*=" "-LocationInformation=" "ShortVideo.mp4"
Title: Re: Delete all GPS metadata from MP4 file
Post by: oceanbrave on July 18, 2021, 11:41:50 AM
Under the ExifToolGUI it seems ->Modify -> -remove ALL metada gps data works but ticking GPS alone doesn't seem to.

Windows JPG files gps can be removed using file properties.

Not sure if this helps.
Title: Re: Delete all GPS metadata from MP4 file
Post by: StarGeek on July 18, 2021, 11:53:21 AM
Quote from: oceanbrave on July 18, 2021, 11:41:50 AM
Under the ExifToolGUI it seems ->Modify -> -remove ALL metada gps data works but ticking GPS alone doesn't seem to.

ExiftoolGui is extremely outdated and no longer supported (as per the stickied thread (https://exiftool.org/forum/index.php?topic=4553.0) in that subforum).  Exiftool didn't even have the ability to edit video files when it was last updated.