+4 votes
7.6k views
How to delete metadata with FFmpeg or ExifTool

in Guides by (550k points)
edited by | 7.6k views

2 Answers

+5 votes
Best answer

How to delete metadata with ExifTool.
How to delete metadata with FFmpeg.

When we work with multimedia files that we download from the internet we see that they may contain metadata, which in some cases are helpful but in others they are simple spam. On many occasions I wanted to delete these metadata to leave the files clean, so I write this tutorial on how to delete metadata with FFmpeg or ExifTool .

image

This tutorial should work for any type of file and as we will use FFmpeg or ExifTool, the instructions we will give here will be valid for both Windows and Linux . When working with audio files in Windows, I recommend using the Mp3tag program directly.

First of all, we must know that metadata is nothing more than information that is added to multimedia containers to be able to classify them efficiently. Video files with extension .mp4, .mkv, .mov, .wmv, etc ... may contain metadata.

How to delete metadata with ExifTool.

image

Personally, the method I like most to remove metadata from multimedia files is to use the free ExifTool application. First of all we must have the program installed, for this we can follow the tutorial on how to install ExifTool on Linux Ubuntu or Windows .

Once installed, we execute the following command from the console (note that there is a blank space between the = and input.mp4 symbol):
exiftool -all= input.mp4

As you can see, it is a simple and fast method, but in case of problems we provide you with a second method to erase the metadata using FFmpeg.

How to delete metadata with FFmpeg.

Obviously we will need the FFmpeg application installed in our operating system. In the case of Ubuntu or CentOS you can follow this tutorial and in the case of Windows you can download it directly from this link .

FFmpeg works in console mode, so we will have to execute commands to eliminate the metadata. The command shown below works with recent versions of FFmpeg, if you have an old version, start by updating the program.

Command to delete metadata with FFmpeg from the console:
ffmpeg -i input.mp4 -map 0 -map_metadata -1 -c copy output.mp4

This command does not perform any recoding of the data, so the audio or video quality is not modified at any time and is quite fast. We must also bear in mind that during this operation it is advisable to keep the same multimedia container, that is, if we work with an mp4 file it is preferable that the output container is mp4 well.

Check this link


by (3.5m points)
edited by
+4 votes

ExifTool is an excellent library and command line application, developed in Perl by Phil Harvey, that allows you to read and edit image, audio and video metadata. It supports a large number of formats and different types of metadata: EXIF, GPS, IPTC, XMP, JFIF, GeoTIFF, ICC Profile, Photoshop IRB, FlashPix, AFCP, ID3.

Download ExifTool

$ wget http://www.sno.phy.queensu.ca/~phil/exiftool/Image-ExifTool-8.72.tar.gz

Unpack and go to the base directory

$ tar xzvf Image-ExifTool-8.72.tar.gz && cd Image-ExifTool-8.71

Install

$ perl Makefile.PL && make && make test && sudo make install

View metadata

$ exiftool nom-fich

Clear metadata

$ exiftool -all = * .jpg

The above command removes all the metadata from all the jpgs found in the current directory. Exiftool creates an original copy by adding the _original suffix


by (550k points)

Related questions

+4 votes
1 answer
+4 votes
1 answer
+3 votes
1 answer
+3 votes
1 answer
+3 votes
1 answer
Sponsored articles cost $40 per post. You can contact us via Feedback
10,627 questions
10,759 answers
510 comments
3 users