Closed ghost closed 4 years ago
You have most likely some very old legacy FFmpeg version. Update your FFmpeg version. And please do not spam issues to this repository, this compilation error has nothing to do with this Python wrapper. Similar issue in OpenCV repository: https://github.com/opencv/opencv/issues/16634
src/cap_ffmpeg.cpp:50: /home/firoz/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:362:1: warning: inline variables are only available with ‘-std=c++17’ or ‘-std=gnu++17’ 362 | inline const char _opencv_avcodec_get_name(AVCodecID id) | ^
~/home/firoz/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:362:45: error: ‘AVCodecID’ was not declared in this scope; did you mean ‘AVCodec’? 362 | inline const char _opencv_avcodec_get_name(AVCodecID id) | ^~~ | AVCodec /home/firoz/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::processRawPacket()’: /home/firoz/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1079:9: error: ‘AVCodecID’ was not declared in this scope; did you mean ‘AVCodec’? 1079 | AVCodecID eVideoCodec = video_st->codec->codec_id; | ^~~ | AVCodec /home/firoz/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1084:13: error: ‘eVideoCodec’ was not declared in this scope 1084 | if (eVideoCodec == CV_CODEC(CODEC_ID_H264) | ^~~In file included from /home/firoz/opencv-python/opencv/modules/videoio/src/cap_ffmpeg.cpp:50: /home/firoz/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘double CvCapture_FFMPEG::getProperty(int) const’: /home/firoz/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1366:5: error: ‘AVCodecID’ was not declared in this scope; did you mean ‘AVCodec’? 1366 | AVCodecID codec_id = AV_CODEC_ID_NONE; | ^~~ | AVCodec /home/firoz/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1391:9: error: ‘codec_id’ was not declared in this scope; did you mean ‘codec_tag’? 1391 | codec_id = video_st->codec->codec_id; | ^~| codec_tag /home/firoz/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:1403:57: error: ‘_opencv_avcodec_get_name’ cannot be used as a function 1403 | codec_fourcc = _opencv_avcodec_get_name(codec_id); | ^ /home/firoz/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvVideoWriter_FFMPEG::open(const char, int, double, int, int, bool)’: /home/firoz/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2359:18: error: ‘AV_PIX_FMT_BGRA’ was not declared in this scope; did you mean ‘AV_PIX_FMT_BGR24’? 2359 | case AV_PIX_FMT_BGRA: | ^~~~~ | AV_PIX_FMT_BGR24 /home/firoz/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2378:18: error: ‘AV_PIX_FMT_BGRA’ was not declared in this scope; did you mean ‘AV_PIX_FMT_BGR24’? 2378 | case AV_PIX_FMT_BGRA: | ^~~~~ | AV_PIX_FMT_BGR24 /home/firoz/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2402:18: error: ‘AV_PIX_FMT_BGRA’ was not declared in this scope; did you mean ‘AV_PIX_FMT_BGR24’? 2402 | case AV_PIX_FMT_BGRA: | ^~~~~ | AV_PIX_FMT_BGR24 /home/firoz/opencv-python/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:2430:29: error: ‘AV_PIX_FMT_RGBA’ was not declared in this scope; did you mean ‘AV_PIX_FMT_RGB24’? 2430 | codec_pix_fmt = AV_PIX_FMT_RGBA; | ^~~~~ | AV_PIX_FMT_RGB24 make[2]: [modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:239: modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o] Error 1 make[1]: * [CMakeFiles/Makefile2:4346: modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2 make: *** [Makefile:183: all] Error 2 Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/skbuild/setuptools_wrap.py", line 577, in setup cmkr.make(make_args, env=env) File "/usr/local/lib/python3.7/dist-packages/skbuild/cmaker.py", line 482, in make os.path.abspath(CMAKE_BUILD_DIR())))An error occurred while building with CMake. Command: "cmake" "--build" "." "--target" "install" "--config" "Release" "--" Source directory: /home/firoz/opencv-python Working directory: /home/firoz/opencv-python/_skbuild/linux-x86_64-3.7/cmake-build Please see CMake's output for more information..