[theora] encoding image from a webcam

Mircea Gliga mgliga at integrasoft.ro
Wed Nov 25 02:59:30 PST 2009


    I'm trying to encode a picture from my webcam using the theora 
codec. The final "product"
must encode a frame, send it over the network and decode it on "the 
other side".
For now, it must only work locally so we don't care about the transmission.
This is what I've understood till now: I have a char * buffer from the 
camera RG24,I convert it to
YCbCr 4:4:4, I encode it, resulting an ogg_packet. Then I provide this 
ogg_packet to the decoder,
get the YCbCr buffer , convert it back to RGB24 then display it.

Now the questions:
I have a Codec class with a function encoderInitialize(), where I 
initialize the encoder,
filling a th_info structure with the image's properties, fps, aspect 
ratio, colorspace, quality
and pixel_fmt. 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().

Thank you,/

-- 
Mircea Gliga

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/theora/attachments/20091125/5c95eb4f/attachment.htm 


More information about the theora mailing list