Skip to content

Copy (ffmpeg) .dll to fix #6 #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Sep 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
509 changes: 508 additions & 1 deletion LICENSE-3RD-PARTY.txt

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ Licensing
---------

Opencv-python package (scripts in this repository) is available under
MIT license. The OpenCV itself is available under `3-clause BSD
MIT license.

OpenCV itself is available under `3-clause BSD
License <https://github.com/opencv/opencv/blob/master/LICENSE>`__
(`LICENSE-3RD-PARTY.txt <https://github.com/skvark/opencv-python/blob/master/LICENSE-3RD-PARTY.txt>`__).

This software uses code of `FFmpeg <http://ffmpeg.org>`__ licensed under the `LGPLv2.1 <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>`__.

Versioning
----------

Expand Down Expand Up @@ -137,4 +141,4 @@ supported by the manylinux containers.
OS X
~~~~

Currently built for Python 2.7 and 3.4.
Currently built for Python 2.7, 3.4 and 3.5.
14 changes: 12 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ install:
C:\Python35-x64\python.exe -m pip install -r requirements.txt

build_script:
- cmd: >-
- cmd: |-

if not exist "%APPVEYOR_BUILD_FOLDER%\opencv\build" mkdir "%APPVEYOR_BUILD_FOLDER%\opencv\build"

Expand All @@ -52,36 +52,46 @@ build_script:
cmake --build . --config Release

cd ..\..

cd
xcopy "%APPVEYOR_BUILD_FOLDER%\opencv\build\lib\RELEASE\*.pyd" cv2
xcopy "%APPVEYOR_BUILD_FOLDER%\opencv\build\bin\Release\*.dll" cv2
del cv2\*64.dll

C:\Python27\python.exe setup.py bdist_wheel

del cv2\*.pyd
del cv2\*.dll

rmdir "%APPVEYOR_BUILD_FOLDER%\build" /s /q

xcopy "%APPVEYOR_BUILD_FOLDER%\opencv\build64\lib\RELEASE\*.pyd" cv2
xcopy "%APPVEYOR_BUILD_FOLDER%\opencv\build64\bin\Release\*64.dll" cv2

C:\Python27-x64\python.exe setup.py bdist_wheel

del cv2\*.pyd
del cv2\*.dll

rmdir "%APPVEYOR_BUILD_FOLDER%\build" /s /q

xcopy "%APPVEYOR_BUILD_FOLDER%\opencv\build\lib\python3\Release\*.pyd" cv2
xcopy "%APPVEYOR_BUILD_FOLDER%\opencv\build\bin\Release\*.dll" cv2
del cv2\*64.dll

C:\Python35\python.exe setup.py bdist_wheel

del cv2\*.pyd
del cv2\*.dll

rmdir "%APPVEYOR_BUILD_FOLDER%\build" /s /q

xcopy "%APPVEYOR_BUILD_FOLDER%\opencv\build64\lib\python3\Release\*.pyd" cv2
xcopy "%APPVEYOR_BUILD_FOLDER%\opencv\build64\bin\Release\*64.dll" cv2

C:\Python35-x64\python.exe setup.py bdist_wheel

del cv2\*.pyd
del cv2\*.dll

rmdir "%APPVEYOR_BUILD_FOLDER%\build" /s /q

Expand Down
5 changes: 5 additions & 0 deletions cv2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import sys
import os

# FFMPEG dll is not found on Windows without this
os.environ["PATH"] += os.pathsep + os.path.dirname(os.path.realpath(__file__))

from . import cv2
sys.modules['cv2'] = cv2
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def is_pure(self):
if os.name == 'posix':
package_data['cv2'] = ['*.so']
else:
package_data['cv2'] = ['*.pyd']
package_data['cv2'] = ['*.pyd', '*.dll']

setup(name='opencv-python',
version=opencv_version,
Expand Down
Binary file added tests/SampleVideo_1280x720_1mb.mp4
Binary file not shown.
11 changes: 10 additions & 1 deletion tests/test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import unittest
import os

class OpenCVTest(unittest.TestCase):
""" Simple functionality tests. """

def test_import(self):
""" Test that the cv2 module can be imported. """
import cv2
import cv2

def test_video_capture(self):

if os.name != 'posix':
import cv2

cap = cv2.VideoCapture("SampleVideo_1280x720_1mb.mp4")
self.assertTrue(cap.isOpened())