【问题标题】:How to get an audio file's artist and set album artist equal to artist in idv2.4 tagwith eyed3如何在idv2.4 tagwith eyed3中获取音频文件的艺术家并将专辑艺术家设置为等于艺术家
【发布时间】:2022-01-01 20:41:58
【问题描述】:

我有大量音频文件,对于每个音频文件,我想获取“艺术家”的值,并将“专辑艺术家”设置为我从“艺术家”获得的值。

【问题讨论】:

    标签: shell grep mp3 eyed3


    【解决方案1】:
    1. 安装 eyed3,一个可以读写音频标签的免费命令行工具。

    2. 将所有音频文件标签设置为idv2.4:

       find . -name "*" -type f -exec eyeD3 --to-v2.4 {} \; >> ~/eyed3.log 2>&1
      
    3. 删除剩余的 idv1.0 标签(有些播放器会同时读取 idv1 和 idv2 并将 idv1 优先于 idv2,这有时会导致您无法通过音乐播放器编辑标签):

       find . -name "*" -type f -exec eyeD3 --remove-v1 {} \; >> ~/eyed3.log 2>&1
      
    4. 使用 find 命令并在每次点击时执行 shell 代码:读取标签,grep 艺术家字段,删除“艺术家:”字符串,并将结果存储在变量专辑艺术家中。然后再次使用 eyed3 将值从艺术家写入到专辑艺术家字段。

       find . -name "*" -type f -exec sh -c 'albumartist=$(eyeD3 "$1" | grep -P "(?<=^artist)" | sed "s/artist\:\ //g"); eyeD3 -b "$albumartist" "$1"' sh {} \;
      

    【讨论】:

      猜你喜欢
      • 2013-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多