Hi, I'm writing a tag-editor for ogg files. What tags, besides ogg-tags, are allowed in ogg files (if any). I'm thinking of id3v1, id3v2, ape tags and so on. I have a (probably small) problem with writing a new "comment header". I have tried opening a file with a valid header, and then simply moved some of the comment tags position, so that the total size and the count still remains the same. I then save the file and try to analyze it with the OggInfo tool, but it tells me: "Warning: Could not decode vorbis header packet - invalid vorbis stream (1)" If I analyze the two files with hexeditors, the contents are exactly the same, except that two comment tags (and their leading 32 bit integer describing the tags length) are switched position. To write the file, i do this: Bit-by-bit copying all contents of the existing file, until the beginning of the "Vendor length" integer. Then I write: vendorlength (32 bit unsig. int) vendorstring comment count (32 bit unsig. int) comment1 length) 32 bit unsig. int) comment1 string (fieldname=value) comment2 length.. .. .. and then I copy the rest of the contents from the existing file. I've uploaded two sliced ogg files (200 kb each): http://www.mexp.dk/ogg/test1.ogg (this is the one I modified, so it doesn't work) http://www.mexp.dk/ogg/test2.ogg (this is the original one, which is okay) I hope that a kind soul would care to explain to me what I'm doing wrong, since I've been fiddling with this for two days (or rather nights), and I've allmost pulled out every single hair on my head by now... Thanks in advantage, Regards, Anders Thomsen <p><p>--- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Hello Anders, I've been investigating the same things. Thou I didn't actually wrote anything. The first thing to understand is that you have an ogg vorbis stream inside an ogg container file. The ogg file container specification allows for any stream of data. So you could concivably write your own coment stream. Which you would have to multiplex with the vorbis stream. But that would be your propietary extension. The vorbis stream defies that the second vorbis page stores the comments in the structure you've described. The problem of what you're doing ir (IIRC) that there's some CRC check embeded within the stream specification. So you should use the ogglib to access and modify the file instead of doing it directly. Best regards, Alejandro Belluscio Friday, July 26, 2002, 5:30:32 PM, you wrote: AT> Hi, AT> I'm writing a tag-editor for ogg files. AT> What tags, besides ogg-tags, are allowed in ogg files (if any). AT> I'm thinking of id3v1, id3v2, ape tags and so on. AT> I have a (probably small) problem with writing a new "comment header". I AT> have tried opening a file with a valid header, and then simply moved some of AT> the comment tags position, AT> so that the total size and the count still remains the same. I then save the AT> file and try to analyze it with the OggInfo tool, but it tells me: AT> "Warning: Could not decode vorbis header packet - invalid vorbis stream (1)" AT> If I analyze the two files with hexeditors, the contents are exactly the AT> same, except that two comment tags (and their leading 32 bit integer AT> describing the tags length) are switched position. AT> To write the file, i do this: AT> Bit-by-bit copying all contents of the existing file, until the beginning of AT> the "Vendor length" integer. AT> Then I write: AT> vendorlength (32 bit unsig. int) AT> vendorstring AT> comment count (32 bit unsig. int) AT> comment1 length) 32 bit unsig. int) AT> comment1 string (fieldname=value) AT> comment2 length.. AT> .. AT> .. AT> and then I copy the rest of the contents from the existing file. AT> I've uploaded two sliced ogg files (200 kb each): AT> http://www.mexp.dk/ogg/test1.ogg (this is the one I modified, so it AT> doesn't work) AT> http://www.mexp.dk/ogg/test2.ogg (this is the original one, which is AT> okay) AT> I hope that a kind soul would care to explain to me what I'm doing wrong, AT> since I've been fiddling with this for two days (or rather nights), and AT> I've allmost pulled out every single hair on my head by now... AT> Thanks in advantage, AT> Regards, AT> Anders Thomsen <p><p>--- >>8 ---- AT> List archives: http://www.xiph.org/archives/ AT> Ogg project homepage: http://www.xiph.org/ogg/ AT> To unsubscribe from this list, send a message to 'vorbis-request@xiph.org' AT> containing only the word 'unsubscribe' in the body. No subject is needed. AT> Unsubscribe messages sent to the list will be ignored/filtered. <p><p> -- Best regards, Alejandro mailto:baldusi@uol.com.ar <p>--- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Anders Thomsen wrote:> I'm writing a tag-editor for ogg files. > What tags, besides ogg-tags, are allowed in ogg files (if any). > I'm thinking of id3v1, id3v2, ape tags and so on.Vorbis streams supports any arbitrary metadata (e.g. tags). The Ogg stream encapsulates the Vorbis stream and contains no metadata of its own, although you could roll-your-own method of multiplexing it in if you want (but it sounds like this isn't what you want).> I have a (probably small) problem with writing a new "comment > header". I > have tried opening a file with a valid header, and then > simply moved some of > the comment tags position, > so that the total size and the count still remains the same. > I then save the > file and try to analyze it with the OggInfo tool, but it tells me: > "Warning: Could not decode vorbis header packet - invalid > vorbis stream (1)"You're abusing the file format -- it doesn't work that way. The direct cause of your problem is that by changing the data, you're breaking the checksum, and that's why ogginfo complains.> If I analyze the two files with hexeditors, the contents are > exactly the > same, except that two comment tags (and their leading 32 bit integer > describing the tags length) are switched position.Instead of hacking the files with hex editors, you need to manipulate the bitsteam in a supported way. Studying the vorbiscomment source is probably a good place to start. Regards, Owen <p>--- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Anders Thomsen (list@mexp.dk) wrote:> What tags, besides ogg-tags, are allowed in ogg files (if any).Please read <http://www.xiph.org/ogg/vorbis/doc/v-comment.html>.> I'm thinking of id3v1, id3v2, ape tags and so on.No ID3 tags are allowed in Ogg files. I don't know what an ape tag is, but if it's anything like ID3, it's not allowed either. -- Greg Wooledge | "Truth belongs to everybody." greg@wooledge.org | - The Red Hot Chili Peppers http://wooledge.org/~greg/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: part Type: application/pgp-signature Size: 188 bytes Desc: not available Url : http://lists.xiph.org/pipermail/vorbis/attachments/20020726/7048c251/part-0001.pgp
On Fri, Jul 26, 2002 at 10:30:32PM +0200, Anders Thomsen wrote:> Hi, > > I'm writing a tag-editor for ogg files. > What tags, besides ogg-tags, are allowed in ogg files (if any). > I'm thinking of id3v1, id3v2, ape tags and so on.they are vorbis comments, and no other comment formats have been designed or are really needed. -- David Terrell | "If I had a nickel for every time I've seen a Usenet poster Nebcorp PM | slip in an ostensibly casual reference to how much smarter dbt@meat.net | he/she is than everyone else... why, I'd be able to throw a wwn.nebcorp.com |party for all my Mensa buddies!" -- Miguel Cruz --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Anders Thomsen wrote:> What tags, besides ogg-tags, are allowed in ogg files (if any). > I'm thinking of id3v1, id3v2, ape tags and so on.http://www.xiph.org/ogg/vorbis/doc/v-comment.html As longs as all three Vorbis headers are correct (and they aren't if you tinker with them in hex editors, unless you also manually adjust the CRC checksums (good luck :) )), every compliant player will play the .ogg file - even when you put random data in the beginning or the end of the file (haven't tried putting stuff from /dev/random in the middle of an .ogg file, yet ;) ). That means, braindead tags like ID3v* et al simply get ignored by a sane player. On the other hand, this definitely breaks the specs, or at least as far as I understand them. Of course, you're free to do whatever you like, but don't expect fame and/or appreciation by breaking things. ;P I personally see no point in throwing restrictive and legacy tags at Ogg Vorbis, or to create things like .ogm that violates the Ogg specs, in order to have features that can, and should be implemented correctly. <p>Moritz --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
At 10:30 PM 7/26/02 +0200, you wrote:>Hi, > >I'm writing a tag-editor for ogg files. >What tags, besides ogg-tags, are allowed in ogg files (if any). >I'm thinking of id3v1, id3v2, ape tags and so on.Only the ogg tags. id3 tags will cause a corrupt file (there are several severely broken tools out there that do use id3 tags on vorbis files).> >I have a (probably small) problem with writing a new "comment header". I >have tried opening a file with a valid header, and then simply moved some of >the comment tags position, >so that the total size and the count still remains the same. I then save the >file and try to analyze it with the OggInfo tool, but it tells me: >"Warning: Could not decode vorbis header packet - invalid vorbis stream (1)"You must update the page checksum(s), and potentially (only in rare cases) rewrite much of the ogg framing information for the entire file. <p>>Bit-by-bit copying all contents of the existing file, until the beginning of>the "Vendor length" integer. >Then I write: >vendorlength (32 bit unsig. int) >vendorstring >comment count (32 bit unsig. int) >comment1 length) 32 bit unsig. int) >comment1 string (fieldname=value) >comment2 length..You need to look at the ogg framing layer, and ensure all this information remains correct. Then you can just write a new comment header packet (i.e. what you've got just above, plus the packet-identification stuff that comes directly before it), Michael <p><p>--- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.