[theora] encoding image from a webcam

Mircea Gliga mgliga at integrasoft.ro
Thu Nov 26 11:02:15 PST 2009


I've created a test class with an encoder and decoder. I'm creating the 
theora headers and immediately
add them to the decoder. For the first 2 packets th_decode_headerin 
returns positive nr,
at the 3rd packet returns TH_EBADHEADER.
Am I aloud to do that? I'm not using ogg_stream_packetin. I just want to 
encode a picture, resulting an
ogg_packet, then decode it on the client side...

    ogg_packet    op;
    th_enc_ctx    *td;
    th_comment    tc,tc1;
    th_info        theoraInfo,theoraInfo1;
    th_setup_info    *ts1;
for(;;)
    {
        int ret = th_encode_flushheader(td,&tc,&op);
      
       int ret2 = th_decode_headerin(&theoraInfo1,&tc1,&ts1,&op);
        if(0==ret)  break;
    }

What am i doing wrong here ?

Mircea Gliga



Mircea Gliga wrote:
>
>
> Mircea Gliga
>   
>
>
> Ralph Giles wrote:
>> 2009/11/25 Mircea Gliga <mgliga at integrasoft.ro>:
>>
>>   
>>> [...] Then I allocate a th_enc_ctx handle and repeatedly call
>>> th_encode_flushheader().
>>> Do I have to save this header packets? Do i have to provide this header
>>> packets to the decoder when I
>>> initialize it? Because the documentation says Parse the header packets by
>>> repeatedly calling
>>> th_decode_headerin().
>>>     
>>
>> Yes, you have to pass the headers into the decoder to configure it to
>> correctly parse the data packets.
>>
>>  -r
>>
>>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/theora/attachments/20091126/feb9629f/attachment.htm 


More information about the theora mailing list