Hey guys, currently wrapping my head around the vorbisfile API. The stream callback interface is really nice ! Great work. I'm running into two snags using it though. a) getting ov_bitrate on a seakable stream returns a long. When I print it as %ld, I get Bitstream is 2 channel, 44100 Hz, 0 version, -2147483648 bitrate I get this same number for any vorbis file. I checked them with ogginfo, and that reports the right ABR. Am I missing something ? Calculating it manually by dividing total bits through total time gives me a near-accurate value : abr: 194184 bits/sec ogginfo reports, for this file: Nominal bitrate: 192.000000 kb/s Upper bitrate not set Lower bitrate not set User comments section follows... ARTIST=Idlewild ALBUM=The Remote Part TITLE=You Held The World In Your Arms TRACKNUMBER=1 QUANTAUDIO=R:13363-T:1.05:201.48:201.91 Vorbis stream 1: Total data length: 4875041 bytes Playback length: 3m:21s Average bitrate: 193.160180 kbps Logical stream 1 ended Why is there a slight difference between the two values ? b) ov_bitrate interprets "link == -1" as "the entire bitstream" ov_comment interprets "link == -1" as "the current bitstream" why the different behaviour ? Is there a reason behind this ? c) am i correct in assuming that each logical bitstream in the phyiscal one can contain at most one COMMENT tag ? Thanks, Thomas <p> -- The Dave/Dina Project : future TV today ! - http://davedina.apestaart.org/ <-*- thomas (dot) apestaart (dot) org -*-> Come on baby take a walk with me honey Tell me who do you love Who do you love <-*- thomas (at) apestaart (dot) org -*-> URGent, the best radio on the Internet - 24/7 ! - http://urgent.rug.ac.be/ <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-dev-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.
On Monday, October 28, 2002, at 05:14 PM, Thomas Vander Stichele wrote:> c) am i correct in assuming that each logical bitstream in the phyiscal > one can contain at most one COMMENT tag ?No, you can have as many instances of the same tag as you want in a particular header packet. See http://xiph.org/ogg/vorbis/doc/v-comment.html. HTH, -r --- >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-dev-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 06:14 PM 28/10/2002 +0100, you wrote:>Hey guys, > >currently wrapping my head around the vorbisfile API. The stream callback >interface is really nice ! Great work. > >I'm running into two snags using it though. > >a) getting ov_bitrate on a seakable stream returns a long. >When I print it as %ld, I get >Bitstream is 2 channel, 44100 Hz, 0 version, -2147483648 bitrateTo cover this on the mailing lists for people that want to search for this... This is a gcc optimiser bug at -O2 and above, with gcc 3.x (at least in 3.1 and 3.2). cvs contains rearranged code that won't trigger the bug.> >I get this same number for any vorbis file. >I checked them with ogginfo, and that reports the right ABR. >Am I missing something ?ogginfo uses a different mechanism to detect bitrate (it's already doing a linear scan of the file, so it doesn't need to call the vorbisfile functions), so it doesn't get hit by this.> >Why is there a slight difference between the two values ?Vorbisfile and ogginfo will both report bitrate using only the data sections of the stream (i.e. they both ignore the headers for bitrate calculation).> >b) >ov_bitrate interprets "link == -1" as "the entire bitstream" >ov_comment interprets "link == -1" as "the current bitstream" > >why the different behaviour ? Is there a reason behind this ?This is mostly a matter of providing the most useful possible interface by default. Getting the comments for "all streams" doesn't make sense (and would be difficult to provide anyway), whereas calculating an average bitrate over the entire file does, so that's what the API provides.> >c) am i correct in assuming that each logical bitstream in the phyiscal >one can contain at most one COMMENT tag ?Absolutely NOT. There may be any number of tags with the same name (the spec says this). Michael <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-dev-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.