[theora] etheora
Ribamar Santarosa de Sousa
ribamar.santarosa at gmail.com
Wed Oct 31 18:54:41 PDT 2007
Hello,
I'm about to release a first version of etheora, a simplified api to
programming theora video encoding/decoding applications with ogg
containers. It uses and encapsulates libtheora + libogg API and
structures, so users need to know very few , about video and data
containers.
An encoding process is made by these steps:
/*a context declaration.*/
etheora_ctx *ec;
/*encoder configuration.*/
etheora_enc_configure(&ec, width, height, ETHEORA_ASPECT_NORMAL,
fopen("output-video.ogg"), fopen("debug_info.txt"));
/*encoder start.*/
etheora_enc_start(&ec);
/*drawing next frame, by puting a r,g,b or y,u,v pixel in (i,j) coordinate*/
etheora_enc_rgb_draw(&ec, i, j, r, g, b) (alternative: etheora_enc_yuv_draw()),
/*submiting frame to encoding.*/
etheora_enc_nextframe(&ec);
/*submiting last frame to encoding by finishing the process.*/
etheora_enc_finish(&ec);
The decoding process is quite similar.
/*a context declaration.*/
etheora_ctx *ec;
/*decoder configuration.*/
etheora_dec_configure(&ec, fopen("input-video.ogg"), fopen("debug_info.txt"));
/*decoder start.*/
etheora_dec_start(&ec);
/*reading video data.*/
etheora_get_width(&ec);
etheora_get_heigth(&ec);
etheora_get_fps_numerator(&ec);
etheora_get_fps_denominator(&ec);
etheora_get_aspect_numerator(&ec);
etheora_get_aspect_denominator(&ec);
/*getting next frame by decoding it.*/
etheora_dec_nextframe(&ec);
/*getting frame data, by reading a r,g,b or y,u,v pixel in (i,j) coordinate*/
etheora_dec_rgb_read(&ec, i, j, &r, &g, &b) (alternative:
etheora_dec_yuv_read()),
/* finishing the process.*/
etheora_dec_finish(&ec);
the functions _yuv_ and _rgb_ works transparently with OC_PF_420,
OC_PF_422 and OC_PF_PF_444, having the libtheora version used support
for them or not.
Etheora is documented here:
http://opensvn.csie.org/ribamar/projects/streaming/doc/etheora_documentation.pdf
Etheora code is here:
http://opensvn.csie.org/ribamar/projects/streaming/src/ {etheora is
etheora.c, etheora.h, etheora-int.h}
Etheora still doesn't have audio/speech support. (Although it can get
video data from videos with audio). And uses internally the old
libtheora API.
I'm still deciding where to host definetively the project, having a
project home page, start making real version control, etc. Also I'm
deciding which license to use (probably the same BSD-like as
libtheora). But I'd already like to hear from you opinions, suggests,
corrections (included english corrections), etc.
Thanks,
Ribamar
More information about the theora
mailing list