Libraries

如何擺脫音樂庫中不必要的 mp3 標籤?

  • April 22, 2013

我有一大堆音樂。一些曲目有不必要的 MP3 標誌。我怎樣才能擺脫它們?

要查看圖書館的污染情況,請嘗試:

find ./ -type f -iname "*.mp3" -exec /usr/bin/mid3v2 -l '{}' + | egrep -e "AENC|ASPI|COMM|COMR|ENCR|EQU2|ETCO|GEOB|GRID|LINK|MCDI|MLLT|OWNE|PRIV|PCNT|POPM|POSS|RBUF|RVA2|RVRB|SEEK|SIGN|SYLT|SYTC|TBPM|TCOM|TCOP|TDEN|TDLY|TDOR|TDRL|TDTG|TENC|TEXT|TFLT|TIPL|TIT3|TKEY|TLAN|TLEN|TMCL|TMED|TMOO|TOAL|TOFN|TOLY|TOPE|TOWN|TPE3|TPE4|TPOS|TPRO|TPUB|TRSN|TRSO|TSOA|TSOP|TSOT|TSRC|TSSE|TSST|TXXX|UFID|USER|USLT|WCOM|WCOP|WOAF|WOAR|WOAS|WORS|WPAY|WPUB|WXXX"

一般可以mid3v2用來編輯 mp3 文件的 ID3v2 標籤。

find ./ -type f -iname "*.mp3" -exec /usr/bin/mid3v2 --delete-frames=AENC,ASPI,COMM,COMR,ENCR,EQU2,ETCO,GEOB,GRID,LINK,MCDI,MLLT,OWNE,PRIV,PCNT,POPM,POSS,RBUF,RVA2,RVRB,SEEK,SIGN,SYLT,SYTC,TBPM,TCOM,TCOP,TDEN,TDLY,TDOR,TDRL,TDTG,TENC,TEXT,TFLT,TIPL,TIT3,TKEY,TLAN,TLEN,TMCL,TMED,TMOO,TOAL,TOFN,TOLY,TOPE,TOWN,TPE3,TPE4,TPOS,TPRO,TPUB,TRSN,TRSO,TSOA,TSOP,TSOT,TSRC,TSSE,TSST,TXXX,UFID,USER,USLT,WCOM,WCOP,WOAF,WOAR,WOAS,WORS,WPAY,WPUB,WXXX '{}' +

這將從目前目錄遞歸地找到所有 *.mp3 文件並刪除它們幾乎所有的 id3v2 幀。而且它的速度非常快。幾乎所有意味著所有,但是:

APIC  A picture for the track, usually the albumcover.
TIT1  Content group description (I guess could be deleted too)
TIT2  The song title
TPE1  The album artist
TPE2  The artists (includes featurings)
TRCK  Tracknumber
TALB  Albumtitle
TCON  Genre
TDRC  Year of release

比較id3v2.4規範

mid3v2 將在刪除之前將發布年份的舊框架 TYER 隱式轉換為 TDRC。實際上,它將每個操作中的每個文件都轉換為id3v2.4。見man mid3v2

測試它是否有效,再次使用:

find ./ -type f -iname "*.mp3" -exec /usr/bin/mid3v2 -l '{}' + | egrep -e "AENC|ASPI|COMM|COMR|ENCR|EQU2|ETCO|GEOB|GRID|LINK|MCDI|MLLT|OWNE|PRIV|PCNT|POPM|POSS|RBUF|RVA2|RVRB|SEEK|SIGN|SYLT|SYTC|TBPM|TCOM|TCOP|TDEN|TDLY|TDOR|TDRL|TDTG|TENC|TEXT|TFLT|TIPL|TIT3|TKEY|TLAN|TLEN|TMCL|TMED|TMOO|TOAL|TOFN|TOLY|TOPE|TOWN|TPE3|TPE4|TPOS|TPRO|TPUB|TRSN|TRSO|TSOA|TSOP|TSOT|TSRC|TSSE|TSST|TXXX|UFID|USER|USLT|WCOM|WCOP|WOAF|WOAR|WOAS|WORS|WPAY|WPUB|WXXX"

引用自:https://unix.stackexchange.com/questions/73193