[FFmpeg-devel] [PATCHv5 0/3] vorbis: update metadata mid-stream

Ben Boeckel mathstuf at gmail.com
Mon Jan 13 04:19:25 CET 2014

Ogg/vorbis streams from MPD contain metadata updates mid-stream and need to be
plumbed from ffmpeg. The ogg decoder in avformat needs a way for codecs to
plumb up the metadata and then, finally, vorbis fills it in.

Patch 2 has ffmpeg combine multiple tags with the same name with semicolon
separators. This is to prevent tags such as performer from only showing up as
the last one in the file. An example file can be retrieved from my site[1].
When played using this branch, the following is output as metadata:

      RELEASETYPE     : album;remix
      PERFORMER       : prophetik (saxophone);Usa (percussion)

without the patch, the following is shown instead:

      RELEASETYPE     : remix
      PERFORMER       : Usa (percussion)

The file is from the OverClocked Remix album Teen Agent.

Testing with flac, mp3 (via lame; twolame untested), and ogg/opus in MPD (and
one mp3 stream from somafm) shows no mid-stream tag updates, only ICY Info, so
I have not updated these decoders. If other formats are found, the
av_packet_pack_dictionary function should make things easy.

The last patch contains an entry to doc/APIchanges.

Ben Boeckel (3):
  ogg: allow streams to update metadata
  vorbis: append data from tags together
  vorbis: extract metadata from the middle of a stream

 libavformat/oggdec.c         | 26 +++++++++++---
 libavformat/oggdec.h         |  2 ++
 libavformat/oggparsevorbis.c | 81 ++++++++++++++++++++++++++++++++++----------
 3 files changed, 86 insertions(+), 23 deletions(-)


More information about the ffmpeg-devel mailing list