【问题标题】:How Can I Add Metadata in opus files?如何在作品文件中添加元数据?
【发布时间】:2018-09-04 22:11:22
【问题描述】:

我有兴趣为.opus 文件编写元数据,但到目前为止我看到的所有帖子都是针对更主流格式的,例如 .ogg 或 .mp3。我不确定 ID3 标签是否适用于 .opus 文件,而且我找不到任何说明它们是否适用的资源。我在 (How to add metadata to WAV file?) 中看到过类似的东西。

如何将标题、作者等元数据写入 .opus 文件?

我认为启用libopusffmpeg 能够做到这一点,但从文档中我看不出如何做到这一点。

只使用 ffmpeg 的解决方案是首选,但任何开源 Java 库也应该没问题。

【问题讨论】:

    标签: java tags metadata opus


    【解决方案1】:

    如果您要将现有的音频文件编码为 opus,那么使用opusenc 很容易做到:

    opusenc input.wav out.opus --title "This is a title" --artist "The Beatles"

    有几个元数据选项

     --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)
    

    【讨论】:

    • 对不起,我不在状态。我已经在我的程序中发现并编写了 opusenc 的子程序。很棒的建议。起初我担心 opusenc 是一个特定于 linux 的程序,但当我发现它是独立于平台的时,我很感激。
    【解决方案2】:

    使用 FFmpeg:

    ffmpeg -i myfile.opus -metadata FOO="Bar Baz" -codec copy myfile-withmeta.opus
    

    然后文件上的ffprobe 将确认新元数据条目的存在。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多