From 613b28932547895c251b3d1b8f3e011cbc086ed9 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 18 Dec 2015 15:00:24 +0300 Subject: [PATCH 1/2] python: add launch script for winpack python demo --- samples/python/_run_winpack_demo_python27.cmd | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 samples/python/_run_winpack_demo_python27.cmd diff --git a/samples/python/_run_winpack_demo_python27.cmd b/samples/python/_run_winpack_demo_python27.cmd new file mode 100644 index 000000000..a4a65184b --- /dev/null +++ b/samples/python/_run_winpack_demo_python27.cmd @@ -0,0 +1,47 @@ +@echo off +if NOT exist %CD%\..\..\..\build ( + echo ERROR: OpenCV Winpack installation is required + pause + exit +) + +:: Path to FFMPEG binary files +set PATH=%PATH%;%CD%\..\..\..\build\bin\ + +:: Detect Python binary +python -V +if %ERRORLEVEL% EQU 0 ( + set PYTHON=python +) else ( + if exist C:\Python27-x64\python.exe ( + set PYTHON=C:\Python27-x64\python.exe + ) else ( + if exist C:\Python27\python.exe ( + set PYTHON=C:\Python27\python.exe + ) else ( + echo ERROR: Python not found + pause + exit + ) + ) +) +echo Using python: %PYTHON% + +:: Detect python architecture +%PYTHON% -c "import platform; exit(64 if platform.architecture()[0] == '64bit' else 32)" +if %ERRORLEVEL% EQU 32 ( + echo Detected: Python 32-bit + set PYTHONPATH=%CD%\..\..\..\build\python\2.7\x86 +) else ( + if %ERRORLEVEL% EQU 64 ( + echo Detected: Python 64-bit + set PYTHONPATH=%CD%\..\..\..\build\python\2.7\x64 + ) else ( + echo ERROR: Unknown python arch + pause + exit + ) +) + +:: Launch demo +%PYTHON% demo.py From 3ee90a1ff4b67add06e2c5bbfd70dc10998ba94c Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 18 Dec 2015 15:06:19 +0300 Subject: [PATCH 2/2] ffmpeg: install both 32/64-bit versions (required for java/python 32/64-bit bindings) --- modules/videoio/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/videoio/CMakeLists.txt b/modules/videoio/CMakeLists.txt index b402ccd52..b5da8d090 100644 --- a/modules/videoio/CMakeLists.txt +++ b/modules/videoio/CMakeLists.txt @@ -266,6 +266,11 @@ if(WIN32 AND WITH_FFMPEG) endif() install(FILES "${ffmpeg_path}" DESTINATION ${OPENCV_BIN_INSTALL_PATH} COMPONENT libs RENAME "${ffmpeg_bare_name_ver}") + + if(INSTALL_CREATE_DISTRIB) + install(FILES "${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/opencv_ffmpeg.dll" DESTINATION "bin/" COMPONENT libs RENAME "opencv_ffmpeg${OPENCV_DLLVERSION}.dll") + install(FILES "${OpenCV_SOURCE_DIR}/3rdparty/ffmpeg/opencv_ffmpeg_64.dll" DESTINATION "bin/" COMPONENT libs RENAME "opencv_ffmpeg${OPENCV_DLLVERSION}_64.dll") + endif() endif() endmacro()