Opened 4 years ago

Last modified 4 years ago

#9067 new defect

Use standard-compliant ID3v2 tag instead of TXXX TRACKTOTAL

Reported by: Stanislav Brabec Owned by:
Priority: minor Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When coverting from a format using Vorbis Comments (e. g. FLAC) to a format using ID3v2 (e. g. MP3), ffmpeg incorrectly converts tag TRACKTOTAL to a custom TXXX tag TRACKTOTAL. However this notation is widely accepted by the software, it is not a standard-compliant behavior.

Recent ID3v2.4 specifies TRCK in format "track#/track total". https://id3.org/id3v2.4.0-frames
Even 21 years old ID3v2.2.0 already specified TRK in format "track#/track total". https://id3.org/id3v2-00

The correct conversion from Vorbis Comments to ID3v2 should be:

TRCK="TRACKNUMBER/TRACKTOTAL"
TPOS="DISCNUMBER/DISCTOTAL"

and vice versa, from ID3v2 to Vorbis Comments:

TRACKNUMBER=leading part of TRCK
TRACKTOTAL=trailing part of TRCK or TRACKTOTAL (to support deprecated format)
DISCNUMBER=leading part of TPOS
DISCTOTAL=trailing part of TPOS or DISCTOTAL (to support deprecated format)

Notes:

  • TRACKTOTAL is not part of a Vorbis Comments specification, but it is a widely accepted proposed standard. https://wiki.xiph.org/Field_names
  • There is a software that uses TOTALTRACKS and TOTALDISCS Vorbis Comments instead of upper mentioned. (deprecated)

How to reproduce:
Edit any FLAC file with e. g. easytag and fill TRACKTOTAL value (number of tracks in the album).

ffmpeg -i foo.flac -ab 320k -map_metadata 0 -c:0 copy foo.mp3

Example:

+ ffmpeg -i './Allegro Milana/Allegro Milana plays a tribute to Rondo Veneziano/16 Alla Turca.flac' -ab 320k -map_metadata 0 -id3v2_version 3 -c:0 copy '../../MP3/CDmp3new/./Allegro Milana/Allegro Milana plays a tribute to Rondo Veneziano/16 Alla Turca.mp3'
ffmpeg version 3.4.8 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7 (SUSE Linux)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --incdir=/usr/include/ffmpeg --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --optflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g' --disable-htmlpages --enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl --disable-openssl --enable-avresample --enable-libcdio --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libcelt --enable-libcdio --enable-libdc1394 --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libzimg --enable-libzvbi --enable-vaapi --enable-vdpau --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3 --enable-libx264 --enable-libx265 --enable-libxvid
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, flac, from './Allegro Milana/Allegro Milana plays a tribute to Rondo Veneziano/16 Alla Turca.flac':
  Metadata:
    TITLE           : Alla Turca
    ARTIST          : Allegro Milana
    ALBUM           : Allegro Milana plays a tribute to Rondo Veneziano
    DATE            : 1994
    track           : 16
    TRACKTOTAL      : 16
    GENRE           : Classical
  Duration: 00:03:45.67, start: 0.000000, bitrate: 894 kb/s
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
    Stream #0:1: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 599x589 [SAR 1:1 DAR 599:589], 90k tbr, 90k tbn, 90k tbc
    Metadata:
      comment         : Cover (front)
Stream mapping:
  Stream #0:1 -> #0:0 (copy)
  Stream #0:0 -> #0:1 (flac (native) -> mp3 (libmp3lame))

Change History (1)

comment:1 by Carl Eugen Hoyos, 4 years ago

Component: ffmpegundetermined
Version: 3.4.6unspecified

Please confirm that the issue is reproducible with current FFmpeg git head and please provide a short input sample.

Note: See TracTickets for help on using tickets.