[FFmpeg-devel] [PATCHv2 5/5] vorbis: extract metadata from the middle of a stream

wm4 nfxjfg at googlemail.com
Sun Oct 27 16:42:17 CET 2013

On Sun, 27 Oct 2013 01:54:45 +0000 (UTC)
Ben Boeckel <mathstuf at gmail.com> wrote:

> On Sat, 26 Oct, 2013 at 12:29:26 GMT, wm4 wrote:
> > IMO functions for packing/unpacking AVDictionary into side data should
> > be factored into separate functions. I believe something related to
> > lavfi has to do the same, so it would be better not to duplicate this
> > code.
> >
> > Not sure where it should be put though.
> Agreed. avpriv_packet_pack_metadata?

Or maybe public? Also maybe "dictionary" instead of "metadata", but not

If users are supposed to read the side data, an unpack function should
be public as well, IMO.

> > Also, if metadata becomes empty, no update is performed. Is that as
> > intended? (Maybe it's a fringe case.)
> Well, if a tag was there before, but isn't updated, there's no
> indication that the tag disappeared. Tracking any tag which has come
> through here is probably not something worth the trouble.

If a single tag is removed (and there are others), the application gets
an update, but if _all_ tags are removed, then not.

> > Looks like this would trigger a metadata update even for the initial
> > metadata? This would be a bit odd, IMO. Though I'm not sure how exactly
> > libavformat/utils.c stream detection interacts with this. Maybe someone
> > should check.
> I could move it back; not a big deal. I was thinking it'd be nice to
> have all metadata available in one place instead of two places depending
> on whether the stream is new or not.

In general, it would be strange if some file formats put metadata into
side data, and some don't.

> > Rest appears to be fine, assuming all avpriv_vorbis_parse_frame() were
> > replaced.
> >
> > What about streams that aren't vorbis?
> I don't have any streams handy. I guess I could poke MPD to stream in
> other codec/containers. They could use the same side_data pattern as
> well (I imagine MP3 is probably the one most users would want).

I mean: it can't be handled in a codec independent way? (Maybe OGG is
too horrible? I don't know much about OGG.)

More information about the ffmpeg-devel mailing list