Hi, I'm a 3rd year university student in the UK and for my dissertation (Final Year Project) I'm trying to create a peer to peer streaming network, where a audio stream gets sent around the network in a p2p fashion hopefully reducing the load from the source. I've decided to use ogg vorbis for my stream, and I have successfully created a small app that can read data from a .ogg file and fire it at the sound card. Now when I'm finished I plan to have my "server" read the data from a ogg file and send it over the network where the peers will re-send and re-assemble it to form a stream. The problem I'm having is that if a peer would like to join the stream a minute in. He won't be receiving the ogg file from the beginning by maybe a few megabytes in. Then when I try to ov_open_callbacks this it returns a error since the data is invalid.... I found there are tags in the stream "OggS" to indicate the different pages, however if I start the stream on one of these tags it returns a OV_EBADHEADER. Now my question is, how can I allow a client to join the stream at any point and continue play back from the next available place? I haven't looked how Icecast does it, but if it works by sending the first header in the file then that will mess up with p2p plans.... I don't really want to be spending a lot of my time working this out, if it all fails I can just send raw PCM data over my p2p network since I'm able to join that stream anytime, but I thought using ogg would be cooler, and more practical in a real environment. Thanks for any replies Andrew --- >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 Sat, 2003-10-18 at 08:52, Andrew Brampton wrote:> I haven't looked how Icecast does it, but if it works by sending the first > header in the file then that will mess up with p2p plans.... > I don't really want to be spending a lot of my time working this out, if it > all fails I can just send raw PCM data over my p2p network since I'm able to > join that stream anytime, but I thought using ogg would be cooler, and more > practical in a real environment.Icecast does it by caching the first three Vorbis packets (which are the header packets) and tacking them onto the beginning of the stream. These 3 packets are mandatory for being able to decode an Ogg Vorbis file. You can then pickup the stream at any point after them. Just making your app cache the header packets for the current stream and sending them to new clients shouldn't be too hard. Even if you switch to PCM, you still have to tell the clients what the sample format is before you send them the audio. Vorbis is just a "little" more data than that. :) --- Stan Seibert <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.
> Hi,> I'm a 3rd year university student in the UK and for my dissertation (Final > Year Project) I'm trying to create a peer to peer streaming network, where a > audio stream gets sent around the network in a p2p fashion hopefully > reducing the load from the source. > Have you had a look at peercast (www.peercast.org) and streamer (www.streamerp2p.com)? Both already do this and have source code available, which might be interesting. For your project you could try improving one of them or differentiate your program from them somehow. As far as I know they work by having a tree, each peer getting the stream from one peer and forwarding it to 0-n peers. What would be good would be if peers short on uploading bandwidth could just contribute part of a stream: e.g. peer A has 40kbps upload capacity and wants to stream a 32kbps stream to B and C. B and C have modems and can download at 40kbps but only upload at 25 kbps. This can't be done if you have to get the whole stream from one source. So A sends odd numbered packets to B and even numbered packets to C then B and C send each other the rest of the stream. Robert Jessop <p><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.