"‘AV_INPUT_BUFFER_PADDING_SIZE’ undeclared (first use in this function)" in CentOS 7
I'm on CentOS 7, using ffmpeg.
When I tried to do the "go get" for the first time, I got
In file included from src/github.com/socketbind/drone-control/decoder/h264dec.go:9:0: ./h264_decode.h:4:32: fatal error: libavcodec/avcodec.h: No such file or directory #include <libavcodec/avcodec.h> ^ compilation terminated.
Then, I typed
sudo ln -sf /usr/include/ffmpeg/* /usr/include/
and "go get" again.
However:
h264_decode.c: In function ‘h264dec_new’: h264_decode.c:11:12: warning: assignment makes pointer from integer without a cast [enabled by default] h->pkt = av_packet_alloc(); ^ h264_decode.c:17:47: error: ‘AV_INPUT_BUFFER_PADDING_SIZE’ undeclared (first use in this function) h->inbuf = (uint8_t*) malloc(INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE); ^ h264_decode.c:17:47: note: each undeclared identifier is reported only once for each function it appears in
Hi,
Perhaps you have an older ffmpeg/libavcodec version. Was it installed from a repository or have you compiled it yourself? What exact version do you have?
You're so right! It seems that I'm using ffmpeg 2.6! I'm trying to compile ffmpeg 4.0 on CentOS, It's quite complicated.
I've got it work on Windows using ffmpeg 4.0! The compiling is too complicated on CentOS because of the GFW in China.
However I don't have a gamepad, I have to edit the codes to let it support keyboard.