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

James Zern jzern
Thu May 20 18:56:38 CEST 2010


On Thu, May 20, 2010 at 11:46, Vladimir Pantelic <pan at nt.tu-darmstadt.de> wrote:
> 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?
>
It's 0 (when decoding an alternate reference frame) or 1 for VP8. I
think this sample just needs an update.



More information about the ffmpeg-devel mailing list