29

FFMPEG is really a great tool. I know it can edit ID3 tags and even remove all tags in a row :

ffmpeg -i tagged.mp3 -map_metadata -1 untagged.mp3

But even after that, there's still the cover image.

I don't know how to remove it using ffmpeg. I know there's other soft out there that can do the job - like eyed3 - but what's the point to install it if ffmpeg can do it too, in one line, while encoding the audio ?

rogerdpack
  • 62,887
  • 36
  • 269
  • 388
Buzut
  • 4,875
  • 4
  • 47
  • 54
  • Here are a few ideas: https://superuser.com/questions/625665/how-to-remove-embedded-album-covers-from-mp3-files-via-commandline – Tomasz Gandor Jun 20 '23 at 14:58

4 Answers4

60

Strip metadata tags and remove album cover image

ffmpeg -i input.mp3 -map 0:a -c:a copy -map_metadata -1 output.mp3
  • -map 0:a Includes only audio (omits all images). See FFmpeg Wiki: Map for more details.
  • -c:a copy Enables stream copy mode so re-encoding is avoided.
  • -map_metadata -1 Omits all metadata.
llogan
  • 121,796
  • 28
  • 232
  • 243
  • Thank you, that works ! By the way I didn't want to remux it but to re-encode it for a higher compression in addition to removing the metadatas. – Buzut Nov 25 '13 at 22:11
  • By the way, even if I don't need it right now, how could I add a cover picture to an mp3 with ffmpeg ? I can't find it out… – Buzut Dec 05 '13 at 11:38
12

I've tried to use codes provided by LordNeckbeard, none of them worked for my case. But this one worked:

ffmpeg -i tagged.mp3 -acodec copy -map 0 -map_metadata 0:s:0 notags.mp3

It shows now only one tag, 'TSSE' (means Encoder).

Kiloreux
  • 2,220
  • 1
  • 17
  • 24
dikirill
  • 1,873
  • 1
  • 19
  • 21
  • Well, `-map_metadata -1` works similarly for me (just encoder), but -- fun fact! -- it removes metadata from `.mp3`s, but NOT from `.opus`es! (to remember: first strip the ID3, then convert to Opus...) – Tomasz Gandor Jun 20 '23 at 14:57
4

None of the above worked for me but the following did:

ffmpeg -i tagged.mp3 -write_xing 0 -id3v2_version 0 untagged.mp3
TomDeWord
  • 41
  • 1
3

I tried llogan's solution with a small castle.mp3 file and found out that its size increased from 4448 to 4797 bytes! Further inspection in Audacity revealed that the signal has been slightly "delayed" as well - however the length of the file [castle2.mp3] remained the same.

enter image description here

After that, I used id3v2 -D castle.mp3 to delete all mp3 tags from the file, and the filesize went down to 4320 bytes, with no other noticeable (undesired) changes.

GChuf
  • 1,135
  • 1
  • 17
  • 28