[theora] trying to encode/decode videos using libtheora

Ribamar Santarosa de Sousa ribamar.santarosa at gmail.com
Mon Aug 28 09:27:53 PDT 2006


On 8/27/06, Ralph Giles <giles at xiph.org> wrote:
> On Sat, Aug 26, 2006 at 11:34:24PM -0300, Ribamar Santarosa de Sousa wrote:
>
> > http://opensvn.csie.org/ribamar/projects/streaming/cvaenc.c
> >        is likely to be writing out the things correctly;
> >        However...
>
> This is much better. There are four packets with appropriate page
> boundaries in the headers. The first packet is obviously corrupt (it
> should start with 0x80,'theora') I don't see why it should be though.
>

The problem was located.  I was doing as this:

theora_encode_comment(&tc, &header_p);
theora_encode_comment(&tc, &comment_p);
theora_encode_comment(&tc, &tables_p);
packin_and_write_out(header_p, comment_p, tables_p);

I thinks this mustn't be wrong, but it is. After the encode(tables_p),
I don't know why, the header_p gets crazy. Changing to the way that
everyone seems to do:

theora_encode_comment(&tc, &header_p);
do_something_with_your_packet_because_you_will_lose_it(header);
theora_encode_comment(&tc, &comment_p);
theora_encode_comment(&tc, &tables_p);
do_something_with_your_packets_because_you_will_lose_them(comment_p, tables_p);

things worked correctly. I'll try to do some more tests to find out
what is happening to the packet; looking at ogg_packet structure it
seems to me quite odd that it gets crazy that way, it sounds like a
ogg bug...

Thank you,
Ribamar


More information about the theora mailing list