RecursiveAI.OneMedia.Tags.VorbisComment: VorbisCommentReader, VorbisCommentBlock (an ITagContainer, system vorbis), PictureBlockHeader.
- Layout (Vorbis comment specification §Structure): vendor string (32-bit little-endian length, UTF-8), a 32-bit count, then that many
length + "NAME=value"strings. Ogg Vorbis and the Theora, Speex comment headers end with a framing bit; Opus and FLAC do not. Names are 0x20–0x7D without=and case-insensitive; values are UTF-8 (invalid sequences are replaced and reported). The vendor string isNativeTagvendorandVorbisCommentBlock.Vendor. A length past the end of the block, a count past the available bytes and a name without=are typed defects (vorbis.truncated,vorbis.vendor-size,vorbis.field-size,vorbis.count,vorbis.no-equals,vorbis.name,vorbis.trailing; pictures:vorbis.picture,vorbis.picture-base64,vorbis.picture-too-large); the comments read so far are kept. - Ranges. Each tag has the range of its
length + stringitem and of its value. In an Ogg stream the offsets are relative to the start of the comment packet, because a packet can span pages; the container'sRangeis the physical page span. In native FLAC the offsets are file offsets. - Pictures.
METADATA_BLOCK_PICTUREholds a base64 FLAC PICTURE block (RFC 9639 §8.8): picture type (32 bits), MIME, description, width, height, depth, colours, data. Each becomes an image tag (type, MIME, description) whose value is decoded when read. A FLACPICTUREblock gives the same tag directly. Cover pictures reachCommonTags.Pictureswith theirPictureType. - Common view.
TagMappingTablerows for the Vorbis names (TITLE,ARTIST/PERFORMER,ALBUM,ALBUMARTIST,COMPOSER,GENRE,DATE,TRACKNUMBER,TRACKTOTAL/TOTALTRACKS,DISCNUMBER,COMMENT,DESCRIPTION,COPYRIGHT,LYRICS,ENCODER, …), matched case-insensitively.TRACKNUMBER=3/12gives track 3 and total 12.REPLAYGAIN_*andR128_*stay native. Facts:DATEis a capture-time candidate (a year or an ISO 8601 date, at the rank of a day-level tag) andENCODERa software candidate. - Sources: Xiph Vorbis comment specification, RFC 9639, the Picard tag map (CC0) as a table of names.
Agreement with other readers
Checked on 72 Ogg/Opus/FLAC/Ogg Theora files (including the tag variants written by ffmpeg): common view 141 fields equal and 3 partly equal against ExifTool 13.60 and MediaInfo 26.10, native tags 161 equal. The differences, all explained:
- Duration. ExifTool estimates a Vorbis duration from the nominal bitrate (0.8–6.9 s for 4–596 s files) and gives none for Opus; MediaInfo counts an Opus stream from the granule, so it includes the pre-skip (4.007 s against our 4.000 s, which follows RFC 7845 §5.1).
- Comments of a Theora stream.
theora-*.ogvcarry a comment header on the video stream; neither tool reports it, we do (vorbis:encoder). - ATL.NET 7.19 (
atlcommand): same on 121 fields. ATL.NET fills a missing title with the file name (the "ours-empty" lines of the first run are those titles); it does not readPERFORMERas the artist (we do, as the Vorbis comment spec names it the performing artist); it trims values and ours keep the stored text (compared trimmed).