我对为 .opus
文件编写元数据很感兴趣,但到目前为止我看到的所有帖子都是针对更主流的格式,例如 .ogg 或 .mp3。我不确定 ID3 标签是否适用于 .opus 文件,而且我找不到任何资源说明它们是否适用。我在 ( How to add metadata to WAV file?) 中看到过类似的东西。
如何将标题、作者等元数据写入 .opus 文件?
我认为启用 libopus
的 ffmpeg
能够做到这一点,但从文档中我无法清楚地知道如何去做。
仅使用 ffmpeg
的解决方案是首选,但任何开源 Java 库也应该没问题。
最佳答案
如果您正在将现有音频文件编码为 opus,那么使用 opusenc 很容易做到:
opusec input.wav out.opus --title "This is a title"--artist "披头士乐队"
有几个元数据选项
--title title Set track title
--artist artist Set artist or author, may be used multiple times
--album album Set album or collection
--genre genre Set genre, may be used multiple times
--date YYYY-MM-DD Set date of track (YYYY, YYYY-MM, or YYYY-MM-DD)
--comment tag=val Add the given string as an extra comment
This may be used multiple times
--picture file Attach album art (see --help-picture)
关于java - 如何在 opus 文件中添加元数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49496995/