Skip to main content

Topic: Vorbis Comment Header (Read 1936 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Till
  • [*]
Vorbis Comment Header
hi

Just like I said in the topic... How can I change a comment header in
a given ogg file. I'm not quite sure how to do that (im programming in c++) . Can I just cut the file after the beginning headers (including the comment header) and reattach it to a new generated header? Are there any CRC checks?
Or is there a better solution (like a special funktion for editing comments) ?

thanks
Till
  • Last Edit: 01 April, 2004, 03:47:55 AM by Till

  • ErikS
  • [*][*][*][*][*]
Vorbis Comment Header
Reply #1
Sure. It works. But remember two things:

1. generate correct CRC values for the header "pages" you regenerate
2. you must make exactly the same number of "pages" in the new header

Considering the space limitation for an ogg page is a bit less than 64 kb, it's possible for all but very bit comments. But also since pages larger than 4 kb is discouraged by the spec, it might be better to just regenerate all pages in the whole file in those cases where you have to rewrite it anyway.

Better solution will be to use vcedit code - i think from the tools package found in the vorbis sdk / tarball / cvs (if you're working in C/C++ that is).
  • Last Edit: 01 April, 2004, 10:16:47 AM by ErikS

  • Till
  • [*]
Vorbis Comment Header
Reply #2
Quote
1. generate correct CRC values for the header "pages" you regenerate
2. you must make exactly the same number of "pages" in the new header

1.  Sure... i planed to generate the new header with the normal functions provided by the standard library. The CRC should be correct.
2. hm..  I'm using vorbis_comment_add_tag(vc,"..","..") several times. Does it write a new page into vc every time I call it?

The Comment will be some kind of time-index for the file to address "events" in the file. The whole thing is running on a win2000 server and is recording meetings for my company. It has to encode in realtime (a little latency is ok) because it is sending this data via network and Internet to several clients.

It's not possible to regenerate all page because the file may contain up to some hours of audiodata and re-encoding would take to much time.
  • Last Edit: 02 April, 2004, 03:47:36 AM by Till