John Morton
2004-May-18 08:26 UTC
[vorbis-dev] Can vorbisfile read comments from an HTTP stream
Just noticed this article on Slashdot: http://ask.slashdot.org/article.pl?sid=04/05/18/0432202 ...about the feasibility and efficiency of reading id3v2 tags out of mp3's over http. I know that vorbisfile's callback model is well suited to handling this sort of scenario, but I'm curious to know whether ov_open will try to read enough stream to pull the comments out on a non-seekable stream. I've only played around with it on seekable streams, where it tries to scan the whole stream to get a count of the logical streams within. Would ov_test get enough header read to determine the size of the comment before sucking it all in for parsing? John --- >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.
Ralph Giles
2004-May-18 10:46 UTC
[vorbis-dev] Can vorbisfile read comments from an HTTP stream
On Wed, May 19, 2004 at 03:26:18AM +1200, John Morton wrote:> Just noticed this article on Slashdot: > > http://ask.slashdot.org/article.pl?sid=04/05/18/0432202 > > ...about the feasibility and efficiency of reading id3v2 tags out of mp3's > over http. I know that vorbisfile's callback model is well suited to handling > this sort of scenario, but I'm curious to know whether ov_open will try to > read enough stream to pull the comments out on a non-seekable stream. > I've only played around with it on seekable streams, where it tries to scan > the whole stream to get a count of the logical streams within. > > Would ov_test get enough header read to determine the size of the comment > before sucking it all in for parsing?Not having done any verification, if you mark the stream as not seekable, vorbisfile should do what you want here. It must of course parse it linearly, and will suck up all the headers before any audio is decodeable. The hard part might be knowing when to stop feeding it data. You can probably just pull on ov_read() once an then look at the OggVorbis_File->vorbis_comment struct. If this is a stand-alone app, you might do better just using ogg (or ogg and vorbis, but not vorbisfile) directly. If you're just parsing the comment header, you don't need all the extra code. -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.