News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Delete all GPS metadata from MP4 file

Started by trymeout, May 04, 2021, 02:13:35 PM

Previous topic - Next topic

trymeout

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!

StarGeek

As I said here, 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. 
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

trymeout

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.

StarGeek

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, the altitude entry appears to be required, as exiftool would not write the LocationInformation without it when I tried to remove the altitude. 
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Phil Harvey

LocationInformation is a binary data structure, so altitude always exists.  The best you can do is set it to zero.

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

StarGeek

Ah, good to know.  I was assuming it was a simple string.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

trymeout

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.

Phil Harvey

Update to a more recent version of ExifTool.

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

trymeout

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"

oceanbrave

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.

StarGeek

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 in that subforum).  Exiftool didn't even have the ability to edit video files when it was last updated.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).