Hi, I'm busy working on a method of synchronising playback between two ogg decoders. To do this reliably, I need to create a cross-reference of the raw & pcm offsets in the bitstream. I have tried using the ov_raw/pcm_tell calls, but it appears as if the ov_raw_tell() only updates itsself in steps of 4096 bytes (as each read callback is done). This gives me a cross-reference every 120ms or so, which isn't quite often enough for my application. Is there anyway of finding the codec's position in the raw stream more precisely (e.g. whenever a frame is decoded)? Regards Paul <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.
> I'm busy working on a method of synchronising playback between two ogg > decoders. [...]I don't know exactly what you are going to do, but I suppose that the two decoders run on different machines and the streams are not the same. It's important to have a very low and constant latency communication channel. Don't rely on the lenght of vorbis (or other codec) packets because their length is variable. Work on raw data. You have to make your own buffering code that sends data to the audiocard and it must provide smooth dalays to resync with the other decoder without "clicks". I think it's not simple at all. Good luck :) Bye. --- >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.
On Thu, Jan 23, 2003 at 10:28:53PM -0000, Paul Noffke wrote:> Hi, > > I'm busy working on a method of synchronising playback between two ogg > decoders. To do this reliably, I need to create a cross-reference of the > raw & pcm offsets in the bitstream.You have complete control over PCM offsets; you don't have complete conttrol over raw offset because you both need some level of buffering for Ogg to function, and the raw offset is not directly related to the PCM offset anyway. All you know about an Ogg stream is that it comes in order, and that the granulepos can be used to know needed buffering depth. The raw offset changes in large chunks because it has to; you can't process only a few bytes of an Ogg stream at a time. So, I'd like to ask, "What are you *really* doing?" It seems unlikely that Vorbisfile can't do what you want, but if it can't, I'd like to know in more detail why such that I can take that into account for future API design. Monty --- >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.
Monty, I've solved my problem by using the PCM offset instead of the RAW offset. At first I was trying to use exactly the same technique I used for the mp3 stuff. But I then realised that what I really needed was a reliable "point of reference" between the two decoders. This can be anything - just so long as both decoders produce the same "reference point" at a given point in the stream - even if one started decoding in the middle of the stream or if data was lost or if one of the decoders lost sync. And the ogg PCM offset does this for me because the granule positions are embedded in the stream. And so problem solved. I hope this makes sense. Thanks for your help Paul -----Original Message----- From: Monty [SMTP:xiphmont@xiph.org] Sent: 05 February 2003 17:22 To: vorbis@xiph.org Subject: Re: [vorbis] Exact decode positioning <p><p><p>On Thu, Jan 23, 2003 at 10:28:53PM -0000, Paul Noffke wrote:> Hi, > > I'm busy working on a method of synchronising playback between two ogg > decoders. To do this reliably, I need to create a cross-reference of the > raw & pcm offsets in the bitstream.You have complete control over PCM offsets; you don't have complete conttrol over raw offset because you both need some level of buffering for Ogg to function, and the raw offset is not directly related to the PCM offset anyway. All you know about an Ogg stream is that it comes in order, and that the granulepos can be used to know needed buffering depth. The raw offset changes in large chunks because it has to; you can't process only a few bytes of an Ogg stream at a time. So, I'd like to ask, "What are you *really* doing?" It seems unlikely that Vorbisfile can't do what you want, but if it can't, I'd like to know in more detail why such that I can take that into account for future API design. Monty --- >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. <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.