我已经尝试了几乎所有关于OpenCv安装的博客,但我无法执行make步骤.
我遇到了以下问题
Building CXX object modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o In file included from /home/aman/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:65:0,from /home/aman/opencv/opencv/modules/videoio/src/cap_ffmpeg.cpp:45: /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:98:7: error: ‘CODEC_ID_H264’ was not declared in this scope { CODEC_ID_H264,MKTAG('H','2','6','4') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:99:7: error: ‘CODEC_ID_H264’ was not declared in this scope { CODEC_ID_H264,MKTAG('h',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:100:7: error: ‘CODEC_ID_H264’ was not declared in this scope { CODEC_ID_H264,MKTAG('X',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:101:7: error: ‘CODEC_ID_H264’ was not declared in this scope { CODEC_ID_H264,MKTAG('x',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:102:7: error: ‘CODEC_ID_H264’ was not declared in this scope { CODEC_ID_H264,MKTAG('a','v','c','1') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:103:7: error: ‘CODEC_ID_H264’ was not declared in this scope { CODEC_ID_H264,MKTAG('V','S','H') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:105:7: error: ‘CODEC_ID_H263’ was not declared in this scope { CODEC_ID_H263,'3') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:106:7: error: ‘CODEC_ID_H263P’ was not declared in this scope { CODEC_ID_H263P,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:107:7: error: ‘CODEC_ID_H263I’ was not declared in this scope { CODEC_ID_H263I,MKTAG('I',/* intel h263 */ ^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:108:7: error: ‘CODEC_ID_H261’ was not declared in this scope { CODEC_ID_H261,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:111:7: error: ‘CODEC_ID_H263P’ was not declared in this scope { CODEC_ID_H263P,MKTAG('U',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:112:7: error: ‘CODEC_ID_H263P’ was not declared in this scope { CODEC_ID_H263P,MKTAG('v','i',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:114:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope { CODEC_ID_MPEG4,MKTAG('F','M','P',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:115:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope { CODEC_ID_MPEG4,MKTAG('D','I','V','X') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:116:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope { CODEC_ID_MPEG4,'X','5','0') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:117:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope { CODEC_ID_MPEG4,'D') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:118:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope { CODEC_ID_MPEG4,MKTAG('M','4','S') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:119:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope { CODEC_ID_MPEG4,'2') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:120:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope { CODEC_ID_MPEG4,MKTAG(0x04,0) },/* some broken avi use this */ ^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:123:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope { CODEC_ID_MPEG4,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:124:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope { CODEC_ID_MPEG4,MKTAG('B','L','Z',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:125:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope { CODEC_ID_MPEG4,MKTAG('m','p','v') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:126:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope { CODEC_ID_MPEG4,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:127:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope { CODEC_ID_MPEG4,MKTAG('W','1','F') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:128:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope { CODEC_ID_MPEG4,MKTAG('S','E','D','G') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:130:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope { CODEC_ID_MPEG4,MKTAG('R',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:132:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope { CODEC_ID_MSMPEG4V3,/* default signature when using MSMPEG4 */ ^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:133:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope { CODEC_ID_MSMPEG4V3,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:136:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope { CODEC_ID_MSMPEG4V3,'G',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:137:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope { CODEC_ID_MSMPEG4V3,'5') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:138:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope { CODEC_ID_MSMPEG4V3,'6') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:139:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope { CODEC_ID_MSMPEG4V3,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:140:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope { CODEC_ID_MSMPEG4V3,MKTAG('A',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:141:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope { CODEC_ID_MSMPEG4V3,MKTAG('C','O',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:142:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope { CODEC_ID_MSMPEG4V3,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:144:7: error: ‘CODEC_ID_MSMPEG4V2’ was not declared in this scope { CODEC_ID_MSMPEG4V2,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:147:7: error: ‘CODEC_ID_MSMPEG4V2’ was not declared in this scope { CODEC_ID_MSMPEG4V2,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:149:7: error: ‘CODEC_ID_MSMPEG4V1’ was not declared in this scope { CODEC_ID_MSMPEG4V1,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:151:7: error: ‘CODEC_ID_WMV1’ was not declared in this scope { CODEC_ID_WMV1,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:154:7: error: ‘CODEC_ID_WMV2’ was not declared in this scope { CODEC_ID_WMV2,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:155:7: error: ‘CODEC_ID_DVVIDEO’ was not declared in this scope { CODEC_ID_DVVIDEO,MKTAG('d','s','d') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:156:7: error: ‘CODEC_ID_DVVIDEO’ was not declared in this scope { CODEC_ID_DVVIDEO,'h',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:157:7: error: ‘CODEC_ID_DVVIDEO’ was not declared in this scope { CODEC_ID_DVVIDEO,'l') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:158:7: error: ‘CODEC_ID_DVVIDEO’ was not declared in this scope { CODEC_ID_DVVIDEO,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:159:7: error: ‘CODEC_ID_MPEG1VIDEO’ was not declared in this scope { CODEC_ID_MPEG1VIDEO,'g',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:160:7: error: ‘CODEC_ID_MPEG1VIDEO’ was not declared in this scope { CODEC_ID_MPEG1VIDEO,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:161:7: error: ‘CODEC_ID_MPEG2VIDEO’ was not declared in this scope { CODEC_ID_MPEG2VIDEO,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:162:7: error: ‘CODEC_ID_MPEG2VIDEO’ was not declared in this scope { CODEC_ID_MPEG2VIDEO,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:163:7: error: ‘CODEC_ID_MPEG1VIDEO’ was not declared in this scope { CODEC_ID_MPEG1VIDEO,MKTAG('P',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:164:7: error: ‘CODEC_ID_MPEG1VIDEO’ was not declared in this scope { CODEC_ID_MPEG1VIDEO,'C','R',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:165:7: error: ‘CODEC_ID_MPEG1VIDEO’ was not declared in this scope { CODEC_ID_MPEG1VIDEO,0x10000001 },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:166:7: error: ‘CODEC_ID_MPEG2VIDEO’ was not declared in this scope { CODEC_ID_MPEG2VIDEO,0x10000002 },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:167:7: error: ‘CODEC_ID_MPEG2VIDEO’ was not declared in this scope { CODEC_ID_MPEG2VIDEO,' ') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:168:7: error: ‘CODEC_ID_MPEG2VIDEO’ was not declared in this scope { CODEC_ID_MPEG2VIDEO,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:169:7: error: ‘CODEC_ID_MJPEG’ was not declared in this scope { CODEC_ID_MJPEG,'J',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:170:7: error: ‘CODEC_ID_MJPEG’ was not declared in this scope { CODEC_ID_MJPEG,MKTAG('L',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:171:7: error: ‘CODEC_ID_LJPEG’ was not declared in this scope { CODEC_ID_LJPEG,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:172:7: error: ‘CODEC_ID_MJPEG’ was not declared in this scope { CODEC_ID_MJPEG,MKTAG('J','L') },/* Pegasus lossless JPEG */ ^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:173:7: error: ‘CODEC_ID_MJPEG’ was not declared in this scope { CODEC_ID_MJPEG,/* JPEG-LS custom FOURCC for avi - decoder */ ^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:174:7: error: ‘CODEC_ID_MJPEG’ was not declared in this scope { CODEC_ID_MJPEG,MKTAG('j','e','g') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:175:7: error: ‘CODEC_ID_MJPEG’ was not declared in this scope { CODEC_ID_MJPEG,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:176:7: error: ‘CODEC_ID_MJPEG’ was not declared in this scope { CODEC_ID_MJPEG,'n') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:177:7: error: ‘CODEC_ID_HUFFYUV’ was not declared in this scope { CODEC_ID_HUFFYUV,'F','Y','U') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:178:7: error: ‘CODEC_ID_FFVHUFF’ was not declared in this scope { CODEC_ID_FFVHUFF,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:179:7: error: ‘CODEC_ID_CYUV’ was not declared in this scope { CODEC_ID_CYUV,'U','V') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:180:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope { CODEC_ID_RAWVIDEO,0 },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:181:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope { CODEC_ID_RAWVIDEO,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:182:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope { CODEC_ID_RAWVIDEO,MKTAG('Y',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:183:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope { CODEC_ID_RAWVIDEO,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:184:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope { CODEC_ID_RAWVIDEO,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:185:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope { CODEC_ID_RAWVIDEO,'Y') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:186:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope { CODEC_ID_RAWVIDEO,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:187:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope { CODEC_ID_RAWVIDEO,'8','0',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:188:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope { CODEC_ID_RAWVIDEO,'C') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:189:7: error: ‘CODEC_ID_INDEO3’ was not declared in this scope { CODEC_ID_INDEO3,'3',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:190:7: error: ‘CODEC_ID_INDEO3’ was not declared in this scope { CODEC_ID_INDEO3,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:191:7: error: ‘CODEC_ID_VP3’ was not declared in this scope { CODEC_ID_VP3,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:192:7: error: ‘CODEC_ID_VP3’ was not declared in this scope { CODEC_ID_VP3,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:193:7: error: ‘CODEC_ID_ASV1’ was not declared in this scope { CODEC_ID_ASV1,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:194:7: error: ‘CODEC_ID_ASV2’ was not declared in this scope { CODEC_ID_ASV2,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:195:7: error: ‘CODEC_ID_VCR1’ was not declared in this scope { CODEC_ID_VCR1,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:196:7: error: ‘CODEC_ID_FFV1’ was not declared in this scope { CODEC_ID_FFV1,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:197:7: error: ‘CODEC_ID_XAN_WC4’ was not declared in this scope { CODEC_ID_XAN_WC4,'x','a',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:198:7: error: ‘CODEC_ID_MSRLE’ was not declared in this scope { CODEC_ID_MSRLE,'r','l','e') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:199:7: error: ‘CODEC_ID_MSRLE’ was not declared in this scope { CODEC_ID_MSRLE,MKTAG(0x1,0x0,0x0) },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:200:7: error: ‘CODEC_ID_MSVIDEO1’ was not declared in this scope { CODEC_ID_MSVIDEO1,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:201:7: error: ‘CODEC_ID_MSVIDEO1’ was not declared in this scope { CODEC_ID_MSVIDEO1,'c') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:202:7: error: ‘CODEC_ID_MSVIDEO1’ was not declared in this scope { CODEC_ID_MSVIDEO1,'A','M') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:203:7: error: ‘CODEC_ID_MSVIDEO1’ was not declared in this scope { CODEC_ID_MSVIDEO1,MKTAG('c','m') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:204:7: error: ‘CODEC_ID_MSVIDEO1’ was not declared in this scope { CODEC_ID_MSVIDEO1,'H',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:205:7: error: ‘CODEC_ID_MSVIDEO1’ was not declared in this scope { CODEC_ID_MSVIDEO1,MKTAG('w',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:206:7: error: ‘CODEC_ID_CINEPAK’ was not declared in this scope { CODEC_ID_CINEPAK,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:207:7: error: ‘CODEC_ID_TRUEMOTION1’ was not declared in this scope { CODEC_ID_TRUEMOTION1,'K') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:208:7: error: ‘CODEC_ID_MSZH’ was not declared in this scope { CODEC_ID_MSZH,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:209:7: error: ‘CODEC_ID_ZLIB’ was not declared in this scope { CODEC_ID_ZLIB,MKTAG('Z','B') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:210:7: error: ‘CODEC_ID_SNOW’ was not declared in this scope { CODEC_ID_SNOW,'N','W') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:211:7: error: ‘CODEC_ID_4XM’ was not declared in this scope { CODEC_ID_4XM,MKTAG('4',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:212:7: error: ‘CODEC_ID_FLV1’ was not declared in this scope { CODEC_ID_FLV1,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:213:7: error: ‘CODEC_ID_SVQ1’ was not declared in this scope { CODEC_ID_SVQ1,MKTAG('s','q',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:214:7: error: ‘CODEC_ID_TSCC’ was not declared in this scope { CODEC_ID_TSCC,MKTAG('t',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:215:7: error: ‘CODEC_ID_ULTI’ was not declared in this scope { CODEC_ID_ULTI,'T','I') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:216:7: error: ‘CODEC_ID_VIXL’ was not declared in this scope { CODEC_ID_VIXL,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:217:7: error: ‘CODEC_ID_QPEG’ was not declared in this scope { CODEC_ID_QPEG,MKTAG('Q',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:218:7: error: ‘CODEC_ID_QPEG’ was not declared in this scope { CODEC_ID_QPEG,'.',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:219:7: error: ‘CODEC_ID_QPEG’ was not declared in this scope { CODEC_ID_QPEG,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:220:7: error: ‘CODEC_ID_WMV3’ was not declared in this scope { CODEC_ID_WMV3,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:221:7: error: ‘CODEC_ID_LOCO’ was not declared in this scope { CODEC_ID_LOCO,'O') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:222:7: error: ‘CODEC_ID_THEORA’ was not declared in this scope { CODEC_ID_THEORA,'o') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:224:7: error: ‘CODEC_ID_WNV1’ was not declared in this scope { CODEC_ID_WNV1,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:225:7: error: ‘CODEC_ID_AASC’ was not declared in this scope { CODEC_ID_AASC,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:226:7: error: ‘CODEC_ID_INDEO2’ was not declared in this scope { CODEC_ID_INDEO2,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:227:7: error: ‘CODEC_ID_FRAPS’ was not declared in this scope { CODEC_ID_FRAPS,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:228:7: error: ‘CODEC_ID_TRUEMOTION2’ was not declared in this scope { CODEC_ID_TRUEMOTION2,MKTAG('T',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:231:7: error: ‘CODEC_ID_FLASHSV’ was not declared in this scope { CODEC_ID_FLASHSV,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:232:7: error: ‘CODEC_ID_JPEGLS’ was not declared in this scope { CODEC_ID_JPEGLS,/* JPEG-LS custom FOURCC for avi - encoder */ ^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:233:7: error: ‘CODEC_ID_VC1’ was not declared in this scope { CODEC_ID_VC1,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:234:7: error: ‘CODEC_ID_VC1’ was not declared in this scope { CODEC_ID_VC1,'A') },^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:235:7: error: ‘CODEC_ID_CSCD’ was not declared in this scope { CODEC_ID_CSCD,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:236:7: error: ‘CODEC_ID_ZMBV’ was not declared in this scope { CODEC_ID_ZMBV,'B',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:237:7: error: ‘CODEC_ID_KMVC’ was not declared in this scope { CODEC_ID_KMVC,MKTAG('K',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:240:7: error: ‘CODEC_ID_VP5’ was not declared in this scope { CODEC_ID_VP5,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:241:7: error: ‘CODEC_ID_VP6’ was not declared in this scope { CODEC_ID_VP6,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:242:7: error: ‘CODEC_ID_VP6’ was not declared in this scope { CODEC_ID_VP6,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:243:7: error: ‘CODEC_ID_VP6’ was not declared in this scope { CODEC_ID_VP6,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:244:7: error: ‘CODEC_ID_VP6F’ was not declared in this scope { CODEC_ID_VP6F,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:245:7: error: ‘CODEC_ID_JPEG2000’ was not declared in this scope { CODEC_ID_JPEG2000,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:246:7: error: ‘CODEC_ID_VMNC’ was not declared in this scope { CODEC_ID_VMNC,'n',^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:250:7: error: ‘CODEC_ID_TARGA’ was not declared in this scope { CODEC_ID_TARGA,^ /home/aman/opencv/opencv/modules/videoio/src/ffmpeg_codecs.hpp:252:7: error: ‘CODEC_ID_NONE’ was not declared in this scope { CODEC_ID_NONE,^ In file included from /home/aman/opencv/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:0: /home/aman/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘double CvCapture_FFMPEG::getProperty(int) const’: /home/aman/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:784:33: error: ‘AVStream’ has no member named ‘r_frame_rate’ return av_q2d(video_st->r_frame_rate); ^ /home/aman/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘double CvCapture_FFMPEG::get_fps() const’: /home/aman/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:831:49: error: ‘AVStream’ has no member named ‘r_frame_rate’ double fps = r2d(ic->streams[video_stream]->r_frame_rate); ^ /home/aman/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In function ‘AVStream* icv_add_video_stream_FFMPEG(AVFormatContext*,AVCodecID,int,double,int)’: /home/aman/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1220:24: error: ‘CODEC_ID_H264’ was not declared in this scope if (c->codec_id == CODEC_ID_H264) { ^ In file included from /home/aman/opencv/opencv/modules/videoio/src/cap_ffmpeg.cpp:45:0: /home/aman/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In function ‘int icv_av_write_frame_FFMPEG(AVFormatContext*,AVStream*,uint8_t*,uint32_t,AVFrame*)’: /home/aman/opencv/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1269:72: error: ‘avcodec_encode_video’ was not declared in this scope out_size = avcodec_encode_video(c,outbuf,outbuf_size,picture); ^ modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:169: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o' Failed make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o] Error 1 CMakeFiles/Makefile2:2452: recipe for target 'modules/videoio/CMakeFiles/opencv_videoio.dir/all' Failed make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2 Makefile:133: recipe for target 'all' Failed make: *** [all] Error 2
当安装依赖项时,它说无法找到libtiff4-dev所以我按照建议说它安装了libtiff5-dev
类似的是其他一些依赖libxine-dev的问题
所以我安装了给定的替代libxine2-dev.
我怎么解决这个问题?
这是因为libav更改了API并删除了一些仍在OpenCV中使用的东西. Ubuntu 14.10使用libav API版本11,OpenCV仍然使用API版本9.
问题是 CODEC_ID_ *改为 AV_CODEC_ID_ *.
原文链接:https://www.f2er.com/ubuntu/347416.html问题是 CODEC_ID_ *改为 AV_CODEC_ID_ *.
我建议安装已经在Ubuntu存储库中的OpenCV:
sudo apt-get install libopencv-dev
P.S:
你可以在OpenCV DevZone阅读更多相关信息