[xiph-rtp] Theora over RTP

Rhys Hawkins Rhys.Hawkins at anu.edu.au
Wed May 31 00:24:27 PDT 2006


Hi Ralph,

On Tue, 2006-05-30 at 23:56 -0700, Ralph Giles wrote:
> On Wed, May 31, 2006 at 03:01:28PM +1000, Rhys Hawkins wrote:
> 
> > I've been looking at the draft spec:
> > http://svn.xiph.org/trunk/theora/doc/draft-barbato-avt-rtp-theora-00.txt
> > And libtheora 1.0_alpha3,
> 
> In case you're not aware, I just released alpha6 which has a number of 
> bug fixes over alpha3 and some MMX asm optimizations.

I did checkout from svn before posting to see if there were any api
changes. I noticed someones been documenting which is always nice :)

>  
> >                           and have a query regarding implementing the
> > encoding side of things. For each frame, I believe I do something
> > like:
> > 
> >     theora_encode_YUVin(&state, &yuv);
> >     result = theora_encode_packetout(&state, 0, &packet);
> > 
> >     wrap_packet_in_rtp(packet);
> 
> Yes, that's correct. As you say, wrap_packet_in_rtp() has to segment 
> larger theora packets and can generate any number of RTP packets 
> (including less than 1 if it's packing very short packets together).
> 
> I believe the length field is just for the chunk contained in a given 
> RTP packet; where the theora packet spans several RTP packets, the 
> decoder must use the fragment/continuation bits and the packet sequence 
> numbers to infer whether it got all the data or not.
> 
> > Could someone please tell me the correct way to break apart the 
> > ogg_packet if that is what is necessary? Or correct where I've gone
> > wrong above.
> 
> Just chop it into pieces so the RTP packets you're sending fit in your 
> MTU. Luca has written some example code you might find useful:
> 
>   http://downloads.xiph.org/releases/xiph-rtp/xiph-rtp-0.1.tar.gz
>   http://svn.xiph.org/trunk/xiph-rtp/

So it appears from the example code that you can just chop it
arbitrarily. Does this mean if you loose some of the packets for a
particular frame that it is impossible to reconstruct the whole frame?
If so, is there a better way to break apart the ogg packet so that each
resulting fragmented RTP packet is decodable in isolation (H261 does
this to some degree) or is this unecessary?

If this sort of stuff has already been discussed just point me to 
the mailing list archive.

> Hope that helps, and let us know if you get it working!

Will do.

Cheers,
    Rhys




More information about the xiph-rtp mailing list