10

I have a video file captured with a smartphone. I want to remove the GPS location data written into it, leaving all other information intact. I tried some sed commands, but nothing seems to work.

1 Answer 1

14

You need to remux the video, removing the GPS location metadata.

You can use ffmpeg:

ffmpeg -i input.mp4 -metadata location="" -metadata location-eng="" -acodec copy -vcodec copy output.mp4

Then you can verify with ffprobe:

ffprobe output.mp4
3
  • This solved my issue with removing gps data from a .mp4 file, I wonder if it's the same process for a MOV file ref: u88.n24.queensu.ca/exiftool/forum/index.php/… Commented Dec 25, 2018 at 18:39
  • Almost worked fine for me with a .mov shot on my iPad. It had HEVC video and AAC audio in it. However, QuickTime Player can't transcode it from HEVC after running ffmpeg on it like this. Commented Sep 8, 2019 at 6:55
  • this command seems to also remove other metadata tags as well, e.g. creation_time disappears after this. If you add -map_metadata 0:s:0 to your command line, it should preserve the existing metadata and only overwrite the explicitly listed location tags Commented Jan 2 at 19:50

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.