[xiph-rtp] Theora over RTP
Ralph Giles
giles at xiph.org
Tue May 30 23:56:45 PDT 2006
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.
> 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/
Hope that helps, and let us know if you get it working!
-r
More information about the xiph-rtp
mailing list