Steven Mai
2010-Jan-06 19:50 UTC
[Vorbis-dev] Initializing vorbis using ov_open_callbacks fail with OV_ENOTVORBIS. But why?
Dear members, since two weeks I am stuck, trying to demux a physical ogg stream (theora and vorbis) and play the audio part using vorbisfile. I hope that one of you can give me a hint or point me to additional documentation. I used ogg.h and vorbisfile.h. The way so far: - initializing an ogg_sync_state - inserting data to sync_state using ogg_sync_buffer - when whole page found (ogg_sync_pageseek(&sync, &page) > 0) I initialize a ogg_stream_state and add page using ogg_stream_packetin. (in the case the first packet is vorbis - ogg_stream_packetout and check for first some bytes) - next pages with same serial number are handled equivalently: stored in ogg_stream_state using ogg_stream_packetin to add them to ogg_stream_state and using ogg_stream_pageout to get ogg encapsulated vorbis pages. ..I hope up to this point no logical error.. next step: the idea was now to init vorbis using ov_open_callbacks, but this function failed with OV_ENOTVORBIS, when reading the first portion of data (callback function reads new data) 1.do you know what could cause the error? 2.does vorbis need a minimal ammout of data to initialize? 3.do I forgot to initialize some comment struct in advance? thanks for any hint Steven
Ralph Giles
2010-Jan-06 21:10 UTC
[Vorbis-dev] Initializing vorbis using ov_open_callbacks fail with OV_ENOTVORBIS. But why?
2010/1/6 Steven Mai <mai at graphics.cs.uni-sb.de>:> next step: > the idea was now to init vorbis using ov_open_callbacks, but this > function failed with OV_ENOTVORBIS, when reading the first portion of data > (callback function reads new data)You don't say what data you're feeding libvorbisfile through the callbacks. It expects it to be Ogg encapsulated, so are you packing the vorbis packets back into a new sequence of pages through another ogg_stream_state? Passing a copy of the same data you're demuxing yourself? The vorbisfile library is designed to play streams directly, doing its own demuxing. You're better off feeding you demuxed packets to libvorbis directly. See http://svn.xiph.org/trunk/vorbis/examples/decoder_example.c for an example of the call sequence for this. HTH, -r