drone-control icon indicating copy to clipboard operation
drone-control copied to clipboard

"‘AV_INPUT_BUFFER_PADDING_SIZE’ undeclared (first use in this function)" in CentOS 7

Open cbwang2016 opened this issue 7 years ago • 4 comments

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

cbwang2016 avatar May 16 '18 06:05 cbwang2016

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?

socketbind avatar May 16 '18 07:05 socketbind

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.

cbwang2016 avatar May 16 '18 07:05 cbwang2016

I've got it work on Windows using ffmpeg 4.0! The compiling is too complicated on CentOS because of the GFW in China.

cbwang2016 avatar May 16 '18 13:05 cbwang2016

However I don't have a gamepad, I have to edit the codes to let it support keyboard.

cbwang2016 avatar May 16 '18 13:05 cbwang2016