[theora-dev] Simple decoder (keyframe only) implementation ?

Yorn yorn at gmx.net
Thu Jun 19 11:32:49 PDT 2008


Hi Nicolas,

You can use the ogg video tool ( http://dev.streamnik.de/oggvideotools.html ) 
stuff to do this. I think, the oggScroll tool would be a good starting point.

Using the c++ api is quite easy:

/* open a stream serializer */

StreamSerializer streamSerializer;
streamSerializer.open(inputFile);

/* create a theora decoder, packet and picture object */

TheoraDecoder theoraDecoder;
OggPacket packet;
TheoraVideoPacket picture;

/* loop for grabbing the picture */

while (streamSerializer.available()) {

  /* get the next picture and it's time */
  double time = streamSerializer.getNextPacket(packet);

  /* is this a keyframe */
  if (TheoraDecoder::isPacketKeyframe(packet)) {

    theoraDecoder << packet;
    theoraDecoder >> picture;

    /* here you are on your own :-) */
    /* you'll find a yuv_buffer within the picture object class */

  }
}

Regards - Yorn

Am Mittwoch 18 Juni 2008 16:27:51 schrieb Nicolas R.:
> Hello everybody !
>
> I am working on a php class to enable, on the server-side, to extract
> useful data from Ogg theora videos. http://opensource.grisambre.net/ogg .
>
> I need to have it extract a thumbnail picture from a video (much like
> dailymotion or youtube). Right now, I am doing it using the ffmpeg-php
> extension (for picture extraction only), but the problem is that this
> module is available on very few php servers.
>
> I am (still) trying to make a very simple implementation, for INTRA frames
> only, using the official theora documentation and going step by step. But I
> am feeling like doing everything from scratch, like reinventing the wheel,
> with many difficulties due to my lack of knowledge on video coding. And
> most of the time I have difficulties understanding some particular point of
> the process, and the actual theora svn code source is very difficult to
> corelate with the theora documentation (not same vocabulary, names of
> variables, way of decoding...)...
>
> My question is: has anyone done any simple decoder, for a single keyframe,
> in any structured langage I could reuse the code (c, c++, php, python,
> perl, java, anything ?)
>
> Thank you very much in advance...
> Nicolas
> _________________________________________________________________


More information about the theora-dev mailing list