用於為 mp3 / m4a 檔案新增封面圖片的命令列工具(Windows 10)

用於為 mp3 / m4a 檔案新增封面圖片的命令列工具(Windows 10)

我正在使用 Windows 10(這使事情變得複雜)。

所以我有一堆音樂檔案和相關的封面圖片,格式為「x.m4a」和「x.jpg」。我想把他們連結起來。

命令列工具是理想的選擇,因為它可以輕鬆地批量運行。基本上,我想用這個:

@for /R %%F in (*.m4a) do (
    <utility> "%%~F" +cover "%%~npF.jpg"
)

Foobar2000和Mp3tag都不提供CLI,所以我直接嘗試使用ffmpeg,但它自動將圖片轉換為png,這是我不想要的。

我嘗試使用 id3 質量標記器

id3 -2 -wAPIC "test.jpg" "test.mp3"

但它返回“不支援寫入‘APIC’框架”。

答案1

你試過eyed3嗎?

你可以安裝它:

sudo apt-get install eyed3

然後你可以嘗試:

eyeD3 --add-image "<your picture>.jpg:FRONT_COVER" test.mp3

正如規格所述,請記住:

  --add-image IMG_PATH:TYPE[:DESCRIPTION]
                        Add or replace an image. There may be more than one image in a tag, as long as the DESCRIPTION values are unique. The default
                        DESCRIPTION is ''. If PATH begins with 'http[s]://' then it is interpreted as a URL instead of a file containing image data. The
                        TYPE must be one of the following: OTHER, ICON, OTHER_ICON, FRONT_COVER, BACK_COVER, LEAFLET, MEDIA, LEAD_ARTIST, ARTIST, CONDUCTOR,
                        BAND, COMPOSER, LYRICIST, RECORDING_LOCATION, DURING_RECORDING, DURING_PERFORMANCE, VIDEO, BRIGHT_COLORED_FISH, ILLUSTRATION,
                        BAND_LOGO, PUBLISHER_LOGO.

有關規格的更多信息這裡

答案2

您可能想要嘗試 Kid3-cli,例如以下命令將所有標籤(包括封面圖像)從 mp3 複製到 m4a (aac):

kid3-cli -c 'select in.mp3' -c copy -c 'select out.m4a' -c paste -c save

答案3

我最終使用了標籤編輯器它提供了一個 CLI:

@for /R %%F in (*.mp3,*.m4a) do (
    if exist "%%~npF.jpg" (
        tageditor set cover="%%~npF.jpg" -f "%%F"
    )
)

我不確定是否中3v2從 Mutagen 套件中本來可以工作,因為在某些時候我損壞了我的測試文件(嘗試了很多應用程式),所以我可能不公平地排除了 Mutagen。

相關內容