[cc-devel] XMP Developer Challenges and Announcing "Palimpsest"

Terry Hancock hancock at anansispaceworks.com
Tue Mar 27 19:51:32 EDT 2007

Regarding ways to encode XMP metadata in Ogg format files (principally

Conrad Parker wrote:
> On 25/03/07, Terry Hancock <hancock at anansispaceworks.com> wrote:
>> stored in GIF files). Is that going to be a problem with Ogg, or can we
>> just create a named field "XMP" (say), and fill it with XMP data, IOW:
>> * "XMP" metadata named field (Is that a good choice of name?).
> Sounds fine by me.
>> * XMP data stored in contiguous, uncompressed UTF-8 encoded block of
>> text (Adobe's scanner spec calls for checking UTF-8, UTF-16-LE, and
>> UTF-16-BE, and possibly UTF-32-LE, UTF-32-BE (which I haven't supported
>> -- apparently Python 2.4's codecs module doesn't include them)).
>> * What's the limit on the size of keyword text fields in an Ogg file? If
>> it has no built-in limit (really I mean if it's about 60+ kilobytes, as
>> it would be if it were addressed by a short int), then we should have no
>> problem.
>  Up to (2^32 - 1) comments may be stored in a Vorbis comment packet.
>  Each comment vector consists of a "name=value" field of maximum total
>  length (2^32 - 1) bytes
> http://www.kfish.org/sounds/textual_data.txt
> So, all we need to do is agree on a field name ("XMP" obviously,
> unless it should also contain a version number or anything like that).
> The comment value string for VorbisComment is arbitrary UTF-8.
>> Basically, this would just be following the PNG model.
>> I haven't read the spec for Ogg Vorbis, so I don't know what happens to
>> data in a metadata field. However I did just hexdump my sample Ogg file,
>> and it looks like the text fields are in clear, so that's good news.
>> I'm not really planning on writing Theora support, but ISTM that it's
>> probably a short step from Vorbis support (same container format?
>> perhaps they don't even need separate plugins?).
> Yes, exactly the same format for Theora, Speex etc.

When I wrote my reply, I assumed this would be the most natural way, but
I may've been a little naive. I noticed some description at xiph.org of
putting such data in a separate "XML stream" alongside the data in an
Ogg container format. Advantages cited included being able to tag
combined audio/video streams, and not "abusing" the fields (from Vorbis
documentation page):

The comment field is meant to be used much like someone jotting a quick
note on the bottom of a CDR. It should be a little information to
remember the disc by and explain it to others; a short, to-the-point
text note that need not only be a couple words, but isn't going to be
more than a short paragraph.

So maybe this is an undesireable solution (even though it is
attractively simple to implement)?

Or would that be prudish of us? :-)

How hard is it to create/read one of these "XML streams" in an Ogg file,
and can a binding like pyogg do that for me so I don't have to think
about it?


Terry Hancock (hancock at AnansiSpaceworks.com)
Anansi Spaceworks http://www.AnansiSpaceworks.com

More information about the cc-devel mailing list