[SOLVED] guvcview 2.0.4 compilation failure: 'PIX_FMT_YUV420P' undeclared
A simple v4l2 full-featured video grabber
Brought to you by:
assisp
I'm trying to compile guvcview 2.0.4 and I get the following error:
make all-recursive
make[1]: Entering directory '/home/fraga/src/guvcview-src-2.0.4'
Making all in gview_v4l2core
make[2]: Entering directory '/home/fraga/src/guvcview-src-2.0.4/gview_v4l2core'
CC libgviewv4l2core_la-uvc_h264.lo
uvc_h264.c: In function 'h264_init_decoder':
uvc_h264.c:1039:31: error: 'PIX_FMT_YUV420P' undeclared (first use in this function)
h264_ctx->context->pix_fmt = PIX_FMT_YUV420P;
^~~~~~~~~~~~~~~
uvc_h264.c:1039:31: note: each undeclared identifier is reported only once for each function it appears in
uvc_h264.c:1066:2: warning: 'avpicture_get_size' is deprecated [-Wdeprecated-declarations]
h264_ctx->pic_size = avpicture_get_size(h264_ctx->context->pix_fmt, width, height);
^~~~~~~~
In file included from uvc_h264.c:43:0:
/usr/local/include/libavcodec/avcodec.h:5406:5: note: declared here
int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
^~~~~~~~~~~~~~~~~~
uvc_h264.c: In function 'h264_decode':
uvc_h264.c:1102:2: warning: 'avcodec_decode_video2' is deprecated [-Wdeprecated-declarations]
int len = avcodec_decode_video2(h264_ctx->context, h264_ctx->picture, &got_picture, &avpkt);
^~~
In file included from uvc_h264.c:43:0:
/usr/local/include/libavcodec/avcodec.h:4753:5: note: declared here
int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
^~~~~~~~~~~~~~~~~~~~~
uvc_h264.c:1112:3: warning: 'avpicture_layout' is deprecated [-Wdeprecated-declarations]
avpicture_layout((AVPicture *) h264_ctx->picture, h264_ctx->context->pix_fmt,
^~~~~~~~~~~~~~~~
In file included from uvc_h264.c:43:0:
/usr/local/include/libavcodec/avcodec.h:5398:5: note: declared here
int avpicture_layout(const AVPicture *src, enum AVPixelFormat pix_fmt,
^~~~~~~~~~~~~~~~
make[2]: *** [Makefile:614: libgviewv4l2core_la-uvc_h264.lo] Error 1
make[2]: Leaving directory '/home/fraga/src/guvcview-src-2.0.4/gview_v4l2core'
make[1]: *** [Makefile:589: all-recursive] Error 1
make[1]: Leaving directory '/home/fraga/src/guvcview-src-2.0.4'
make: *** [Makefile:471: all] Error 2
Any hints?
Ok, the solution is to change all PIX_FMT_YUV420P to AV_PIX_FMT_YUV420P to compile with newer ffmpeg.