[FFmpeg-user] No accelerated colorspace conversion found from yuv422p to rgb24

Ronny Bismark tum.bismark at gmail.com
Wed Dec 19 21:30:05 CET 2012


I used *$sudo make install* to compile (and it went trough) but no change
in the warning.
I'm not using a command line to use the camera. I use the usb_cam package
from ROS. I asked the same question in the ROS and OpenCV forum and they
said it's most likley a ffmpeg issue, which covers the most stuff I could
find on the web.

*here is the function in the usb_cam.cpp which takes probably care about
the conversion:*

static void
mjpeg2rgb(char *MJPEG, int len, char *RGB, int NumPixels)
{

  int got_picture;


  memset(RGB, 0, avframe_rgb_size);


#if LIBAVCODEC_VERSION_MAJOR > 52

  int decoded_len;

  AVPacket avpkt;

  av_init_packet(&avpkt);

  avpkt.size = len;

  avpkt.data = (unsigned char*)MJPEG;

  decoded_len = avcodec_decode_video2(avcodec_context, avframe_camera,
&got_picture, &avpkt);


  if (decoded_len < 0) {

      fprintf(stderr, "Error while decoding frame.\n");

      return;

  }

#else

  avcodec_decode_video(avcodec_context, avframe_camera, &got_picture,
(uint8_t *) MJPEG, len);

#endif

  if (!got_picture) {

    fprintf(stderr,"Webcam: expected picture but didn't get it...\n");

    return;

  }


  int xsize = avcodec_context->width;

  int ysize = avcodec_context->height;

  int pic_size = avpicture_get_size(avcodec_context->pix_fmt, xsize, ysize);

  if (pic_size != avframe_camera_size) {

    fprintf(stderr,"outbuf size mismatch.  pic_size: %d bufsize:
%d\n",pic_size,avframe_camera_size);

    return;

  }


  video_sws = sws_getContext( xsize, ysize, avcodec_context->pix_fmt,
xsize, ysize, PIX_FMT_RGB24, SWS_BILINEAR, NULL, NULL, NULL);

  sws_scale(video_sws, avframe_camera->data, avframe_camera->linesize, 0,
ysize, avframe_rgb->data, avframe_rgb->linesize );

  sws_freeContext(video_sws);


  int size = avpicture_layout((AVPicture *) avframe_rgb, PIX_FMT_RGB24,
xsize, ysize, (uint8_t *)RGB, avframe_rgb_size);

  if (size != avframe_rgb_size) {

    fprintf(stderr,"webcam: avpicture_layout error: %d\n",size);

    return;

  }

}


*The warning comes from yuv2rgb.c and is basically the if can't find
anything. Here the function*

SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c)
{
    SwsFunc t = NULL;

    if (HAVE_MMX) {
        t = ff_yuv2rgb_init_mmx(c);
    } else if (HAVE_VIS) {
        t = ff_yuv2rgb_init_vis(c);
    } else if (CONFIG_MLIB) {
        t = ff_yuv2rgb_init_mlib(c);
    } else if (HAVE_ALTIVEC) {
        t = ff_yuv2rgb_init_altivec(c);
    } else if (ARCH_BFIN) {
        t = ff_yuv2rgb_get_func_ptr_bfin(c);
    }

    if (t)
        return t;

    av_log(c, AV_LOG_WARNING, "No accelerated colorspace conversion found
from %s to %s.\n",
           av_get_pix_fmt_name(c->srcFormat),
av_get_pix_fmt_name(c->dstFormat));

    switch (c->dstFormat) {
    case PIX_FMT_BGR48BE:
    case PIX_FMT_BGR48LE:    return yuv2rgb_c_bgr48;
    case PIX_FMT_RGB48BE:
    case PIX_FMT_RGB48LE:    return yuv2rgb_c_48;
    case PIX_FMT_ARGB:
    case PIX_FMT_ABGR:       if (CONFIG_SWSCALE_ALPHA && c->srcFormat ==
PIX_FMT_YUVA420P) return yuva2argb_c;
    case PIX_FMT_RGBA:
    case PIX_FMT_BGRA:       return (CONFIG_SWSCALE_ALPHA && c->srcFormat
== PIX_FMT_YUVA420P) ? yuva2rgba_c : yuv2rgb_c_32;
    case PIX_FMT_RGB24:      return yuv2rgb_c_24_rgb;
    case PIX_FMT_BGR24:      return yuv2rgb_c_24_bgr;
    case PIX_FMT_RGB565:
    case PIX_FMT_BGR565:
    case PIX_FMT_RGB555:
    case PIX_FMT_BGR555:     return yuv2rgb_c_16;
    case PIX_FMT_RGB444:
    case PIX_FMT_BGR444:     return yuv2rgb_c_12_ordered_dither;
    case PIX_FMT_RGB8:
    case PIX_FMT_BGR8:       return yuv2rgb_c_8_ordered_dither;
    case PIX_FMT_RGB4:
    case PIX_FMT_BGR4:       return yuv2rgb_c_4_ordered_dither;
    case PIX_FMT_RGB4_BYTE:
    case PIX_FMT_BGR4_BYTE:  return yuv2rgb_c_4b_ordered_dither;
    case PIX_FMT_MONOBLACK:  return yuv2rgb_c_1_ordered_dither;
    default:
        assert(0);
    }
    return NULL;
}



2012/12/19 Roger Pack <rogerdpack2 at gmail.com>

> On 12/19/12, Ronny Bismark <tum.bismark at gmail.com> wrote:
> > Hi all,
> >
> > I would like to use the hardware enabled mjpeg compression of my webcam
> > (Logitech c920). I'm using a Pandaboard (ARM) and ubuntu 11.10 Server.
> > I use as camera driver the ROS usb_cam package which works with YUYV but
> > when I change the pixelformat to MJPEG I'll get following warning.
> >
> > *[swscaler @ 0xe8d640] No accelerated colorspace conversion found from
> > yuv422p to rgb24.*
>
> full command line and output please?
> (also you may need a $ sudo make install
> to get it to take...)
> Also I guess you're trying to save the frames here in their original
> mjpeg format, is that right?
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>


More information about the ffmpeg-user mailing list