shellffmpegid3ffprobeid3v2

Get the size of ID3v2 tags for an audio file


ffmpeg is the defacto tool for getting audio information from a file/URL. But I am a bit stumped on how to get the size of the ID3v2 tags for the same.

Example of what information ffmpeg gives when we use ffprobe:

Input #0, mp3, from 'FILENAME':
  Metadata:
    encoder         : Lavf58.29.100
  Duration: 00:04:39.14, start: 0.000000, bitrate: 320 kb/s
    Stream #0:0: Audio: mp3, 48000 Hz, stereo, fltp, 320 kb/s

The metadata values are given but what would be the way to calculate the size of this in bytes?


Solution

  • Search the stderr output of ffmpeg -i file.mp3 -v debug for a line of the form

    id3v2 ver:4 flags:00 len:137