[FFmpeg-devel] [PATCH] VP8 de/encode via libvpx

Vladimir Pantelic pan
Thu May 20 17:46:56 CEST 2010


James Zern wrote:

+    if ((img = vpx_codec_get_frame(&ctx->decoder, &iter))) {
+        if (img->fmt != IMG_FMT_I420) {
+            av_log(avctx, AV_LOG_ERROR, "Unsupported output colorspace (%d)\n",
+                   img->fmt);
+            return AVERROR_INVALIDDATA;
+        }
+

hmm, reading your simple_decoder.c I see:

         while((img = vpx_codec_get_frame(&codec, &iter))) {                   //
             unsigned int plane, y;

             for(plane=0; plane < 3; plane++) {                                //
                 unsigned char *buf =img->planes[plane];                       //
                                                                               //
                 for(y=0; y<img->d_h >> (plane?1:0); y++) {                    //
                     fwrite(buf, 1, img->d_w >> (plane?1:0), outfile);         //
                     buf += img->stride[plane];                                //
                 }                                                             //
             }                                                                 //
         }

which implies there could be several frames output per decode call, is that the
case? If yes, how do you handle that in the ffmpeg wrapper?




More information about the ffmpeg-devel mailing list