I want to strip metadata from MP3 files.

In a brief: How to simply get a stream of pure MP3 frames out of a MP3 file – by means of command line tools? Preferable using tools out of the box of a linux mint system.

I found this thread. I wanted to use avconv and tried the given hints.

slhck's hint doesn't work simply by replacing ffmpeg with avconv. The output file has no more Title and Artist information, but embedded images are retained.

The same happens with evilsoup's hint, even albeit this is a native avconv hint. His second hint even retains Artist, Title, and so on.

OS is Linux Mint 17.

Commandline and output of avconv:

$ avconv -i in.mp3 -map_metadata -1 -c:v copy -c:a copy out.mp3
avconv version 9.16-6:9.16-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers
  built on Aug 10 2014 18:16:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
[mp3 @ 0x21ad1e0] max_analyze_duration reached
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, mp3, from 'in.mp3':
    album_artist    : Pin
    album           : Mag
    artist          : Pin
    title           : Alo
    track           : 2/12
    date            : 201
  Duration: 00:05:20.83, start: 0.000000, bitrate: 281 kb/s
    Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16p, 256 kb/s
    Stream #0.1: Video: mjpeg, yuvj444p, 2560x2560 [PAR 100:100 DAR 1:1], 90k tbn
      title           : 
      comment         : Cover (front)
Output #0, mp3, to 'out.mp3':
    TSSE            : Lavf54.20.4
    Stream #0.0: Video: mjpeg, yuvj444p, 2560x2560 [PAR 100:100 DAR 1:1], q=2-31, 90k tbn, 90k tbc
      title           : 
      comment         : Cover (front)
    Stream #0.1: Audio: libmp3lame, 44100 Hz, stereo, 256 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (copy)
Press ctrl-c to stop encoding
frame=    1 fps=  0 q=-1.0 Lsize=   11024kB time=0.01 bitrate=9030959.2kbits/s    
video:996kB audio:10027kB global headers:0kB muxing overhead 0.007902%
  • 1
    Just to avoid confusion - what OS? I'm guessing Ubuntu, since avconv is specific to that, but specificity is awesome. I'd guess your specific issue is stripping embedded images, and I'd suggest adding that explicitly too. – Journeyman Geek Nov 18 '14 at 0:23
  • Please show the full command line output from the avconv process you tried – slhck Nov 18 '14 at 6:39
  • Comments aren't allowed to be as long as needed to give output. Will add by editing. – Peter Nov 19 '14 at 22:59
  • Ok, it seems the embedded image is considered to be a stream, not metadata. Therefore I tried $ avconv -i in.mp3 -map 0:0 -map_metadata -1 -c:a copy out.mp3 and it seems to work. – Peter Nov 19 '14 at 23:12

$ avconv -i in.mp3 -map 0:0 -map_metadata -1 -c:a copy out.mp3

Ref. comment – image is considered being a stream; the stream is deselected by only mention 0:0 as parameter to -map

  • 1
    Nevertheless out.mp3 begins with magic number 0x494433 ("ID3") instead of pure MP3 frames. – Peter Nov 22 '14 at 0:38

In order to remove the metadata from the MP3 files you can use the below there tools

eyeD3, id3tool, id3v2

Example for eyeD3:

eyeD3 --remove-lyrics --remove-v1 *.mp3
  • Question indicates the use of linux - avconv is basically a ubuntu specific ffmpeg fork. – Journeyman Geek Nov 18 '14 at 0:22
  • eyeD3 seems to work good, but is only able to modify files in place. I'm looking for a way to pipe the output. – Peter Nov 22 '14 at 0:58
  • id3tool presents no option to remove tags, only options to set them. – Peter Nov 22 '14 at 1:02
  • id3v2 lacks the possibility to pipe, too. Only modify-in-place operation. – Peter Nov 22 '14 at 1:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.