BUG: compiling error with latest ffmpeg on raspberrypi
I recompiled the latest ffmpeg for raspberry pi 3. (see below info)
trying to recompile motion with suggested commands (autoreconf -fiv; ./configure; make)
i receive an error
From my understanding AV_PIX_FMT_YUV420P is not defined.
ffmpeg guard used to check enum definition is obsolete
https://www.ffmpeg.org/doxygen/2.7/group__depr__guards.html
it compiles if those deprecated guards are in HAVE_FFMPEG block before "#if (LIBAVFORMAT_VERSION_MAJOR >= 56)"
====================
ffmpeg version 3.0.git-1ubuntu2+rpi1~xenial1.8 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.2) 20160609
configuration: --extra-version='1ubuntu2+rpi1~xenial1.8' --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-mmal --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --extra-cflags=-I/home/fork/ffmpeg_build/include --extra-ldflags=-L/home/fork/ffmpeg_build/lib --enable-shared
**************************
Configure status
motion 3.4.1+git1a38a37
**************************
OS : Linux
pthread support: Yes
jpeg support: Yes
V4L support: Yes
V4L2 support: Yes
SDL support: Yes
MMAL support: Yes
... MMAL_CFLAGS: -std=gnu99 -DHAVE_MMAL -Irasppicam -I/opt/vc/include
... MMAL_OBJ: mmalcam.o raspicam/RaspiCamControl.o raspicam/RaspiCLI.o
... MMAL_LIBS: -L/opt/vc/lib -lmmal_core -lmmal_util -lmmal_vc_client -lvcos -lvchostif -lvchiq_arm
FFmpeg support: Yes
... FFMPEG_CFLAGS: -I/usr/include/arm-linux-gnueabihf
... FFMPEG_LIBS: -lavutil-ffmpeg -lavformat-ffmpeg -lavcodec-ffmpeg -lswscale-ffmpeg
SQLite3 support: No
MYSQL support: No
PostgreSQL support: No
===================================
Compiling Motion object files...
--------------------------------------------------------------------------------
gcc -g -O2 -D_REENTRANT -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DMOTION_V4L2 -DMOTION_V4L2_OLD -DTYPE_32BIT="int" -DHAVE_BSWAP -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -Wall -DVERSION=\"3.4.1+git1a38a37\" -Dsysconfdir=\"/usr/local/etc\" -I/usr/include/arm-linux-gnueabihf -std=gnu99 -DHAVE_MMAL -Irasppicam -I/opt/vc/include -c -o netcam_rtsp.o netcam_rtsp.c
In file included from netcam_rtsp.c:27:0:
ffmpeg.h:35:23: warning: ‘enum PixelFormat’ declared inside parameter list
#define MyPixelFormat PixelFormat
^
ffmpeg.h:105:35: note: in expansion of macro ‘MyPixelFormat’
int my_image_get_buffer_size(enum MyPixelFormat pix_fmt, int width, int height)
^
ffmpeg.h:35:23: warning: its scope is only this definition or declaration, which is probably not what you want
#define MyPixelFormat PixelFormat
^
ffmpeg.h:105:35: note: in expansion of macro ‘MyPixelFormat’
int my_image_get_buffer_size(enum MyPixelFormat pix_fmt, int width, int height)
^
ffmpeg.h:35:23: warning: ‘enum PixelFormat’ declared inside parameter list
#define MyPixelFormat PixelFormat
^
ffmpeg.h:106:69: note: in expansion of macro ‘MyPixelFormat’
int my_image_copy_to_buffer(AVFrame *frame,uint8_t *buffer_ptr,enum MyPixelForm
^
ffmpeg.h:35:23: warning: ‘enum PixelFormat’ declared inside parameter list
#define MyPixelFormat PixelFormat
^
ffmpeg.h:107:66: note: in expansion of macro ‘MyPixelFormat’
int my_image_fill_arrays(AVFrame *frame,uint8_t *buffer_ptr,enum MyPixelFormat
^
netcam_rtsp.c: In function ‘decode_packet’:
netcam_rtsp.c:138:5: warning: ‘avcodec_decode_video2’ is deprecated [-Wdeprecated-declarations]
retcd = avcodec_decode_video2(cc, frame, &check, packet);
^
In file included from netcam_rtsp.h:5:0,
from netcam_rtsp.c:23:
/usr/include/arm-linux-gnueabihf/libavcodec/avcodec.h:4784:5: note: declared here
int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
^
netcam_rtsp.c:148:43: error: type of formal parameter 1 is incomplete
frame_size = my_image_get_buffer_size(cc->pix_fmt, cc->width, cc->height);
^
netcam_rtsp.c:152:67: error: type of formal parameter 3 is incomplete
retcd = my_image_copy_to_buffer(frame, (uint8_t *)buffer->ptr,cc->pix_fmt,c
^
netcam_rtsp.c: In function ‘netcam_open_codec’:
netcam_rtsp.c:196:5: warning: ‘codec’ is deprecated [-Wdeprecated-declarations]
dec_ctx = st->codec;
^
In file included from netcam_rtsp.h:6:0,
from netcam_rtsp.c:23:
/usr/include/arm-linux-gnueabihf/libavformat/avformat.h:882:21: note: declared here
AVCodecContext *codec;
^
netcam_rtsp.c: In function ‘netcam_rtsp_open_context’:
netcam_rtsp.c:497:5: warning: ‘codec’ is deprecated [-Wdeprecated-declarations]
netcam->rtsp->codec_context = netcam->rtsp->format_context->streams[netcam-
^
In file included from netcam_rtsp.h:6:0,
from netcam_rtsp.c:23:
/usr/include/arm-linux-gnueabihf/libavformat/avformat.h:882:21: note: declared here
AVCodecContext *codec;
^
In file included from netcam_rtsp.c:27:0:
netcam_rtsp.c: In function ‘netcam_rtsp_open_sws’:
ffmpeg.h:18:30: error: type of formal parameter 1 is incomplete
#define MY_PIX_FMT_YUV420P AV_PIX_FMT_YUV420P
^
netcam_rtsp.c:582:13: note: in expansion of macro ‘MY_PIX_FMT_YUV420P’
MY_PIX_FMT_YUV420P
^
netcam_rtsp.c: In function ‘netcam_rtsp_resize’:
netcam_rtsp.c:620:10: error: type of formal parameter 3 is incomplete
,netcam->rtsp->codec_context->pix_fmt
^
In file included from netcam_rtsp.c:27:0:
ffmpeg.h:18:30: error: type of formal parameter 3 is incomplete
#define MY_PIX_FMT_YUV420P AV_PIX_FMT_YUV420P
^
netcam_rtsp.c:638:10: note: in expansion of macro ‘MY_PIX_FMT_YUV420P’
,MY_PIX_FMT_YUV420P
^
ffmpeg.h:18:30: error: type of formal parameter 3 is incomplete
#define MY_PIX_FMT_YUV420P AV_PIX_FMT_YUV420P
^
netcam_rtsp.c:670:10: note: in expansion of macro ‘MY_PIX_FMT_YUV420P’
,MY_PIX_FMT_YUV420P
^
<builtin>: recipe for target 'netcam_rtsp.o' failed
Environment
Motion version: |
3.4.1+git1a38a37 |
ffmpeg version: |
3.0.git-1ubuntu2+rpi1~xenial1.8 |
Shared libraries: |
ffmpeg |
Server OS: |
ubuntu mate, raspberry pi, 4.4.20-v7+ |
--
MarcoBernardi - 11 Sep 2016
Follow up
Fix record