无法制作Opencv 2.4.9 Ubuntu 14.10

时间:2015-04-01 18:19:18

标签: opencv ubuntu build-process

我在其网站instructions之后尝试make OpenVC:

sudo apt-get install build-essential
sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

unzip opencv-2.4.10.zip
mkdir build
cd build

cmake -DCMAKE_BUILD_TYPE=Release \
      -DENABLE_AVX=ON \
      -DENABLE_FAST_MATH=ON \
      -DENABLE_SSE=ON \
      -DENABLE_SSE2=ON \
      -DENABLE_SSE3=ON \
      -DENABLE_SSE41=ON \
      -DENABLE_SSE42=ON \
      -DENABLE_SSSE3=ON \
      /absolute/path/to/opencv-2.4.10

make -j7

最终以下列输出失败:

8:7: error: ‘CODEC_ID_H263P’ was not declared in this scope
     { CODEC_ID_H263P, MKTAG('v', 'i', 'v', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:120:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope
     { CODEC_ID_MPEG4, MKTAG('F', 'M', 'P', '4') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:121:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope
     { CODEC_ID_MPEG4, MKTAG('D', 'I', 'V', 'X') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:122:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope
     { CODEC_ID_MPEG4, MKTAG('D', 'X', '5', '0') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:123:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope
     { CODEC_ID_MPEG4, MKTAG('X', 'V', 'I', 'D') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:124:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope
     { CODEC_ID_MPEG4, MKTAG('M', 'P', '4', 'S') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:125:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope
     { CODEC_ID_MPEG4, MKTAG('M', '4', 'S', '2') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:126:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope
     { CODEC_ID_MPEG4, MKTAG(0x04, 0, 0, 0) }, /* some broken avi use this */
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:129:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope
     { CODEC_ID_MPEG4, MKTAG('D', 'I', 'V', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:130:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope
     { CODEC_ID_MPEG4, MKTAG('B', 'L', 'Z', '0') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:131:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope
     { CODEC_ID_MPEG4, MKTAG('m', 'p', '4', 'v') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:132:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope
     { CODEC_ID_MPEG4, MKTAG('U', 'M', 'P', '4') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:133:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope
     { CODEC_ID_MPEG4, MKTAG('W', 'V', '1', 'F') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:134:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope
     { CODEC_ID_MPEG4, MKTAG('S', 'E', 'D', 'G') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:136:7: error: ‘CODEC_ID_MPEG4’ was not declared in this scope
     { CODEC_ID_MPEG4, MKTAG('R', 'M', 'P', '4') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:138:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope
     { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '3') }, /* default signature when using MSMPEG4 */
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:139:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope
     { CODEC_ID_MSMPEG4V3, MKTAG('M', 'P', '4', '3') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:142:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope
     { CODEC_ID_MSMPEG4V3, MKTAG('M', 'P', 'G', '3') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:143:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope
     { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '5') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:144:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope
     { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '6') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:145:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope
     { CODEC_ID_MSMPEG4V3, MKTAG('D', 'I', 'V', '4') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:146:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope
     { CODEC_ID_MSMPEG4V3, MKTAG('A', 'P', '4', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:147:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope
     { CODEC_ID_MSMPEG4V3, MKTAG('C', 'O', 'L', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:148:7: error: ‘CODEC_ID_MSMPEG4V3’ was not declared in this scope
     { CODEC_ID_MSMPEG4V3, MKTAG('C', 'O', 'L', '0') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:150:7: error: ‘CODEC_ID_MSMPEG4V2’ was not declared in this scope
     { CODEC_ID_MSMPEG4V2, MKTAG('M', 'P', '4', '2') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:153:7: error: ‘CODEC_ID_MSMPEG4V2’ was not declared in this scope
     { CODEC_ID_MSMPEG4V2, MKTAG('D', 'I', 'V', '2') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:155:7: error: ‘CODEC_ID_MSMPEG4V1’ was not declared in this scope
     { CODEC_ID_MSMPEG4V1, MKTAG('M', 'P', 'G', '4') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:157:7: error: ‘CODEC_ID_WMV1’ was not declared in this scope
     { CODEC_ID_WMV1, MKTAG('W', 'M', 'V', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:160:7: error: ‘CODEC_ID_WMV2’ was not declared in this scope
     { CODEC_ID_WMV2, MKTAG('W', 'M', 'V', '2') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:161:7: error: ‘CODEC_ID_DVVIDEO’ was not declared in this scope
     { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 's', 'd') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:162:7: error: ‘CODEC_ID_DVVIDEO’ was not declared in this scope
     { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 'h', 'd') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:163:7: error: ‘CODEC_ID_DVVIDEO’ was not declared in this scope
     { CODEC_ID_DVVIDEO, MKTAG('d', 'v', 's', 'l') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:164:7: error: ‘CODEC_ID_DVVIDEO’ was not declared in this scope
     { CODEC_ID_DVVIDEO, MKTAG('d', 'v', '2', '5') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:165:7: error: ‘CODEC_ID_MPEG1VIDEO’ was not declared in this scope
     { CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', 'g', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:166:7: error: ‘CODEC_ID_MPEG1VIDEO’ was not declared in this scope
     { CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', 'g', '2') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:167:7: error: ‘CODEC_ID_MPEG2VIDEO’ was not declared in this scope
     { CODEC_ID_MPEG2VIDEO, MKTAG('m', 'p', 'g', '2') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:168:7: error: ‘CODEC_ID_MPEG2VIDEO’ was not declared in this scope
     { CODEC_ID_MPEG2VIDEO, MKTAG('M', 'P', 'E', 'G') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:169:7: error: ‘CODEC_ID_MPEG1VIDEO’ was not declared in this scope
     { CODEC_ID_MPEG1VIDEO, MKTAG('P', 'I', 'M', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:170:7: error: ‘CODEC_ID_MPEG1VIDEO’ was not declared in this scope
     { CODEC_ID_MPEG1VIDEO, MKTAG('V', 'C', 'R', '2') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:171:7: error: ‘CODEC_ID_MPEG1VIDEO’ was not declared in this scope
     { CODEC_ID_MPEG1VIDEO, 0x10000001 },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:172:7: error: ‘CODEC_ID_MPEG2VIDEO’ was not declared in this scope
     { CODEC_ID_MPEG2VIDEO, 0x10000002 },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:173:7: error: ‘CODEC_ID_MPEG2VIDEO’ was not declared in this scope
     { CODEC_ID_MPEG2VIDEO, MKTAG('D', 'V', 'R', ' ') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:174:7: error: ‘CODEC_ID_MPEG2VIDEO’ was not declared in this scope
     { CODEC_ID_MPEG2VIDEO, MKTAG('M', 'M', 'E', 'S') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:175:7: error: ‘CODEC_ID_MJPEG’ was not declared in this scope
     { CODEC_ID_MJPEG, MKTAG('M', 'J', 'P', 'G') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:176:7: error: ‘CODEC_ID_MJPEG’ was not declared in this scope
     { CODEC_ID_MJPEG, MKTAG('L', 'J', 'P', 'G') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:177:7: error: ‘CODEC_ID_LJPEG’ was not declared in this scope
     { CODEC_ID_LJPEG, MKTAG('L', 'J', 'P', 'G') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:178:7: error: ‘CODEC_ID_MJPEG’ was not declared in this scope
     { CODEC_ID_MJPEG, MKTAG('J', 'P', 'G', 'L') }, /* Pegasus lossless JPEG */
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:179:7: error: ‘CODEC_ID_MJPEG’ was not declared in this scope
     { CODEC_ID_MJPEG, MKTAG('M', 'J', 'L', 'S') }, /* JPEG-LS custom FOURCC for avi - decoder */
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:180:7: error: ‘CODEC_ID_MJPEG’ was not declared in this scope
     { CODEC_ID_MJPEG, MKTAG('j', 'p', 'e', 'g') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:181:7: error: ‘CODEC_ID_MJPEG’ was not declared in this scope
     { CODEC_ID_MJPEG, MKTAG('I', 'J', 'P', 'G') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:182:7: error: ‘CODEC_ID_MJPEG’ was not declared in this scope
     { CODEC_ID_MJPEG, MKTAG('A', 'V', 'R', 'n') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:183:7: error: ‘CODEC_ID_HUFFYUV’ was not declared in this scope
     { CODEC_ID_HUFFYUV, MKTAG('H', 'F', 'Y', 'U') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:184:7: error: ‘CODEC_ID_FFVHUFF’ was not declared in this scope
     { CODEC_ID_FFVHUFF, MKTAG('F', 'F', 'V', 'H') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:185:7: error: ‘CODEC_ID_CYUV’ was not declared in this scope
     { CODEC_ID_CYUV, MKTAG('C', 'Y', 'U', 'V') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:186:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope
     { CODEC_ID_RAWVIDEO, 0 },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:187:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope
     { CODEC_ID_RAWVIDEO, MKTAG('I', '4', '2', '0') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:188:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope
     { CODEC_ID_RAWVIDEO, MKTAG('Y', 'U', 'Y', '2') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:189:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope
     { CODEC_ID_RAWVIDEO, MKTAG('Y', '4', '2', '2') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:190:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope
     { CODEC_ID_RAWVIDEO, MKTAG('Y', 'V', '1', '2') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:191:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope
     { CODEC_ID_RAWVIDEO, MKTAG('U', 'Y', 'V', 'Y') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:192:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope
     { CODEC_ID_RAWVIDEO, MKTAG('I', 'Y', 'U', 'V') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:193:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope
     { CODEC_ID_RAWVIDEO, MKTAG('Y', '8', '0', '0') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:194:7: error: ‘CODEC_ID_RAWVIDEO’ was not declared in this scope
     { CODEC_ID_RAWVIDEO, MKTAG('H', 'D', 'Y', 'C') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:195:7: error: ‘CODEC_ID_INDEO3’ was not declared in this scope
     { CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:196:7: error: ‘CODEC_ID_INDEO3’ was not declared in this scope
     { CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '2') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:197:7: error: ‘CODEC_ID_VP3’ was not declared in this scope
     { CODEC_ID_VP3, MKTAG('V', 'P', '3', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:198:7: error: ‘CODEC_ID_VP3’ was not declared in this scope
     { CODEC_ID_VP3, MKTAG('V', 'P', '3', '0') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:199:7: error: ‘CODEC_ID_ASV1’ was not declared in this scope
     { CODEC_ID_ASV1, MKTAG('A', 'S', 'V', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:200:7: error: ‘CODEC_ID_ASV2’ was not declared in this scope
     { CODEC_ID_ASV2, MKTAG('A', 'S', 'V', '2') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:201:7: error: ‘CODEC_ID_VCR1’ was not declared in this scope
     { CODEC_ID_VCR1, MKTAG('V', 'C', 'R', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:202:7: error: ‘CODEC_ID_FFV1’ was not declared in this scope
     { CODEC_ID_FFV1, MKTAG('F', 'F', 'V', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:203:7: error: ‘CODEC_ID_XAN_WC4’ was not declared in this scope
     { CODEC_ID_XAN_WC4, MKTAG('X', 'x', 'a', 'n') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:204:7: error: ‘CODEC_ID_MSRLE’ was not declared in this scope
     { CODEC_ID_MSRLE, MKTAG('m', 'r', 'l', 'e') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:205:7: error: ‘CODEC_ID_MSRLE’ was not declared in this scope
     { CODEC_ID_MSRLE, MKTAG(0x1, 0x0, 0x0, 0x0) },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:206:7: error: ‘CODEC_ID_MSVIDEO1’ was not declared in this scope
     { CODEC_ID_MSVIDEO1, MKTAG('M', 'S', 'V', 'C') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:207:7: error: ‘CODEC_ID_MSVIDEO1’ was not declared in this scope
     { CODEC_ID_MSVIDEO1, MKTAG('m', 's', 'v', 'c') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:208:7: error: ‘CODEC_ID_MSVIDEO1’ was not declared in this scope
     { CODEC_ID_MSVIDEO1, MKTAG('C', 'R', 'A', 'M') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:209:7: error: ‘CODEC_ID_MSVIDEO1’ was not declared in this scope
     { CODEC_ID_MSVIDEO1, MKTAG('c', 'r', 'a', 'm') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:210:7: error: ‘CODEC_ID_MSVIDEO1’ was not declared in this scope
     { CODEC_ID_MSVIDEO1, MKTAG('W', 'H', 'A', 'M') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:211:7: error: ‘CODEC_ID_MSVIDEO1’ was not declared in this scope
     { CODEC_ID_MSVIDEO1, MKTAG('w', 'h', 'a', 'm') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:212:7: error: ‘CODEC_ID_CINEPAK’ was not declared in this scope
     { CODEC_ID_CINEPAK, MKTAG('c', 'v', 'i', 'd') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:213:7: error: ‘CODEC_ID_TRUEMOTION1’ was not declared in this scope
     { CODEC_ID_TRUEMOTION1, MKTAG('D', 'U', 'C', 'K') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:214:7: error: ‘CODEC_ID_MSZH’ was not declared in this scope
     { CODEC_ID_MSZH, MKTAG('M', 'S', 'Z', 'H') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:215:7: error: ‘CODEC_ID_ZLIB’ was not declared in this scope
     { CODEC_ID_ZLIB, MKTAG('Z', 'L', 'I', 'B') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:216:7: error: ‘CODEC_ID_SNOW’ was not declared in this scope
     { CODEC_ID_SNOW, MKTAG('S', 'N', 'O', 'W') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:217:7: error: ‘CODEC_ID_4XM’ was not declared in this scope
     { CODEC_ID_4XM, MKTAG('4', 'X', 'M', 'V') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:218:7: error: ‘CODEC_ID_FLV1’ was not declared in this scope
     { CODEC_ID_FLV1, MKTAG('F', 'L', 'V', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:219:7: error: ‘CODEC_ID_SVQ1’ was not declared in this scope
     { CODEC_ID_SVQ1, MKTAG('s', 'v', 'q', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:220:7: error: ‘CODEC_ID_TSCC’ was not declared in this scope
     { CODEC_ID_TSCC, MKTAG('t', 's', 'c', 'c') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:221:7: error: ‘CODEC_ID_ULTI’ was not declared in this scope
     { CODEC_ID_ULTI, MKTAG('U', 'L', 'T', 'I') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:222:7: error: ‘CODEC_ID_VIXL’ was not declared in this scope
     { CODEC_ID_VIXL, MKTAG('V', 'I', 'X', 'L') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:223:7: error: ‘CODEC_ID_QPEG’ was not declared in this scope
     { CODEC_ID_QPEG, MKTAG('Q', 'P', 'E', 'G') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:224:7: error: ‘CODEC_ID_QPEG’ was not declared in this scope
     { CODEC_ID_QPEG, MKTAG('Q', '1', '.', '0') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:225:7: error: ‘CODEC_ID_QPEG’ was not declared in this scope
     { CODEC_ID_QPEG, MKTAG('Q', '1', '.', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:226:7: error: ‘CODEC_ID_WMV3’ was not declared in this scope
     { CODEC_ID_WMV3, MKTAG('W', 'M', 'V', '3') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:227:7: error: ‘CODEC_ID_LOCO’ was not declared in this scope
     { CODEC_ID_LOCO, MKTAG('L', 'O', 'C', 'O') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:228:7: error: ‘CODEC_ID_THEORA’ was not declared in this scope
     { CODEC_ID_THEORA, MKTAG('t', 'h', 'e', 'o') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:230:7: error: ‘CODEC_ID_WNV1’ was not declared in this scope
     { CODEC_ID_WNV1, MKTAG('W', 'N', 'V', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:231:7: error: ‘CODEC_ID_AASC’ was not declared in this scope
     { CODEC_ID_AASC, MKTAG('A', 'A', 'S', 'C') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:232:7: error: ‘CODEC_ID_INDEO2’ was not declared in this scope
     { CODEC_ID_INDEO2, MKTAG('R', 'T', '2', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:233:7: error: ‘CODEC_ID_FRAPS’ was not declared in this scope
     { CODEC_ID_FRAPS, MKTAG('F', 'P', 'S', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:234:7: error: ‘CODEC_ID_TRUEMOTION2’ was not declared in this scope
     { CODEC_ID_TRUEMOTION2, MKTAG('T', 'M', '2', '0') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:237:7: error: ‘CODEC_ID_FLASHSV’ was not declared in this scope
     { CODEC_ID_FLASHSV, MKTAG('F', 'S', 'V', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:238:7: error: ‘CODEC_ID_JPEGLS’ was not declared in this scope
     { CODEC_ID_JPEGLS,MKTAG('M', 'J', 'L', 'S') }, /* JPEG-LS custom FOURCC for avi - encoder */
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:239:7: error: ‘CODEC_ID_VC1’ was not declared in this scope
     { CODEC_ID_VC1, MKTAG('W', 'V', 'C', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:240:7: error: ‘CODEC_ID_VC1’ was not declared in this scope
     { CODEC_ID_VC1, MKTAG('W', 'M', 'V', 'A') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:241:7: error: ‘CODEC_ID_CSCD’ was not declared in this scope
     { CODEC_ID_CSCD, MKTAG('C', 'S', 'C', 'D') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:242:7: error: ‘CODEC_ID_ZMBV’ was not declared in this scope
     { CODEC_ID_ZMBV, MKTAG('Z', 'M', 'B', 'V') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:243:7: error: ‘CODEC_ID_KMVC’ was not declared in this scope
     { CODEC_ID_KMVC, MKTAG('K', 'M', 'V', 'C') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:246:7: error: ‘CODEC_ID_VP5’ was not declared in this scope
     { CODEC_ID_VP5, MKTAG('V', 'P', '5', '0') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:247:7: error: ‘CODEC_ID_VP6’ was not declared in this scope
     { CODEC_ID_VP6, MKTAG('V', 'P', '6', '0') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:248:7: error: ‘CODEC_ID_VP6’ was not declared in this scope
     { CODEC_ID_VP6, MKTAG('V', 'P', '6', '1') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:249:7: error: ‘CODEC_ID_VP6’ was not declared in this scope
     { CODEC_ID_VP6, MKTAG('V', 'P', '6', '2') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:250:7: error: ‘CODEC_ID_VP6F’ was not declared in this scope
     { CODEC_ID_VP6F, MKTAG('V', 'P', '6', 'F') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:251:7: error: ‘CODEC_ID_JPEG2000’ was not declared in this scope
     { CODEC_ID_JPEG2000, MKTAG('M', 'J', '2', 'C') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:252:7: error: ‘CODEC_ID_VMNC’ was not declared in this scope
     { CODEC_ID_VMNC, MKTAG('V', 'M', 'n', 'c') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:256:7: error: ‘CODEC_ID_TARGA’ was not declared in this scope
     { CODEC_ID_TARGA, MKTAG('t', 'g', 'a', ' ') },
       ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/ffmpeg_codecs.hpp:258:7: error: ‘CODEC_ID_NONE’ was not declared in this scope
     { CODEC_ID_NONE, 0 },
       ^
In file included from /home/antoniopedro/opencv-2.4.9/modules/highgui/src/cap_ffmpeg.cpp:45:0:
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function ‘double CvCapture_FFMPEG::getProperty(int)’:
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/cap_ffmpeg_impl.hpp:773:33: error: ‘AVStream’ has no member named ‘r_frame_rate’
         return av_q2d(video_st->r_frame_rate);
                                 ^
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/cap_ffmpeg_impl.hpp: In member function ‘double CvCapture_FFMPEG::get_fps()’:
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/cap_ffmpeg_impl.hpp:820:49: error: ‘AVStream’ has no member named ‘r_frame_rate’
     double fps = r2d(ic->streams[video_stream]->r_frame_rate);
                                                 ^
In file included from /home/antoniopedro/opencv-2.4.9/modules/highgui/src/cap_ffmpeg.cpp:45:0:
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/cap_ffmpeg_impl.hpp: In function ‘int icv_av_write_frame_FFMPEG(AVFormatContext*, AVStream*, uint8_t*, uint32_t, AVFrame*)’:
/home/antoniopedro/opencv-2.4.9/modules/highgui/src/cap_ffmpeg_impl.hpp:1236:72: error: ‘avcodec_encode_video’ was not declared in this scope
         out_size = avcodec_encode_video(c, outbuf, outbuf_size, picture);
                                                                        ^
modules/highgui/CMakeFiles/opencv_highgui.dir/build.make:122: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.cpp.o' failed
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.cpp.o] Error 1
CMakeFiles/Makefile2:1724: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/all' failed
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
Makefile:133: recipe for target 'all' failed
make: *** [all] Error 2

如何识别构建过程的问题?

2 个答案:

答案 0 :(得分:8)

不推荐使用FFMPEG,很可能不会在Ubuntu 14.04发行版上安装。

尝试使用WITH_FFMPEG=OFF旗帜进行构建。

例如:

cmake -DCMAKE_BUILD_TYPE=Release \
      -DENABLE_AVX=ON \
      -DENABLE_FAST_MATH=ON \
      -DENABLE_SSE=ON \
      -DENABLE_SSE2=ON \
      -DENABLE_SSE3=ON \
      -DENABLE_SSE41=ON \
      -DENABLE_SSE42=ON \
      -DENABLE_SSSE3=ON \
      -DWITH_FFMPEG=OFF \
      /absolute/path/to/opencv-2.4.10

感谢OP的答案。

答案 1 :(得分:0)

根据opencv.org,FFMPEG或Libav仍然是必要的。

尝试使用以下代码从源代码编译FFMPEG:

安装x264:

mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
tar xjvf last_x264.tar.bz2
cd x264-snapshot*
./configure --enable-shared --enable-pic
make

以root身份:

sudo su
make install
ldconfig -v

然后是FFMPEG:

cd ~/ffmpeg_sources
wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
tar xjvf ffmpeg-snapshot.tar.bz2
cd ffmpeg
./configure --extra-libs="-ldl" --enable-gpl --enable-libass --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-x11grab --enable-shared --enable-pic
make

以root身份:

su
make install
ldconfig -v

查看http://www.javieriparraguirre.net/installing-opencv-debian是一个好主意,适用于debian,但对Ubuntu也很有用。

版:

ffmpeg已弃用。目前,您可以按照opencv3官方说明here进行编译。运行最近的Linux发行版(基于debian的发行版,根据我的个人经验)我可以轻松地将x86_64桌面中的opencv编译为单板计算机,例如raspberry pi,odroid等......通过这些指令。