diff --git a/README.md b/README.md index 215f262..d1e649e 100644 --- a/README.md +++ b/README.md @@ -1,316 +1,326 @@ -# CTA WAVE DPCTF Device Observation Framework - -This repository contains the Device Observation Framework. -The DPCTF Device Observation Framework determines pass or fail results, based on observations of screen recordings of tests which are run on a device by the DPCTF Test Runner. - -DPCTF is the Device Playback Compatibility Task Force of the CTA WAVE Project (see https://CTA.tech/WAVE and standards@CTA.tech for more info). - -## First set up the DPCTF Test Runner - -DPCTF Device Observation Framework **must** work together with the DPCTF Test Runner. -The DPCTF Test Runner should be set up prior to the DPCTF Device Observation Framework. -Please follow the instructions at https://github.com/cta-wave/dpctf-deploy. - -**Check that the Test Runner is functioning correctly and able to run tests prior to installing the Observation Framework.** - -## Setting up the Device Observation Framework - -### Installation -The Observation Framework **must** be installed on same machine as the Test Runner is deployed. - -Test Runner is deployed as a service running inside a Docker container. -The Observation Framework **must** be installed outside of Docker or Docker Desktop and run outside of the docker from the windows command line. -Make sure that the command line or PowerShell that is used for running OF is not inside the docker or docker desktop. - -This Observation Framework release has been tested on Ubuntu 18.04 LTS and Windows 10. - -### Updating System Environment for Windows -There are a number of points in these instructions that will direct you to add the necessary path(s) to Windows System Variables under the PATH entry. You will need to add the Path(s) to the folder(s) that will contain the WAVE Test Suite files you will create, Python, Docker Desktop, ZBar and any others as noted in these instructions. This is so the system knows where to find them. There may be additional Paths necessary. When a command returns an error such as “file not found” check to see if the Path is in the Environment System Variables under “PATH”. If not, add the missing Path. -To add to or modify the System Environment Variables. -1. Follow the instructions in the various ReadMe files for Windows, not Unix/Linux or Mac OS X. -2. Run all commands using Windows Terminal/PowerShell. Do not run them using Bash in a Linux terminal. -3. If a command in Windows PowerShell/Terminal stalls or hangs up, use to gracefully exit. - -* Search for “Edit System Environmental Variables” in the search bar. Click on it in the popup. -* Select “Environment Variables” -* Under “System variables” (lower box), select “Path” -* Then select Edit -* Select “New” and enter the desired Path. -* Select “New” again for each new path you wish to add. -* When done, close the Environment Variables screens AND the Windows PowerShell/Terminal, if you have it open, to ensure the Paths are updated. - -### Required Libraries -The Observation Framework requires the 'zbar' bar code reader library to be installed. On Linux this will require a user -with 'sudo' privilege, and on Windows with Administrator privilege. - -**For Windows** download and run the Windows installer from: -``` -https://sourceforge.net/projects/zbar/files/zbar/0.10/zbar-0.10-setup.exe/download -``` -After installation of zbar, add the PATH to the system environment variables. See above "Updating System Environment for Windows". - -**For Mac OS X**: -``` -brew install zbar -brew install netcat -``` - -**For Unix** exact installations may vary for different Unix variants, see http://zbar.sourceforge.net/. - -**For Linux** a typical installation is: -``` -sudo apt-get install libzbar0 -sudo apt-get install netcat -``` - -### Obtain the Observation Framework - -Clone this github (i.e. https://github.com/cta-wave/device-observation-framework ) to the same machine/VM as the DPCTF Test Runner installation. -OR -Download the Zip file https://github.com/cta-wave/device-observation-framework/archive/refs/heads/main.zip and extract to your target folder. -Both can also be found by clicking on the Code tab at the top of the Device Observation Framework landing page. - -### Installing the required Python packages -Prior to running the install script, python **version 3.6 or greater** and pip **version 3** must be installed and on the execution PATH. -On windows, add the Paths to Python to the system environment variables if they were not added during the installation. - -**On Linux and Mac OS** systems, prior to each user using the Observation Framework for the first time, run: - -```shell -cd -./install.sh -``` - -**On Windows** systems, prior to each user using the Observation Framework for the first time, run: - -```shell -cd -install_win.bat -``` -Note: Makes sure that the WindowsPowerShell is used for the above commands. -The device-observation-framework folder may also be named device-observation-framework-main - -### Observation Framework Configuration - -The "config.ini" file defines internal configurations for the Observation Framework. -The configuration can be adjusted based on different set up and requirements, e.g. user configurable timeouts and thresholds. - -## Obtain recording files - -The Observation Framework operates on camera recordings of the device's screen whilst running tests under the DPCTF Test Runner. These test materials contain QR codes which must be accurately captured for the Observation Framework to interpret. - -### Camera requirements -For the Phase 1 Observation Framework a variety of cameras should be suitable. (**NOTE:** this will **not** be the case for Phase 2 which will likely require very specific camera model(s)... TBD.) - -The camera's requirements are: -* produces an output recording file in a format compatible with the OpenCV library (typically a .mp4 or .mov format). Domestic cameras from Sony, Canon, GoPro have been tried and all produced OpenCV compatible output. -* support recordings at a minimum of 119 frames per second at full HD. -* sufficient quality lens/sensor to allow sharp QR code capture at low resolutions on the smallest screen device to be tested. Note that small screen devices such as mobile phones will be more demanding than a e.g. a large screen TV device. - -### Recording environment set up -The set up needs to be in a light-controlled environment and the camera configured to record high quality footage to allow consistent QR code detection. **It is highly unlikely that simply setting up the equipment on a desk in a standard office environment will produce satisfactory results!** - -**More detailed guidance, and example videos are contained in "how_to_take_clear_recordings.pptx", available to download from https://dash-large-files.akamaized.net/WAVE/assets/YanJiang-how_to_take_clear_recordings.pptx.zip .** - -For the camera/device set up: -* The device needs to be in a light-controlled environment with no bright surrounding lights, and no glare or reflections on the device screen. -* The device needs to be mounted on a stable stand/support. The camera needs mounting on a stable tripod with lens pointing directly at the device screen at a 90 degree angle. -* The camera should be zoomed in to capture the display as large as possible whilst still containing all the screen image including the red edge markers. For longer screens try only include just the aera including the red edge markers but not the device. It is important to make is playback eara as big as possible to capture clear QR code. For smaller and loger devices it is recommended to zoom in as closly as possible and exclude part of the device edge to make the QR code bigger. -* The camera should be manually focused on the device screen to produce a sharp image. -* The camera must be set to record at a minimum of 119 frames per second in full HD. -* The device's screen brightness needs to be adjusted to be neither too bright nor too dim. Too dim and the QR code cannot be discerned. But too bright and the white will "bleed" and prevent the QR code being recognised. See below for some examples. -* Depending on the device and sofware being used to run the tests, some device/software specific configuration may be required. For e.g. by default some browsers may add menu footers or headers that could partially obscure the QR codes. These will need to be set into e.g. a "full screen" mode. If any part of a QR code is obscured then the Observation Framework cannot operate. - -Once the camera/device are set up, **DO NOT** change or alter settings during the recording. If changes are necessary then a new recording shall be taken. - -Note: Minimizing time between the start of recording and when the pre-test QR code shows up -helps Device Observation Framework to process faster and give test results quicker. - -### **Clear capture example:** - -![image](images/good_capture_example.png) - -### **Examples of good and bad captures** -The QR codes outlined in GREEN were successfully decoded. Those outlined in RED failed to be decoded: - -![image](images/good_and_bad_capture_example.png) - -### How to verify the camera setup -For the initial set up, we recommand a user try to run a sequential track playback test. - -From Test Runner select and run the "*//sequential-track-playback__stream__.html*" test. (See Test Runner documentation for how to run tests: https://github.com/cta-wave/dpctf-test-runner and https://web-platform-tests.org/running-tests/ ). - -Once the recording is taken, the following steps should be followed to verify the camera setup and the recording: -* Try playing back the recording to check that the full duration of the test session is recorded. -* The recording captured full clear QR codes. Nothing obscured the screen, there is no blur in the QR codes and they are not too dim or too bright. The focus is stable for the whole duration of the recording. -* Try to run the OF with the recording, and there shall be no exceptions or error raised by OF. When the camera/device set up does not meet the requirement, which makes it unable to capture clear QR codes, the following exceptions will be raised by OF. - -```shell -At camera frame N there were X consecutive camera frames where no mezzanine qr codes were detected. Device Observation Framework is exiting, and the remaining tests are not observed. -``` -* Check the observation result. If there are a lot of missing frames reported, we recommend user to look at the recording manually to observe whether the reported missing frames are actually missing from the recording. This can be done by jumping to any of the previous frames, which are close to the target frame, then go frame by frame. If the reported missing frame is present in the recording, the set up can be improved slightly to get a better recording. - -Above steps can be repeated if necessary in order to find the best set up for the selected device and the camera. For a small screen devices, such as a mobile phone, it is more difficult to find the good set up. A better camera or a better lense, such as a micro lens which can capture small detailes, might required for testing on a smaller screen devices. - -## Using the DPCTF Device Observation Framework -Once the device and camera setup is correct then Test Runner sessions can be analysed. See https://web-platform-tests.org/running-tests/ for instructions on how to run a test session. Prior to starting the session, begin the camera recording (ensuring that camera is set to record at minimum of 119 fps). Record the Test Runner session from begining to end and then stop the camera recording. - -Only one session may be contained in a single recording. A single session may contain multiple tests. - -Once the recording is complete, follow the camera manufacturer's instructions to transfer the recorded file to the PC where Observation Framework is installed. - -To run DPCTF Device Observation Framework enter: - -```shell -cd device-observation-framework - -python observation_framework.py --input --log --scan - -OR - -python3 observation_framework.py --input --log --scan - -(n.b. Python version must be 3.6 or greater) -``` - -e.g: -```shell -python observation_framework.py --input D:\device-observation-framework-main\recording_file_name.mp4 -``` -IMPORTANT: Make sure Makes sure that the WindowsPowerShell is used for the above commands on windows. -You **MUST** add the .mp4 extension to the file name. - - -where **log** (optional) specifies log level. Default value is "info" when not specified. See "Additional Options" section below for more details. - -where **scan** (optional) specifies scan method to be used. Default value is "general" when not specified. See "Additional Options" section below for more details. - -where **file** specifies the path to the recording to be analysed: - -**If the session is recorded to a single file** -then specify the path and recording filename for the **file** parameter. - -**If the camera splits a single session's recording into multiple files** -then specify the path to the folder containing the recorded files. Note that: -* a folder must only contain the files for a **single session** recording. -* typically a camera will name the files with some form of ascending number. By default the Observation Framework will -alphabetically sort the filenames and use this as the recording order. If for a particular camera this is unsuitable - then in the **config.ini** file, the parameter '*sort_input_files_by*' can be set to *"timestamp"* to instead try sorting by file timestamp. - If both these approaches fail then the user will need to rename the files such that when alphabetically - sorted they are in the correct order. - -The Observation Framework will analyse the recording and post the results to the Test Runner for viewing on Test Runner's results pages. Note that the observation processing may take considerable time, depending on the duration of the session recording. - -When a selected test includes an observation *"The presented sample matches the one reported by the currentTime value within the tolerance of the sample duration."*, a CSV file contains observation data will be generated at ```logs//_time_diff.csv```. Where is contains current times and calculated time differences between current time and media time. - -At the end of the process the Observation Framework will rename the file recording to: -```_dpctf_.``` - -**Additional Options:** -* When ```--log debug``` is selected, full QR code detection will be extracted to a CSV file at ```logs//qr_code_list.csv```, and the system displays more information to the terminal as well as to a log file ```logs//session.log```. -This includes information such as decoding of QR codes: - * Content ID, Media Time, Frame Number, Frame Rate - * Status, Action, Current Time, Delay - -* ```--scan intensive``` makes the QR code recognition more robust by allowing an additional adaptive thresholded scan, however this will increase prossing time. This option is to be used where it is difficult to take clear repcordings, such as testing on a small screen devices like mobile phones. - -## Troubleshooting - -### Http connection exception raised: -Check that Test Runner is installed and running without problems and that it is visible to the Observation Framework. - -### Observation results are reporting large number of missing frames: -If a large number of expected frames containing QR codes are missing then this indicates something is seriously wrong. The Observation Framework will terminate the session analysis with an error result. (the threshold for this can be set in the *"config.ini"* file with the *'missing_frame_threshold'* parameter). - -If this occurs, check the quality of the recorded video. Ensure that the camera/device set up instructions described earlier have been followed. - -# Adding Support for New Tests to the Observation Framework -When new tests are added to the **dcptf-tests** repository, support for these will also need adding to the Observation Framework. -The scale of changes required will depend on how much the new tests diverge from existing tests. -## a) When test and observations are the same as an existing test -For example, the '*playback-of-encrypted-content*' test uses the same Observation Framework test code and observations as the (unencrypted) '*sequential_track_playback*' test. -To add such a test simply requires adding a new testname mapping to the existing test module and class name in the *"of_testname_map.json"* file. For example: - - "playback-of-encrypted-content.html": [ - "sequential_track_playback", - "SequentialTrackPlayback" - ], - -## b) When correct observations exist but new test requires different combination of observations -For example, the '*regular-playback-of-a-cmaf-presentation*' test uses the same test logic as the '*sequential_track_playback*' test. -However, it requires a different list of observations. -Create a new test code module containing a new test class derived from an existing test. -Then override the method to provide the correct list of observations, for example: - - class RegularPlaybackOfACmafPresentation(SequentialTrackPlayback): - def _init_observations(self) -> None: - self.observations = [...] - -Add the new test name, python module, and class name to the *"of_testname_map.json"* file. - -## c) When correct observations exist within an existing test but require different parameters -For example, the '*random-access-to-time*' test uses the same observations as the '*sequential_track_playback*' test. However, it requires different parameters to be passed. -Create a new test code module containing a new test class derived from an existing test with the same observations. -Then override the appropriate methods to provide the correct parameters for the observations, for example: - - class RandomAccessToTime(SequentialTrackPlayback): - def _init_parameters(self) -> None: - [...] - - def _get_first_frame_num(self, frame_rate: float) -> int: - [...] - - def _get_expected_track_duration(self) -> float: - [...] - -Add the new test name, python module, and class name to the *"of_testname_map.json"* file. - -## d) When brand new observations are required -Create new observation class(es) either derived from an existing observation if an appropriate one exists, or derived from the '_Observation_' base class. -Override methods as needed and provide a *make_observation()* method. For example, - - class EverySampleRendered(Observation): - def __init__(self, global_configurations: GlobalConfigurations, name: str = None): - [...] - - def make_observation( self, test_type, mezzanine_qr_codes: List[MezzanineDecodedQr], - _unused, parameters_dict: dict ) -> Dict[str, str]: - [...] - -Create a new test code module and class as described in (c) above. Implement a *make_observations()* method that calls the required observations, and returns a list of pass/fail results. -For example: - - def make_observations( - self, - mezzanine_qr_codes: List[MezzanineDecodedQr], - test_status_qr_codes: List[TestStatusDecodedQr], - ) -> List[dict]: - [...] - -Add the new test name, python module, and class name to the *"of_testname_map.json"* file. - -# Release Notes for Release v1.0.3 - -## Implemented: -* Installation and usage instructions (in this README). -* Installation scripts for Linux shells and Windows batch file. -* End-to-end Observation Framework functionality. -* Analysis of multiple tests in one session recording. -* Result reporting to DPCTF Test Runner. -* QR code based video tests implemented for: - * 8.2 sequential-track-playback.html - * 8.3 random-access-to-fragment.html - * 8.4 random-access-to-time.html - * 8.5 switching-set-playback.html - * 8.6 regular-playback-of-chunked-content.html - * 8.7 regular-playback-of-chunked-content-non-aligned-append.html - * 8.8 playback-over-wave-baseline-splice-constraints.html - * 8.9 out-of-order-loading.html - * 8.10 overlapping-fragments.html - * 8.11 fullscreen-playback-of-switching-sets.html - * 8.12 playback-of-encrypted-content.html - * 8.13 restricted-splicing-of-encrypted-content-https.html - * 8.14 sequential-playback-of-encrypted-and-non-encrypted-baseline-content-https.html - * 9.2 regular-playback-of-a-cmaf-presentation.html - * 9.3 random-access-of-a-wave-presentation.html - * 9.4 Splicing of WAVE Program with Baseline Constraints +# CTA WAVE DPCTF Device Observation Framework + +This repository contains the Device Observation Framework. +The DPCTF Device Observation Framework determines pass or fail results, based on observations of screen recordings of tests which are run on a device by the DPCTF Test Runner. + +DPCTF is the Device Playback Compatibility Task Force of the CTA WAVE Project (see https://CTA.tech/WAVE and standards@CTA.tech for more info). + +## First set up the DPCTF Test Runner + +DPCTF Device Observation Framework **must** work together with the DPCTF Test Runner. +The DPCTF Test Runner should be set up prior to the DPCTF Device Observation Framework. +Please follow the instructions at https://github.com/cta-wave/dpctf-deploy. + +**Check that the Test Runner is functioning correctly and able to run tests prior to installing the Observation Framework.** + +## Setting up the Device Observation Framework + +### Installation +The Observation Framework **must** be installed on same machine as the Test Runner is deployed. + +Test Runner is deployed as a service running inside a Docker container. +The Observation Framework **must** be installed outside of Docker or Docker Desktop and run outside of the docker from the windows command line. +Make sure that the command line or PowerShell that is used for running OF is not inside the docker or docker desktop. + +This Observation Framework release has been tested on Ubuntu 18.04 LTS and Windows 10. + +### Updating System Environment for Windows +There are a number of points in these instructions that will direct you to add the necessary path(s) to Windows System Variables under the PATH entry. You will need to add the Path(s) to the folder(s) that will contain the WAVE Test Suite files you will create, Python, Docker Desktop, ZBar and any others as noted in these instructions. This is so the system knows where to find them. There may be additional Paths necessary. When a command returns an error such as “file not found” check to see if the Path is in the Environment System Variables under “PATH”. If not, add the missing Path. +To add to or modify the System Environment Variables. +1. Follow the instructions in the various ReadMe files for Windows, not Unix/Linux or Mac OS X. +2. Run all commands using Windows Terminal/PowerShell. Do not run them using Bash in a Linux terminal. +3. If a command in Windows PowerShell/Terminal stalls or hangs up, use to gracefully exit. + +* Search for “Edit System Environmental Variables” in the search bar. Click on it in the popup. +* Select “Environment Variables” +* Under “System variables” (lower box), select “Path” +* Then select Edit +* Select “New” and enter the desired Path. +* Select “New” again for each new path you wish to add. +* When done, close the Environment Variables screens AND the Windows PowerShell/Terminal, if you have it open, to ensure the Paths are updated. + +### Required Libraries +The Observation Framework requires the 'zbar' bar code reader library to be installed. On Linux this will require a user +with 'sudo' privilege, and on Windows with Administrator privilege. + +**For Windows** download and run the Windows installer from: +``` +https://sourceforge.net/projects/zbar/files/zbar/0.10/zbar-0.10-setup.exe/download +``` +After installation of zbar, add the PATH to the system environment variables. See above "Updating System Environment for Windows". + +**For Mac OS X**: +``` +brew install zbar +brew install netcat +``` + +**For Unix** exact installations may vary for different Unix variants, see http://zbar.sourceforge.net/. + +**For Linux** a typical installation is: +``` +sudo apt-get install libzbar0 +sudo apt-get install netcat +``` + +### Obtain the Observation Framework + +Clone this github (i.e. https://github.com/cta-wave/device-observation-framework ) to the same machine/VM as the DPCTF Test Runner installation. +OR +Download the Zip file https://github.com/cta-wave/device-observation-framework/archive/refs/heads/main.zip and extract to your target folder. +Both can also be found by clicking on the Code tab at the top of the Device Observation Framework landing page. + +### Installing the required Python packages +Prior to running the install script, python **version 3.6 or greater** and pip **version 3** must be installed and on the execution PATH. +On windows, add the Paths to Python to the system environment variables if they were not added during the installation. + +**On Linux and Mac OS** systems, prior to each user using the Observation Framework for the first time, run: + +```shell +cd +./install.sh +``` + +**On Windows** systems, prior to each user using the Observation Framework for the first time, run: + +```shell +cd +install_win.bat +``` +Note: Makes sure that the WindowsPowerShell is used for the above commands. +The device-observation-framework folder may also be named device-observation-framework-main + +### Observation Framework Configuration + +The "config.ini" file defines internal configurations for the Observation Framework. +The configuration can be adjusted based on different set up and requirements, e.g. user configurable timeouts and thresholds. + +## Obtain recording files + +The Observation Framework operates on camera recordings of the device's screen whilst running tests under the DPCTF Test Runner. These test materials contain QR codes which must be accurately captured for the Observation Framework to interpret. + +### Camera requirements +For the Phase 1 Observation Framework a variety of cameras should be suitable. (**NOTE:** this will **not** be the case for Phase 2 which will likely require very specific camera model(s)... TBD.) + +The camera's requirements are: +* produces an output recording file in a format compatible with the OpenCV library (typically a .mp4 or .mov format). Domestic cameras from Sony, Canon, GoPro have been tried and all produced OpenCV compatible output. +* support recordings at a minimum of 119 frames per second at full HD. +* sufficient quality lens/sensor to allow sharp QR code capture at low resolutions on the smallest screen device to be tested. Note that small screen devices such as mobile phones will be more demanding than a e.g. a large screen TV device. + +### Recording environment set up +The set up needs to be in a light-controlled environment and the camera configured to record high quality footage to allow consistent QR code detection. **It is highly unlikely that simply setting up the equipment on a desk in a standard office environment will produce satisfactory results!** + +**More detailed guidance, and example videos are contained in "how_to_take_clear_recordings.pptx", available to download from https://dash-large-files.akamaized.net/WAVE/assets/YanJiang-how_to_take_clear_recordings.pptx.zip .** + +For the camera/device set up: +* The device needs to be in a light-controlled environment with no bright surrounding lights, and no glare or reflections on the device screen. +* The device needs to be mounted on a stable stand/support. The camera needs mounting on a stable tripod with lens pointing directly at the device screen at a 90 degree angle. +* The camera should be zoomed in to capture the display as large as possible whilst still containing all the screen image including the red edge markers. For longer screens try only include just the aera including the red edge markers but not the device. It is important to make is playback eara as big as possible to capture clear QR code. For smaller and loger devices it is recommended to zoom in as closly as possible and exclude part of the device edge to make the QR code bigger. +* The camera should be manually focused on the device screen to produce a sharp image. +* The camera must be set to record at a minimum of 119 frames per second in full HD. +* The device's screen brightness needs to be adjusted to be neither too bright nor too dim. Too dim and the QR code cannot be discerned. But too bright and the white will "bleed" and prevent the QR code being recognised. See below for some examples. +* Depending on the device and sofware being used to run the tests, some device/software specific configuration may be required. For e.g. by default some browsers may add menu footers or headers that could partially obscure the QR codes. These will need to be set into e.g. a "full screen" mode. If any part of a QR code is obscured then the Observation Framework cannot operate. + +Once the camera/device are set up, **DO NOT** change or alter settings during the recording. If changes are necessary then a new recording shall be taken. + +Note: Minimizing time between the start of recording and when the pre-test QR code shows up +helps Device Observation Framework to process faster and give test results quicker. + +### **Clear capture example:** + +![image](images/good_capture_example.png) + +### **Examples of good and bad captures** +The QR codes outlined in GREEN were successfully decoded. Those outlined in RED failed to be decoded: + +![image](images/good_and_bad_capture_example.png) + +### How to verify the camera setup +For the initial set up, we recommand a user try to run a sequential track playback test. + +From Test Runner select and run the "*//sequential-track-playback__stream__.html*" test. (See Test Runner documentation for how to run tests: https://github.com/cta-wave/dpctf-test-runner and https://web-platform-tests.org/running-tests/ ). + +Once the recording is taken, the following steps should be followed to verify the camera setup and the recording: +* Try playing back the recording to check that the full duration of the test session is recorded. +* The recording captured full clear QR codes. Nothing obscured the screen, there is no blur in the QR codes and they are not too dim or too bright. The focus is stable for the whole duration of the recording. +* Try to run the OF with the recording, and there shall be no exceptions or error raised by OF. When the camera/device set up does not meet the requirement, which makes it unable to capture clear QR codes, the following exceptions will be raised by OF. + +```shell +At camera frame N there were X consecutive camera frames where no mezzanine qr codes were detected. Device Observation Framework is exiting, and the remaining tests are not observed. +``` +* Check the observation result. If there are a lot of missing frames reported, we recommend user to look at the recording manually to observe whether the reported missing frames are actually missing from the recording. This can be done by jumping to any of the previous frames, which are close to the target frame, then go frame by frame. If the reported missing frame is present in the recording, the set up can be improved slightly to get a better recording. + +Above steps can be repeated if necessary in order to find the best set up for the selected device and the camera. For a small screen devices, such as a mobile phone, it is more difficult to find the good set up. A better camera or a better lense, such as a micro lens which can capture small detailes, might required for testing on a smaller screen devices. + +## Using the DPCTF Device Observation Framework +Once the device and camera setup is correct then Test Runner sessions can be analysed. See https://web-platform-tests.org/running-tests/ for instructions on how to run a test session. Prior to starting the session, begin the camera recording (ensuring that camera is set to record at minimum of 119 fps). Record the Test Runner session from begining to end and then stop the camera recording. + +Only one session may be contained in a single recording. A single session may contain multiple tests. + +Once the recording is complete, follow the camera manufacturer's instructions to transfer the recorded file to the PC where Observation Framework is installed. + +To run DPCTF Device Observation Framework enter: + +```shell +cd device-observation-framework + +python observation_framework.py --input --log --scan + +OR + +python3 observation_framework.py --input --log --scan + +(n.b. Python version must be 3.6 or greater) +``` + +e.g: +```shell +python observation_framework.py --input D:\device-observation-framework-main\recording_file_name.mp4 +``` +IMPORTANT: Make sure Makes sure that the WindowsPowerShell is used for the above commands on windows. +You **MUST** add the .mp4 extension to the file name. + + +where **log** (optional) specifies log level. Default value is "info" when not specified. See "Additional Options" section below for more details. + +where **scan** (optional) specifies scan method to be used. Default value is "general" when not specified. See "Additional Options" section below for more details. + +where **file** specifies the path to the recording to be analysed: + +**If the session is recorded to a single file** +then specify the path and recording filename for the **file** parameter. + +**If the camera splits a single session's recording into multiple files** +then specify the path to the folder containing the recorded files. Note that: +* a folder must only contain the files for a **single session** recording. +* typically a camera will name the files with some form of ascending number. By default the Observation Framework will +alphabetically sort the filenames and use this as the recording order. If for a particular camera this is unsuitable + then in the **config.ini** file, the parameter '*sort_input_files_by*' can be set to *"timestamp"* to instead try sorting by file timestamp. + If both these approaches fail then the user will need to rename the files such that when alphabetically + sorted they are in the correct order. + +The Observation Framework will analyse the recording and post the results to the Test Runner for viewing on Test Runner's results pages. Note that the observation processing may take considerable time, depending on the duration of the session recording. + +When a selected test includes an observation *"The presented sample matches the one reported by the currentTime value within the tolerance of the sample duration."*, a CSV file contains observation data will be generated at ```logs//_time_diff.csv```. Where is contains current times and calculated time differences between current time and media time. + +At the end of the process the Observation Framework will rename the file recording to: +```_dpctf_.``` + +**Additional Options:** +* When ```--log debug``` is selected, full QR code detection will be extracted to a CSV file at ```logs//qr_code_list.csv```, and the system displays more information to the terminal as well as to a log file ```logs//session.log```. +This includes information such as decoding of QR codes: + * Content ID, Media Time, Frame Number, Frame Rate + * Status, Action, Current Time, Delay + +* ```--scan intensive``` makes the QR code recognition more robust by allowing an additional adaptive thresholded scan, however this will increase prossing time. This option is to be used where it is difficult to take clear repcordings, such as testing on a small screen devices like mobile phones. + +## Troubleshooting + +### Http connection exception raised: +Check that Test Runner is installed and running without problems and that it is visible to the Observation Framework. + +### Observation results are reporting large number of missing frames: +If a large number of expected frames containing QR codes are missing then this indicates something is seriously wrong. The Observation Framework will terminate the session analysis with an error result. (the threshold for this can be set in the *"config.ini"* file with the *'missing_frame_threshold'* parameter). + +If this occurs, check the quality of the recorded video. Ensure that the camera/device set up instructions described earlier have been followed. + +# Adding Support for New Tests to the Observation Framework +When new tests are added to the **dcptf-tests** repository, support for these will also need adding to the Observation Framework. +The scale of changes required will depend on how much the new tests diverge from existing tests. +## a) When test and observations are the same as an existing test +For example, the '*playback-of-encrypted-content*' test uses the same Observation Framework test code and observations as the (unencrypted) '*sequential_track_playback*' test. +To add such a test simply requires adding a new testname mapping to the existing test module and class name in the *"of_testname_map.json"* file. For example: + + "playback-of-encrypted-content.html": [ + "sequential_track_playback", + "SequentialTrackPlayback" + ], + +## b) When correct observations exist but new test requires different combination of observations +For example, the '*regular-playback-of-a-cmaf-presentation*' test uses the same test logic as the '*sequential_track_playback*' test. +However, it requires a different list of observations. +Create a new test code module containing a new test class derived from an existing test. +Then override the method to provide the correct list of observations, for example: + + class RegularPlaybackOfACmafPresentation(SequentialTrackPlayback): + def _init_observations(self) -> None: + self.observations = [...] + +Add the new test name, python module, and class name to the *"of_testname_map.json"* file. + +## c) When correct observations exist within an existing test but require different parameters +For example, the '*random-access-to-time*' test uses the same observations as the '*sequential_track_playback*' test. However, it requires different parameters to be passed. +Create a new test code module containing a new test class derived from an existing test with the same observations. +Then override the appropriate methods to provide the correct parameters for the observations, for example: + + class RandomAccessToTime(SequentialTrackPlayback): + def _init_parameters(self) -> None: + [...] + + def _get_first_frame_num(self, frame_rate: Fraction) -> int: + [...] + + def _get_expected_track_duration(self) -> float: + [...] + +Add the new test name, python module, and class name to the *"of_testname_map.json"* file. + +## d) When brand new observations are required +Create new observation class(es) either derived from an existing observation if an appropriate one exists, or derived from the '_Observation_' base class. +Override methods as needed and provide a *make_observation()* method. For example, + + class EverySampleRendered(Observation): + def __init__(self, global_configurations: GlobalConfigurations, name: str = None): + [...] + + def make_observation( self, test_type, mezzanine_qr_codes: List[MezzanineDecodedQr], + _unused, parameters_dict: dict ) -> Dict[str, str]: + [...] + +Create a new test code module and class as described in (c) above. Implement a *make_observations()* method that calls the required observations, and returns a list of pass/fail results. +For example: + + def make_observations( + self, + mezzanine_qr_codes: List[MezzanineDecodedQr], + test_status_qr_codes: List[TestStatusDecodedQr], + ) -> List[dict]: + [...] + +Add the new test name, python module, and class name to the *"of_testname_map.json"* file. + +# Release Notes for Release V1.1.0 + +## Implemented: +* Installation and usage instructions (in this README). +* Installation scripts for Linux shells and Windows batch file. +* End-to-end Observation Framework functionality. +* Analysis of multiple tests in one session recording. +* Result reporting to DPCTF Test Runner. +* QR code based video tests implemented for: + * 8.2 sequential-track-playback.html + * 8.3 random-access-to-fragment.html + * 8.4 random-access-to-time.html + * 8.5 switching-set-playback.html + * 8.6 regular-playback-of-chunked-content.html + * 8.7 regular-playback-of-chunked-content-non-aligned-append.html + * 8.8 playback-over-wave-baseline-splice-constraints.html + * 8.9 out-of-order-loading.html + * 8.10 overlapping-fragments.html + * 8.11 fullscreen-playback-of-switching-sets.html + * 8.12 playback-of-encrypted-content.html + * 8.13 restricted-splicing-of-encrypted-content-https.html + * 8.14 sequential-playback-of-encrypted-and-non-encrypted-baseline-content-https.html + * 8.15 source-buffer-re-initialization-without-changetype.html + * 8.16 source-buffer-re-initialization-with-changetype.html + * 8.17 buffer-underrun-and-recovery.html + * 8.18 truncated-playback-and-restart.html + * 8.19 low-latency-initialization.html + * 8.20 low-latency-playback-over-gaps.html + * 8.21 mse-appendwindow.html + * 8.22 low-latency-short-buffer-playback.html + * 8.23 random-access-from-one-place-in-a-stream-to-a-different-place-in-the-same-stream.html + * 9.2 regular-playback-of-a-cmaf-presentation.html + * 9.3 random-access-of-a-wave-presentation.html + * 9.4 splicing-of-wave-program-with-baseline-constraints.html + * 9.6 long-duration-playback.html diff --git a/THIRD-PARTY-LICENSES.txt b/THIRD-PARTY-LICENSES.txt index e64f2eb..70dd65e 100644 --- a/THIRD-PARTY-LICENSES.txt +++ b/THIRD-PARTY-LICENSES.txt @@ -1,2912 +1,2912 @@ -The Observation Framework requires several third-party packages from https://pypi.org/ and libraries to be installed, see README.md. -These and their licenses are listed below: - -pip ---- -https://pip.pypa.io/en/stable/ - -Copyright (c) 2008-2021 The pip developers (see AUTHORS.txt file) - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -====================== - -opencv-python -------------- -https://github.com/opencv/opencv-python -MIT License - -Copyright (c) Olli-Pekka Heinisuo - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -... - -OpenCV library is redistributed within opencv-python package. -This license applies to OpenCV binary in the directory cv2/. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ------------------------------------------------------------------------------- -libvpx is redistributed within all opencv-python Linux packages. -This license applies to libvpx binary in the directory cv2/. - -Copyright (c) 2010, The WebM Project authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google, nor the WebM Project, nor the names - of its contributors may be used to endorse or promote products - derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------------------- -FFmpeg is redistributed within all opencv-python packages. - -Libbluray, libgnutls, libnettle, libhogweed, libintl, libmp3lame, libp11, -librtmp, libsoxr and libtasn1 are redistributed within all opencv-python macOS packages. - -This license applies to the above library binaries in the directory cv2/. - - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - ------------------------------------------------------------------------------- -Qt 5 is redistributed within non-headless opencv-python Linux and macOS packages. -libgmp is redistributed within opencv-python macOS packages. -libidn2 is redistributed within opencv-python macOS packages. -libunistring is redistributed within opencv-python macOS packages. -This license applies to the above binaries in the directory cv2/. - - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. - ------------------------------------------------------------------------------- -bzip2 is redistributed within all opencv-python Linux packages. -This license applies to libbz2 binary in the directory cv2/. - -This program, "bzip2", the associated library "libbzip2", and all -documentation, are copyright (C) 1996-2010 Julian R Seward. All -rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. The origin of this software must not be misrepresented; you must - not claim that you wrote the original software. If you use this - software in a product, an acknowledgment in the product - documentation would be appreciated but is not required. - -3. Altered source versions must be plainly marked as such, and must - not be misrepresented as being the original software. - -4. The name of the author may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS -OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Julian Seward, jseward@bzip.org -bzip2/libbzip2 version 1.0.6 of 6 September 2010 - ------------------------------------------------------------------------------- -libcrypto and libssl are redistributed within all opencv-python Linux and macOS packages. -libopencore-amrnb and libopencore-amrwb are redistributed within all opencv-python Linux and macOS packages. -This license applies to above binaries in the directory cv2/. - - LICENSE ISSUES - ============== - - The OpenSSL toolkit stays under a double license, i.e. both the conditions of - the OpenSSL License and the original SSLeay license apply to the toolkit. - See below for the actual license texts. - - OpenSSL License - --------------- - -/* ==================================================================== - * Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ - - Original SSLeay License - ----------------------- - -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - ------------------------------------------------------------------------------- -libfontconfig is redistributed within all opencv-python macOS packages. -This license applies to libfontconfig binary in the directory cv2/. - -Copyright © 2000,2001,2002,2003,2004,2006,2007 Keith Packard -Copyright © 2005 Patrick Lam -Copyright © 2009 Roozbeh Pournader -Copyright © 2008,2009 Red Hat, Inc. -Copyright © 2008 Danilo Šegan -Copyright © 2012 Google, Inc. - - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation, and that the name of the author(s) not be used in -advertising or publicity pertaining to distribution of the software without -specific, written prior permission. The authors make no -representations about the suitability of this software for any purpose. It -is provided "as is" without express or implied warranty. - -THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - ------------------------------------------------------------------------------- -libfreetype is redistributed within opencv-python Linux and macOS packages. -This license applies to libfreetype binary in the directory cv2/. - - The FreeType Project LICENSE - ---------------------------- - - 2006-Jan-27 - - Copyright 1996-2002, 2006 by - David Turner, Robert Wilhelm, and Werner Lemberg - - - -Introduction -============ - - The FreeType Project is distributed in several archive packages; - some of them may contain, in addition to the FreeType font engine, - various tools and contributions which rely on, or relate to, the - FreeType Project. - - This license applies to all files found in such packages, and - which do not fall under their own explicit license. The license - affects thus the FreeType font engine, the test programs, - documentation and makefiles, at the very least. - - This license was inspired by the BSD, Artistic, and IJG - (Independent JPEG Group) licenses, which all encourage inclusion - and use of free software in commercial and freeware products - alike. As a consequence, its main points are that: - - o We don't promise that this software works. However, we will be - interested in any kind of bug reports. (`as is' distribution) - - o You can use this software for whatever you want, in parts or - full form, without having to pay us. (`royalty-free' usage) - - o You may not pretend that you wrote this software. If you use - it, or only parts of it, in a program, you must acknowledge - somewhere in your documentation that you have used the - FreeType code. (`credits') - - We specifically permit and encourage the inclusion of this - software, with or without modifications, in commercial products. - We disclaim all warranties covering The FreeType Project and - assume no liability related to The FreeType Project. - - - Finally, many people asked us for a preferred form for a - credit/disclaimer to use in compliance with this license. We thus - encourage you to use the following text: - - """ - Portions of this software are copyright © The FreeType - Project (www.freetype.org). All rights reserved. - """ - - Please replace with the value from the FreeType version you - actually use. - - -Legal Terms -=========== - -0. Definitions --------------- - - Throughout this license, the terms `package', `FreeType Project', - and `FreeType archive' refer to the set of files originally - distributed by the authors (David Turner, Robert Wilhelm, and - Werner Lemberg) as the `FreeType Project', be they named as alpha, - beta or final release. - - `You' refers to the licensee, or person using the project, where - `using' is a generic term including compiling the project's source - code as well as linking it to form a `program' or `executable'. - This program is referred to as `a program using the FreeType - engine'. - - This license applies to all files distributed in the original - FreeType Project, including all source code, binaries and - documentation, unless otherwise stated in the file in its - original, unmodified form as distributed in the original archive. - If you are unsure whether or not a particular file is covered by - this license, you must contact us to verify this. - - The FreeType Project is copyright (C) 1996-2000 by David Turner, - Robert Wilhelm, and Werner Lemberg. All rights reserved except as - specified below. - -1. No Warranty --------------- - - THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS - BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO - USE, OF THE FREETYPE PROJECT. - -2. Redistribution ------------------ - - This license grants a worldwide, royalty-free, perpetual and - irrevocable right and license to use, execute, perform, compile, - display, copy, create derivative works of, distribute and - sublicense the FreeType Project (in both source and object code - forms) and derivative works thereof for any purpose; and to - authorize others to exercise some or all of the rights granted - herein, subject to the following conditions: - - o Redistribution of source code must retain this license file - (`FTL.TXT') unaltered; any additions, deletions or changes to - the original files must be clearly indicated in accompanying - documentation. The copyright notices of the unaltered, - original files must be preserved in all copies of source - files. - - o Redistribution in binary form must provide a disclaimer that - states that the software is based in part of the work of the - FreeType Team, in the distribution documentation. We also - encourage you to put an URL to the FreeType web page in your - documentation, though this isn't mandatory. - - These conditions apply to any software derived from or based on - the FreeType Project, not just the unmodified files. If you use - our work, you must acknowledge us. However, no fee need be paid - to us. - -3. Advertising --------------- - - Neither the FreeType authors and contributors nor you shall use - the name of the other for commercial, advertising, or promotional - purposes without specific prior written permission. - - We suggest, but do not require, that you use one or more of the - following phrases to refer to this software in your documentation - or advertising materials: `FreeType Project', `FreeType Engine', - `FreeType library', or `FreeType Distribution'. - - As you have not signed this license, you are not required to - accept it. However, as the FreeType Project is copyrighted - material, only this license, or another one contracted with the - authors, grants you the right to use, distribute, and modify it. - Therefore, by using, distributing, or modifying the FreeType - Project, you indicate that you understand and accept all the terms - of this license. - -4. Contacts ------------ - - There are two mailing lists related to FreeType: - - o freetype@nongnu.org - - Discusses general use and applications of FreeType, as well as - future and wanted additions to the library and distribution. - If you are looking for support, start in this list if you - haven't found anything to help you in the documentation. - - o freetype-devel@nongnu.org - - Discusses bugs, as well as engine internals, design issues, - specific licenses, porting, etc. - - Our home page can be found at - - https://www.freetype.org - ------------------------------------------------------------------------------- -libpng is redistributed within all opencv-python Linux and macOS packages. -This license applies to libpng binary in the directory cv2/. - -PNG Reference Library License version 2 ---------------------------------------- - - * Copyright (c) 1995-2019 The PNG Reference Library Authors. - * Copyright (c) 2018-2019 Cosmin Truta. - * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. - * Copyright (c) 1996-1997 Andreas Dilger. - * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. - -The software is supplied "as is", without warranty of any kind, -express or implied, including, without limitation, the warranties -of merchantability, fitness for a particular purpose, title, and -non-infringement. In no event shall the Copyright owners, or -anyone distributing the software, be liable for any damages or -other liability, whether in contract, tort or otherwise, arising -from, out of, or in connection with the software, or the use or -other dealings in the software, even if advised of the possibility -of such damage. - -Permission is hereby granted to use, copy, modify, and distribute -this software, or portions hereof, for any purpose, without fee, -subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you - must not claim that you wrote the original software. If you - use this software in a product, an acknowledgment in the product - documentation would be appreciated, but is not required. - - 2. Altered source versions must be plainly marked as such, and must - not be misrepresented as being the original software. - - 3. This Copyright notice may not be removed or altered from any - source or altered source distribution. - - -PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) ------------------------------------------------------------------------ - -libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are -Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are -derived from libpng-1.0.6, and are distributed according to the same -disclaimer and license as libpng-1.0.6 with the following individuals -added to the list of Contributing Authors: - - Simon-Pierre Cadieux - Eric S. Raymond - Mans Rullgard - Cosmin Truta - Gilles Vollant - James Yu - Mandar Sahastrabuddhe - Google Inc. - Vadim Barkov - -and with the following additions to the disclaimer: - - There is no warranty against interference with your enjoyment of - the library or against infringement. There is no warranty that our - efforts or the library will fulfill any of your particular purposes - or needs. This library is provided with all faults, and the entire - risk of satisfactory quality, performance, accuracy, and effort is - with the user. - -Some files in the "contrib" directory and some configure-generated -files that are distributed with libpng have other copyright owners, and -are released under other open source licenses. - -libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are -Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from -libpng-0.96, and are distributed according to the same disclaimer and -license as libpng-0.96, with the following individuals added to the -list of Contributing Authors: - - Tom Lane - Glenn Randers-Pehrson - Willem van Schaik - -libpng versions 0.89, June 1996, through 0.96, May 1997, are -Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, -and are distributed according to the same disclaimer and license as -libpng-0.88, with the following individuals added to the list of -Contributing Authors: - - John Bowler - Kevin Bracey - Sam Bushell - Magnus Holmgren - Greg Roelofs - Tom Tanner - -Some files in the "scripts" directory have other copyright owners, -but are released under this license. - -libpng versions 0.5, May 1995, through 0.88, January 1996, are -Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. - -For the purposes of this copyright and license, "Contributing Authors" -is defined as the following set of individuals: - - Andreas Dilger - Dave Martindale - Guy Eric Schalnat - Paul Schmidt - Tim Wegner - -The PNG Reference Library is supplied "AS IS". The Contributing -Authors and Group 42, Inc. disclaim all warranties, expressed or -implied, including, without limitation, the warranties of -merchantability and of fitness for any purpose. The Contributing -Authors and Group 42, Inc. assume no liability for direct, indirect, -incidental, special, exemplary, or consequential damages, which may -result from the use of the PNG Reference Library, even if advised of -the possibility of such damage. - -Permission is hereby granted to use, copy, modify, and distribute this -source code, or portions hereof, for any purpose, without fee, subject -to the following restrictions: - - 1. The origin of this source code must not be misrepresented. - - 2. Altered versions must be plainly marked as such and must not - be misrepresented as being the original source. - - 3. This Copyright notice may not be removed or altered from any - source or altered source distribution. - -The Contributing Authors and Group 42, Inc. specifically permit, -without fee, and encourage the use of this source code as a component -to supporting the PNG file format in commercial products. If you use -this source code in a product, acknowledgment is not required but would -be appreciated. - ------------------------------------------------------------------------------- -libz is redistributed within all opencv-python Linux packages. -This license applies to libz binary in the directory cv2/. - - Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - ------------------------------------------------------------------------------- -libdav1d is redistributed within opencv-python macOS packages. -This license applies to libdav1d binary in the directory cv2/. - -Copyright © 2018-2019, VideoLAN and dav1d authors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------------------- -libffi is redistributed within opencv-python macOS packages. -This license applies to libffi binary in the directory cv2/. - -libffi - Copyright (c) 1996-2020 Anthony Green, Red Hat, Inc and others. -See source files for details. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -``Software''), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ------------------------------------------------------------------------------- -libogg is redistributed within opencv-python macOS packages. -This license applies to libogg binary in the directory cv2/. - -Copyright (c) 2002, Xiph.org Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -- Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -- Neither the name of the Xiph.org Foundation nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------------------- -libopenjp2 is redistributed within opencv-python macOS packages. -This license applies to libopenjp2 binary in the directory cv2/. - -The copyright in this software is being made available under the 2-clauses -BSD License, included below. This software may be subject to other third -party and contributor rights, including patent rights, and no such rights -are granted under this license. - -Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium -Copyright (c) 2002-2014, Professor Benoit Macq -Copyright (c) 2003-2014, Antonin Descampe -Copyright (c) 2003-2009, Francois-Olivier Devaux -Copyright (c) 2005, Herve Drolon, FreeImage Team -Copyright (c) 2002-2003, Yannick Verschueren -Copyright (c) 2001-2003, David Janssens -Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France -Copyright (c) 2012, CS Systemes d'Information, France - -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------------------- -libopus is redistributed within opencv-python macOS packages. -This license applies to libopus binary in the directory cv2/. - -Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic, - Jean-Marc Valin, Timothy B. Terriberry, - CSIRO, Gregory Maxwell, Mark Borgerding, - Erik de Castro Lopo - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -- Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -- Neither the name of Internet Society, IETF or IETF Trust, nor the -names of specific contributors, may be used to endorse or promote -products derived from this software without specific prior written -permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Opus is subject to the royalty-free patent licenses which are -specified at: - -Xiph.Org Foundation: -https://datatracker.ietf.org/ipr/1524/ - -Microsoft Corporation: -https://datatracker.ietf.org/ipr/1914/ - -Broadcom Corporation: -https://datatracker.ietf.org/ipr/1526/ - ------------------------------------------------------------------------------- -librav1e is redistributed within opencv-python macOS packages. -This license applies to librav1e binary in the directory cv2/. - -BSD 2-Clause License - -Copyright (c) 2017-2020, the rav1e contributors -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------------------- -libsnappy is redistributed within opencv-python macOS packages. -This license applies to libsnappy binary in the directory cv2/. - -Copyright 2011, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------------------- -libspeex is redistributed within opencv-python macOS packages. -This license applies to libspeex binary in the directory cv2/. - -Copyright 2002-2008 Xiph.org Foundation -Copyright 2002-2008 Jean-Marc Valin -Copyright 2005-2007 Analog Devices Inc. -Copyright 2005-2008 Commonwealth Scientific and Industrial Research - Organisation (CSIRO) -Copyright 1993, 2002, 2006 David Rowe -Copyright 2003 EpicGames -Copyright 1992-1994 Jutta Degener, Carsten Bormann - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -- Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -- Neither the name of the Xiph.org Foundation nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------------------- -libsrt is redistributed within opencv-python macOS packages. -This license applies to libsrt binary in the directory cv2/. - -/* - * - * Copyright (c) 2001-2017 Cisco Systems, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * - * Neither the name of the Cisco Systems, Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - - - Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. - ------------------------------------------------------------------------------- -libtheoradec and libtheoraenc are redistributed within opencv-python macOS packages. -This license applies to libtheoradec and libtheoraenc binaries in the directory cv2/. - - Copyright (C) 2002-2009 Xiph.org Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -- Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -- Neither the name of the Xiph.org Foundation nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------------------- -libwebp and libwebpmux are redistributed within opencv-python macOS packages. -This license applies to libwebp and libwebpmux binaries in the directory cv2/. - -Copyright (c) 2010, Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - * Neither the name of Google nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------------------- -libvorbis and libvorbisenc are redistributed within opencv-python macOS packages. -This license applies to libvorbis and libvorbisenc binaries in the directory cv2/. - -Copyright (c) 2002-2020 Xiph.org Foundation - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -- Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -- Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -- Neither the name of the Xiph.org Foundation nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ------------------------------------------------------------------------------- -Libxcb utility libraries are redistributed within opencv-python non-headless Linux packages. -This license applies to libxcb related binaries in the directory cv2/. - -Copyright (C) 2001-2006 Bart Massey, Jamey Sharp, and Josh Triplett. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall -be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS -BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the authors -or their institutions shall not be used in advertising or -otherwise to promote the sale, use or other dealings in this -Software without prior written authorization from the -authors. - ------------------------------------------------------------------------------- -Libxcb-image is redistributed within opencv-python non-headless Linux packages. -This license applies to libxcb-image binary in the directory cv2/. - -Copyright © 2007-2008 Bart Massey -Copyright © 2008 Julien Danjou -Copyright © 2008 Keith Packard - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, copy, -modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the authors or -their institutions shall not be used in advertising or otherwise to -promote the sale, use or other dealings in this Software without -prior written authorization from the authors. - ------------------------------------------------------------------------------- -Libxcb-util is redistributed within opencv-python non-headless Linux packages. -This license applies to libxcb-util binary in the directory cv2/. - -Copyright © 2008 Bart Massey -Copyright © 2008 Ian Osgood -Copyright © 2008 Jamey Sharp -Copyright © 2008 Josh Triplett -Copyright © 2008-2009 Julien Danjou - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, copy, -modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the authors or -their institutions shall not be used in advertising or otherwise to -promote the sale, use or other dealings in this Software without -prior written authorization from the authors. - ------------------------------------------------------------------------------- -Libxcb-render-util is redistributed within opencv-python non-headless Linux packages. -This license applies to libxcb-render-util binary in the directory cv2/. - -Copyright © 2000 Keith Packard - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation, and that the name of Keith Packard not be used in -advertising or publicity pertaining to distribution of the software without -specific, written prior permission. Keith Packard makes no -representations about the suitability of this software for any purpose. It -is provided "as is" without express or implied warranty. - -KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR -CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - -Copyright © 2006 Jamey Sharp. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the authors or their -institutions shall not be used in advertising or otherwise to promote the -sale, use or other dealings in this Software without prior written -authorization from the authors. - -Copyright © 2006 Ian Osgood - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the authors or their -institutions shall not be used in advertising or otherwise to promote the -sale, use or other dealings in this Software without prior written -authorization from the authors. - ------------------------------------------------------------------------------- -Libxcb-icccm is redistributed within opencv-python non-headless Linux packages. -This license applies to Libxcb-icccm binary in the directory cv2/. - -Copyright © 2008-2011 Arnaud Fontaine -Copyright © 2007-2008 Vincent Torri - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, copy, -modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF -CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the names of the authors or -their institutions shall not be used in advertising or otherwise to -promote the sale, use or other dealings in this Software without -prior written authorization from the authors. - ------------------------------------------------------------------------------- -libXau is redistributed within opencv-python non-headless Linux packages. -This license applies to libXau binary in the directory cv2/. - -Copyright 1988, 1993, 1994, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. - -====================== - -pyzbar ------- -https://github.com/NaturalHistoryMuseum/pyzbar/ -Copyright (c) 2016 The Trustees of the Natural History Museum, London -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -====================== - -isodate -------- -https://github.com/gweis/isodate/ -############################################################################## -# Copyright 2009, Gerhard Weis -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# * Neither the name of the authors nor the names of its contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT -############################################################################## - - -====================== - -configparser ------------- -https://github.com/jaraco/configparser/ -Copyright Jason R. Coombs - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. - -====================== - -requests --------- -https://docs.python-requests.org/en/master/ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -====================== - -zbar -http://zbar.sourceforge.net/ - -GNU LESSER GENERAL PUBLIC LICENSE - -Version 2.1, February 1999 - -Copyright (C) 1991, 1999 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - -Preamble - -The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. - -This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. - -When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. - -To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. - -For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. - -We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. - -To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. - -Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. - -Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. - -When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. - -We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. - -For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. - -In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. - -Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. - -The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - -0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". - -A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. - -The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) - -"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. - -Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - -1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. - -You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. - c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. - d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. - - (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. - -3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - -Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. - -This option is useful when you wish to copy part of the code of the Library into a program that is not a library. - -4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. - -If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. - -5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. - -However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. - -When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. - -If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) - -Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - -6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. - -You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: - - a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) - b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. - c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. - d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. - e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. - -For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. - -It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - -7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. - b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. - -8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. - -9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. - -10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - -11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. - -This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - -12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. - -13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - -14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - -NO WARRANTY - -15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -END OF TERMS AND CONDITIONS - -====================== - -netcat -https://nc110.sourceforge.io/ -Public domain. - -====================== +The Observation Framework requires several third-party packages from https://pypi.org/ and libraries to be installed, see README.md. +These and their licenses are listed below: + +pip +--- +https://pip.pypa.io/en/stable/ + +Copyright (c) 2008-2021 The pip developers (see AUTHORS.txt file) + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +====================== + +opencv-python +------------- +https://github.com/opencv/opencv-python +MIT License + +Copyright (c) Olli-Pekka Heinisuo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +... + +OpenCV library is redistributed within opencv-python package. +This license applies to OpenCV binary in the directory cv2/. + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +------------------------------------------------------------------------------ +libvpx is redistributed within all opencv-python Linux packages. +This license applies to libvpx binary in the directory cv2/. + +Copyright (c) 2010, The WebM Project authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google, nor the WebM Project, nor the names + of its contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +FFmpeg is redistributed within all opencv-python packages. + +Libbluray, libgnutls, libnettle, libhogweed, libintl, libmp3lame, libp11, +librtmp, libsoxr and libtasn1 are redistributed within all opencv-python macOS packages. + +This license applies to the above library binaries in the directory cv2/. + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + +------------------------------------------------------------------------------ +Qt 5 is redistributed within non-headless opencv-python Linux and macOS packages. +libgmp is redistributed within opencv-python macOS packages. +libidn2 is redistributed within opencv-python macOS packages. +libunistring is redistributed within opencv-python macOS packages. +This license applies to the above binaries in the directory cv2/. + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + +------------------------------------------------------------------------------ +bzip2 is redistributed within all opencv-python Linux packages. +This license applies to libbz2 binary in the directory cv2/. + +This program, "bzip2", the associated library "libbzip2", and all +documentation, are copyright (C) 1996-2010 Julian R Seward. All +rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + +4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Julian Seward, jseward@bzip.org +bzip2/libbzip2 version 1.0.6 of 6 September 2010 + +------------------------------------------------------------------------------ +libcrypto and libssl are redistributed within all opencv-python Linux and macOS packages. +libopencore-amrnb and libopencore-amrwb are redistributed within all opencv-python Linux and macOS packages. +This license applies to above binaries in the directory cv2/. + + LICENSE ISSUES + ============== + + The OpenSSL toolkit stays under a double license, i.e. both the conditions of + the OpenSSL License and the original SSLeay license apply to the toolkit. + See below for the actual license texts. + + OpenSSL License + --------------- + +/* ==================================================================== + * Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + + Original SSLeay License + ----------------------- + +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +------------------------------------------------------------------------------ +libfontconfig is redistributed within all opencv-python macOS packages. +This license applies to libfontconfig binary in the directory cv2/. + +Copyright © 2000,2001,2002,2003,2004,2006,2007 Keith Packard +Copyright © 2005 Patrick Lam +Copyright © 2009 Roozbeh Pournader +Copyright © 2008,2009 Red Hat, Inc. +Copyright © 2008 Danilo Šegan +Copyright © 2012 Google, Inc. + + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of the author(s) not be used in +advertising or publicity pertaining to distribution of the software without +specific, written prior permission. The authors make no +representations about the suitability of this software for any purpose. It +is provided "as is" without express or implied warranty. + +THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +------------------------------------------------------------------------------ +libfreetype is redistributed within opencv-python Linux and macOS packages. +This license applies to libfreetype binary in the directory cv2/. + + The FreeType Project LICENSE + ---------------------------- + + 2006-Jan-27 + + Copyright 1996-2002, 2006 by + David Turner, Robert Wilhelm, and Werner Lemberg + + + +Introduction +============ + + The FreeType Project is distributed in several archive packages; + some of them may contain, in addition to the FreeType font engine, + various tools and contributions which rely on, or relate to, the + FreeType Project. + + This license applies to all files found in such packages, and + which do not fall under their own explicit license. The license + affects thus the FreeType font engine, the test programs, + documentation and makefiles, at the very least. + + This license was inspired by the BSD, Artistic, and IJG + (Independent JPEG Group) licenses, which all encourage inclusion + and use of free software in commercial and freeware products + alike. As a consequence, its main points are that: + + o We don't promise that this software works. However, we will be + interested in any kind of bug reports. (`as is' distribution) + + o You can use this software for whatever you want, in parts or + full form, without having to pay us. (`royalty-free' usage) + + o You may not pretend that you wrote this software. If you use + it, or only parts of it, in a program, you must acknowledge + somewhere in your documentation that you have used the + FreeType code. (`credits') + + We specifically permit and encourage the inclusion of this + software, with or without modifications, in commercial products. + We disclaim all warranties covering The FreeType Project and + assume no liability related to The FreeType Project. + + + Finally, many people asked us for a preferred form for a + credit/disclaimer to use in compliance with this license. We thus + encourage you to use the following text: + + """ + Portions of this software are copyright © The FreeType + Project (www.freetype.org). All rights reserved. + """ + + Please replace with the value from the FreeType version you + actually use. + + +Legal Terms +=========== + +0. Definitions +-------------- + + Throughout this license, the terms `package', `FreeType Project', + and `FreeType archive' refer to the set of files originally + distributed by the authors (David Turner, Robert Wilhelm, and + Werner Lemberg) as the `FreeType Project', be they named as alpha, + beta or final release. + + `You' refers to the licensee, or person using the project, where + `using' is a generic term including compiling the project's source + code as well as linking it to form a `program' or `executable'. + This program is referred to as `a program using the FreeType + engine'. + + This license applies to all files distributed in the original + FreeType Project, including all source code, binaries and + documentation, unless otherwise stated in the file in its + original, unmodified form as distributed in the original archive. + If you are unsure whether or not a particular file is covered by + this license, you must contact us to verify this. + + The FreeType Project is copyright (C) 1996-2000 by David Turner, + Robert Wilhelm, and Werner Lemberg. All rights reserved except as + specified below. + +1. No Warranty +-------------- + + THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY + KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO + USE, OF THE FREETYPE PROJECT. + +2. Redistribution +----------------- + + This license grants a worldwide, royalty-free, perpetual and + irrevocable right and license to use, execute, perform, compile, + display, copy, create derivative works of, distribute and + sublicense the FreeType Project (in both source and object code + forms) and derivative works thereof for any purpose; and to + authorize others to exercise some or all of the rights granted + herein, subject to the following conditions: + + o Redistribution of source code must retain this license file + (`FTL.TXT') unaltered; any additions, deletions or changes to + the original files must be clearly indicated in accompanying + documentation. The copyright notices of the unaltered, + original files must be preserved in all copies of source + files. + + o Redistribution in binary form must provide a disclaimer that + states that the software is based in part of the work of the + FreeType Team, in the distribution documentation. We also + encourage you to put an URL to the FreeType web page in your + documentation, though this isn't mandatory. + + These conditions apply to any software derived from or based on + the FreeType Project, not just the unmodified files. If you use + our work, you must acknowledge us. However, no fee need be paid + to us. + +3. Advertising +-------------- + + Neither the FreeType authors and contributors nor you shall use + the name of the other for commercial, advertising, or promotional + purposes without specific prior written permission. + + We suggest, but do not require, that you use one or more of the + following phrases to refer to this software in your documentation + or advertising materials: `FreeType Project', `FreeType Engine', + `FreeType library', or `FreeType Distribution'. + + As you have not signed this license, you are not required to + accept it. However, as the FreeType Project is copyrighted + material, only this license, or another one contracted with the + authors, grants you the right to use, distribute, and modify it. + Therefore, by using, distributing, or modifying the FreeType + Project, you indicate that you understand and accept all the terms + of this license. + +4. Contacts +----------- + + There are two mailing lists related to FreeType: + + o freetype@nongnu.org + + Discusses general use and applications of FreeType, as well as + future and wanted additions to the library and distribution. + If you are looking for support, start in this list if you + haven't found anything to help you in the documentation. + + o freetype-devel@nongnu.org + + Discusses bugs, as well as engine internals, design issues, + specific licenses, porting, etc. + + Our home page can be found at + + https://www.freetype.org + +------------------------------------------------------------------------------ +libpng is redistributed within all opencv-python Linux and macOS packages. +This license applies to libpng binary in the directory cv2/. + +PNG Reference Library License version 2 +--------------------------------------- + + * Copyright (c) 1995-2019 The PNG Reference Library Authors. + * Copyright (c) 2018-2019 Cosmin Truta. + * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson. + * Copyright (c) 1996-1997 Andreas Dilger. + * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +The software is supplied "as is", without warranty of any kind, +express or implied, including, without limitation, the warranties +of merchantability, fitness for a particular purpose, title, and +non-infringement. In no event shall the Copyright owners, or +anyone distributing the software, be liable for any damages or +other liability, whether in contract, tort or otherwise, arising +from, out of, or in connection with the software, or the use or +other dealings in the software, even if advised of the possibility +of such damage. + +Permission is hereby granted to use, copy, modify, and distribute +this software, or portions hereof, for any purpose, without fee, +subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you + must not claim that you wrote the original software. If you + use this software in a product, an acknowledgment in the product + documentation would be appreciated, but is not required. + + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + + +PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35) +----------------------------------------------------------------------- + +libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are +Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are +derived from libpng-1.0.6, and are distributed according to the same +disclaimer and license as libpng-1.0.6 with the following individuals +added to the list of Contributing Authors: + + Simon-Pierre Cadieux + Eric S. Raymond + Mans Rullgard + Cosmin Truta + Gilles Vollant + James Yu + Mandar Sahastrabuddhe + Google Inc. + Vadim Barkov + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of + the library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is + with the user. + +Some files in the "contrib" directory and some configure-generated +files that are distributed with libpng have other copyright owners, and +are released under other open source licenses. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from +libpng-0.96, and are distributed according to the same disclaimer and +license as libpng-0.96, with the following individuals added to the +list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, +and are distributed according to the same disclaimer and license as +libpng-0.88, with the following individuals added to the list of +Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +Some files in the "scripts" directory have other copyright owners, +but are released under this license. + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing +Authors and Group 42, Inc. disclaim all warranties, expressed or +implied, including, without limitation, the warranties of +merchantability and of fitness for any purpose. The Contributing +Authors and Group 42, Inc. assume no liability for direct, indirect, +incidental, special, exemplary, or consequential damages, which may +result from the use of the PNG Reference Library, even if advised of +the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + + 1. The origin of this source code must not be misrepresented. + + 2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + + 3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, +without fee, and encourage the use of this source code as a component +to supporting the PNG file format in commercial products. If you use +this source code in a product, acknowledgment is not required but would +be appreciated. + +------------------------------------------------------------------------------ +libz is redistributed within all opencv-python Linux packages. +This license applies to libz binary in the directory cv2/. + + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +------------------------------------------------------------------------------ +libdav1d is redistributed within opencv-python macOS packages. +This license applies to libdav1d binary in the directory cv2/. + +Copyright © 2018-2019, VideoLAN and dav1d authors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libffi is redistributed within opencv-python macOS packages. +This license applies to libffi binary in the directory cv2/. + +libffi - Copyright (c) 1996-2020 Anthony Green, Red Hat, Inc and others. +See source files for details. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------------------------------------------------------------------ +libogg is redistributed within opencv-python macOS packages. +This license applies to libogg binary in the directory cv2/. + +Copyright (c) 2002, Xiph.org Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libopenjp2 is redistributed within opencv-python macOS packages. +This license applies to libopenjp2 binary in the directory cv2/. + +The copyright in this software is being made available under the 2-clauses +BSD License, included below. This software may be subject to other third +party and contributor rights, including patent rights, and no such rights +are granted under this license. + +Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium +Copyright (c) 2002-2014, Professor Benoit Macq +Copyright (c) 2003-2014, Antonin Descampe +Copyright (c) 2003-2009, Francois-Olivier Devaux +Copyright (c) 2005, Herve Drolon, FreeImage Team +Copyright (c) 2002-2003, Yannick Verschueren +Copyright (c) 2001-2003, David Janssens +Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France +Copyright (c) 2012, CS Systemes d'Information, France + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libopus is redistributed within opencv-python macOS packages. +This license applies to libopus binary in the directory cv2/. + +Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic, + Jean-Marc Valin, Timothy B. Terriberry, + CSIRO, Gregory Maxwell, Mark Borgerding, + Erik de Castro Lopo + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of Internet Society, IETF or IETF Trust, nor the +names of specific contributors, may be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Opus is subject to the royalty-free patent licenses which are +specified at: + +Xiph.Org Foundation: +https://datatracker.ietf.org/ipr/1524/ + +Microsoft Corporation: +https://datatracker.ietf.org/ipr/1914/ + +Broadcom Corporation: +https://datatracker.ietf.org/ipr/1526/ + +------------------------------------------------------------------------------ +librav1e is redistributed within opencv-python macOS packages. +This license applies to librav1e binary in the directory cv2/. + +BSD 2-Clause License + +Copyright (c) 2017-2020, the rav1e contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libsnappy is redistributed within opencv-python macOS packages. +This license applies to libsnappy binary in the directory cv2/. + +Copyright 2011, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libspeex is redistributed within opencv-python macOS packages. +This license applies to libspeex binary in the directory cv2/. + +Copyright 2002-2008 Xiph.org Foundation +Copyright 2002-2008 Jean-Marc Valin +Copyright 2005-2007 Analog Devices Inc. +Copyright 2005-2008 Commonwealth Scientific and Industrial Research + Organisation (CSIRO) +Copyright 1993, 2002, 2006 David Rowe +Copyright 2003 EpicGames +Copyright 1992-1994 Jutta Degener, Carsten Bormann + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libsrt is redistributed within opencv-python macOS packages. +This license applies to libsrt binary in the directory cv2/. + +/* + * + * Copyright (c) 2001-2017 Cisco Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * Neither the name of the Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + + + Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. + +------------------------------------------------------------------------------ +libtheoradec and libtheoraenc are redistributed within opencv-python macOS packages. +This license applies to libtheoradec and libtheoraenc binaries in the directory cv2/. + + Copyright (C) 2002-2009 Xiph.org Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libwebp and libwebpmux are redistributed within opencv-python macOS packages. +This license applies to libwebp and libwebpmux binaries in the directory cv2/. + +Copyright (c) 2010, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +libvorbis and libvorbisenc are redistributed within opencv-python macOS packages. +This license applies to libvorbis and libvorbisenc binaries in the directory cv2/. + +Copyright (c) 2002-2020 Xiph.org Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +Libxcb utility libraries are redistributed within opencv-python non-headless Linux packages. +This license applies to libxcb related binaries in the directory cv2/. + +Copyright (C) 2001-2006 Bart Massey, Jamey Sharp, and Josh Triplett. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall +be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors +or their institutions shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this +Software without prior written authorization from the +authors. + +------------------------------------------------------------------------------ +Libxcb-image is redistributed within opencv-python non-headless Linux packages. +This license applies to libxcb-image binary in the directory cv2/. + +Copyright © 2007-2008 Bart Massey +Copyright © 2008 Julien Danjou +Copyright © 2008 Keith Packard + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors or +their institutions shall not be used in advertising or otherwise to +promote the sale, use or other dealings in this Software without +prior written authorization from the authors. + +------------------------------------------------------------------------------ +Libxcb-util is redistributed within opencv-python non-headless Linux packages. +This license applies to libxcb-util binary in the directory cv2/. + +Copyright © 2008 Bart Massey +Copyright © 2008 Ian Osgood +Copyright © 2008 Jamey Sharp +Copyright © 2008 Josh Triplett +Copyright © 2008-2009 Julien Danjou + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors or +their institutions shall not be used in advertising or otherwise to +promote the sale, use or other dealings in this Software without +prior written authorization from the authors. + +------------------------------------------------------------------------------ +Libxcb-render-util is redistributed within opencv-python non-headless Linux packages. +This license applies to libxcb-render-util binary in the directory cv2/. + +Copyright © 2000 Keith Packard + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of Keith Packard not be used in +advertising or publicity pertaining to distribution of the software without +specific, written prior permission. Keith Packard makes no +representations about the suitability of this software for any purpose. It +is provided "as is" without express or implied warranty. + +KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +Copyright © 2006 Jamey Sharp. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors or their +institutions shall not be used in advertising or otherwise to promote the +sale, use or other dealings in this Software without prior written +authorization from the authors. + +Copyright © 2006 Ian Osgood + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors or their +institutions shall not be used in advertising or otherwise to promote the +sale, use or other dealings in this Software without prior written +authorization from the authors. + +------------------------------------------------------------------------------ +Libxcb-icccm is redistributed within opencv-python non-headless Linux packages. +This license applies to Libxcb-icccm binary in the directory cv2/. + +Copyright © 2008-2011 Arnaud Fontaine +Copyright © 2007-2008 Vincent Torri + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors or +their institutions shall not be used in advertising or otherwise to +promote the sale, use or other dealings in this Software without +prior written authorization from the authors. + +------------------------------------------------------------------------------ +libXau is redistributed within opencv-python non-headless Linux packages. +This license applies to libXau binary in the directory cv2/. + +Copyright 1988, 1993, 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +====================== + +pyzbar +------ +https://github.com/NaturalHistoryMuseum/pyzbar/ +Copyright (c) 2016 The Trustees of the Natural History Museum, London +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +====================== + +isodate +------- +https://github.com/gweis/isodate/ +############################################################################## +# Copyright 2009, Gerhard Weis +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the authors nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT +############################################################################## + + +====================== + +configparser +------------ +https://github.com/jaraco/configparser/ +Copyright Jason R. Coombs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + +====================== + +requests +-------- +https://docs.python-requests.org/en/master/ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +====================== + +zbar +http://zbar.sourceforge.net/ + +GNU LESSER GENERAL PUBLIC LICENSE + +Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + +Preamble + +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. + +This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. + +Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. + +We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. + +The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". + +A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. + c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. + d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. + + (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. + +5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. + +However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. + +When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. + +If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: + + a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) + b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. + c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. + d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. + e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. + b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +END OF TERMS AND CONDITIONS + +====================== + +netcat +https://nc110.sourceforge.io/ +Public domain. + +====================== diff --git a/__init__.py b/__init__.py index 35c2823..dd8ef32 100644 --- a/__init__.py +++ b/__init__.py @@ -19,4 +19,4 @@ License: Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0.txt Licensor: Consumer Technology Association Contributor: Eurofins Digital Product Testing UK Limited -""" \ No newline at end of file +""" diff --git a/config.ini b/config.ini index bc155cf..d27b0af 100644 --- a/config.ini +++ b/config.ini @@ -53,8 +53,8 @@ no_qr_code_timeout = 5 search_qr_area_to = 60 # margin to add around the detected area to crop qr_area_margin = 50 -# system mode is for development purposes only -#system_mode = Debug +# qr code list check back count for duplicated qr code detection +duplicated_qr_check_count = 3 [TOLERANCES] start_frame_num_tolerance = 0 diff --git a/configuration_parser.py b/configuration_parser.py index 101cb80..4665d40 100644 --- a/configuration_parser.py +++ b/configuration_parser.py @@ -25,16 +25,16 @@ Licensor: Consumer Technology Association Contributor: Eurofins Digital Product Testing UK Limited """ -from exceptions import ConfigError +import json import logging from typing import Dict, List +from fractions import Fraction -import requests import isodate -import json +import requests +from exceptions import ConfigError from global_configurations import GlobalConfigurations - logger = logging.getLogger(__name__) @@ -55,18 +55,16 @@ class ConfigurationParser: def __init__(self, global_configurations: GlobalConfigurations): self.server_url = global_configurations.get_test_runner_url() - # if conf.ini DEBUG mode is set then read test configuration settings from + # if debug mode is set then read test configuration settings from # a local file (used for development), instead of retrieving from Test Runner. - if (global_configurations.get_system_mode()) == "Debug": + if (global_configurations.get_system_mode()) == "debug": self.test_config_json = self._get_json_from_local("test-config.json") self.tests_json = self._get_json_from_local("tests.json") else: self.test_config_json = self._get_json_from_tr("test-config.json") self.tests_json = self._get_json_from_tr("tests.json") - def parse_config( - self, content_type:str - ) -> List[Dict[str, Dict[str, str]]]: + def parse_config(self, content_type: str) -> List[Dict[str, Dict[str, str]]]: if content_type == "audio": test_config = self.audio_config else: @@ -81,14 +79,18 @@ def parse_tests_json(self, test_id: str): test_path = self.tests_json["tests"][test_id]["path"] test_code = self.tests_json["tests"][test_id]["code"] - self.video_config = self.tests_json["tests"][test_id]["switchingSets"]["video"] - self.audio_config = self.tests_json["tests"][test_id]["switchingSets"]["audio"] + self.video_config = self.tests_json["tests"][test_id]["switchingSets"][ + "video" + ] + self.audio_config = self.tests_json["tests"][test_id]["switchingSets"][ + "audio" + ] return test_path, test_code except KeyError as e: raise ConfigError( f"Unrecognised test id is detected. " - f"Detected test id({test_id}) is not defined in \"tests.json\". " + f'Detected test id({test_id}) is not defined in "tests.json". ' ) def parse_fragment_duration( @@ -96,7 +98,7 @@ def parse_fragment_duration( test_path: str, content_type: str, parameter: str, - test_config: List[Dict[str, str]] + test_config: List[Dict[str, str]], ) -> dict: """parse fragment duration fragment_duration: single track playback @@ -114,7 +116,9 @@ def parse_fragment_duration( raise TypeError # the multiplication happens so that we get the fragment duration in ms # we are interested just about the first video representation's fragment duration - parameters_dict[parameter] = representation["fragment_duration"] * 1000 + parameters_dict[parameter] = ( + Fraction(str(representation["fragment_duration"])) * 1000 + ) break except (TypeError, KeyError) as e: raise ConfigError( @@ -132,14 +136,16 @@ def parse_fragment_duration( if representation["fragment_duration"] == None: raise TypeError # the multiplication happens so that we get the fragment duration in ms - parameters_dict[parameter][rep_index] = representation["fragment_duration"] * 1000 + parameters_dict[parameter][rep_index] = ( + representation["fragment_duration"] * 1000 + ) rep_index += 1 except (TypeError, KeyError) as e: raise ConfigError( f"Failed to get a parameter:{e} for the test '{test_path}'" ) elif parameter == "fragment_duration_multi_mpd": - # fragment_duration_multi_mpd is used for tests when more then mpd is used + # fragment_duration_multi_mpd is used for tests when more then one mpd is used # for splicing set. This is an 2D array, this list is needed to identify # the switching points and splicing point, and to calculate durations parameters_dict[parameter] = {} @@ -152,7 +158,9 @@ def parse_fragment_duration( if representation["fragment_duration"] == None: raise TypeError # the multiplication happens so that we get the fragment duration in ms - parameters_dict[parameter][(content_index, rep_index)] = representation["fragment_duration"] * 1000 + parameters_dict[parameter][(content_index, rep_index)] = ( + representation["fragment_duration"] * 1000 + ) rep_index += 1 except (TypeError, KeyError) as e: raise ConfigError( @@ -181,14 +189,11 @@ def parse_cmaf_track_duration( return parameters_dict def parse_tests_json_content_config( - self, - parameters: list, - test_path: str, - content_type: str + self, parameters: list, test_path: str, content_type: str ) -> dict: """parse content related config parameters for current test""" parameters_dict = {} - + # parse video/audio configuration # TODO: audio parsing, audio observation not implemented test_config = self.parse_config(content_type) @@ -197,14 +202,16 @@ def parse_tests_json_content_config( for parameter in parameters: if parameter == "cmaf_track_duration": # cmaf_track_duration is only required in single mpd - parameters_dict.update(self.parse_cmaf_track_duration(test_path, - test_config[0])) + parameters_dict.update( + self.parse_cmaf_track_duration(test_path, test_config[0]) + ) else: # parse fragment duration handled differently for single mpd and mutiple - parameters_dict.update(self.parse_fragment_duration(test_path, - content_type, - parameter, - test_config)) + parameters_dict.update( + self.parse_fragment_duration( + test_path, content_type, parameter, test_config + ) + ) return parameters_dict @@ -227,9 +234,14 @@ def parse_test_config_json( value = self.test_config_json["all"][parameter] parameters_dict[parameter] = value except KeyError as e: - raise ConfigError( - f"Failed to get a parameter:{e} for the test '{test_path}'" - ) + # gap_duration by default is fragment_duration + # when undefined seek fragment_duration + if parameter == "gap_duration": + continue + else: + raise ConfigError( + f"Failed to get a parameter:{e} for the test '{test_path}'" + ) return parameters_dict @@ -268,12 +280,12 @@ class PlayoutParser: @staticmethod def get_switching_playout(playout: List[List[int]]) -> List[int]: """for switching set to extract track ID list - switching set ID column 0 and the fragment ID column 2 + switching set ID column 0 and the fragment ID column 2 are ignored for swithing set tests """ switching_playout = [i[1] for i in playout] return switching_playout - + @staticmethod def get_playout_sequence(switching_playout: List[int]): """for switching set return playout sequence @@ -285,12 +297,12 @@ def get_playout_sequence(switching_playout: List[int]): if switching_playout[i] != switching_playout[i - 1]: playout_sequence.append(switching_playout[i]) return playout_sequence - + @staticmethod def get_splicing_period_list( playouts: List[List[int]], fragment_duration_multi_mpd: dict ) -> List[float]: - """ return period duration list of splicing + """return period duration list of splicing e.g: [main duration, ad duration, main duration] """ period_list = [] @@ -307,8 +319,7 @@ def get_splicing_period_list( @staticmethod def get_change_type_list(playouts: List[List[int]]) -> List[str]: - """ save ecah change type in a list - """ + """save ecah change type in a list""" change_type_list = [] switching_set = playouts[0][0] track_num = playouts[0][1] @@ -323,28 +334,26 @@ def get_change_type_list(playouts: List[List[int]]) -> List[str]: @staticmethod def get_ending_playout_list(playouts: List[List[int]]) -> List[List[int]]: - """ when content change save each previous ending playout - """ + """when content change save each previous ending playout""" ending_playout_list = [] switching_set = playouts[0][0] track_num = playouts[0][1] for i, playout in enumerate(playouts): - if (playout[0] != switching_set or playout[1] != track_num): - ending_playout_list.append(playouts[i-1]) + if playout[0] != switching_set or playout[1] != track_num: + ending_playout_list.append(playouts[i - 1]) switching_set = playout[0] track_num = playout[1] return ending_playout_list @staticmethod def get_starting_playout_list(playouts: List[List[int]]) -> List[List[int]]: - """ when content change save each current starting playout - """ + """when content change save each current starting playout""" starting_playout_list = [] switching_set = playouts[0][0] track_num = playouts[0][1] for playout in playouts: - if (playout[0] != switching_set or playout[1] != track_num): + if playout[0] != switching_set or playout[1] != track_num: starting_playout_list.append(playout) switching_set = playout[0] track_num = playout[1] - return starting_playout_list \ No newline at end of file + return starting_playout_list diff --git a/dpctf_qr_decoder.py b/dpctf_qr_decoder.py index 940526e..8faf895 100644 --- a/dpctf_qr_decoder.py +++ b/dpctf_qr_decoder.py @@ -25,10 +25,12 @@ Licensor: Consumer Technology Association Contributor: Eurofins Digital Product Testing UK Limited """ -import re -import logging import json +import logging +import re from datetime import datetime +from fractions import Fraction + from qr_recognition.qr_decoder import DecodedQr, QrDecoder logger = logging.getLogger(__name__) @@ -53,7 +55,7 @@ class MezzanineDecodedQr(DecodedQr): """The media time encoded in this QR code""" frame_number: int """The media time encoded in this QR code""" - frame_rate: float + frame_rate: Fraction """The frame rate encoded in this QR code""" first_camera_frame_num: int @@ -68,7 +70,7 @@ def __init__( content_id: str, media_time: float, frame_number: int, - frame_rate: float, + frame_rate: Fraction, camera_frame_num: int, ): super().__init__(data, location) @@ -144,8 +146,9 @@ def __init__(self, data: str, location: list, session_token: str, test_id: str): class DPCTFQrDecoder(QrDecoder): - def _translate_qr_test_runner( - self, data: str, location: list, json_data, camera_frame_num: int + @staticmethod + def translate_qr_test_runner( + data: str, location: list, json_data, camera_frame_num: int ) -> DecodedQr: """translate different type of test runner qr code""" code = DecodedQr("", []) @@ -195,14 +198,11 @@ def _translate_qr_test_runner( return code - def _media_time_str_to_ms(self, media_time_str: str) -> float: + @staticmethod + def media_time_str_to_ms(media_time_str: str) -> float: """Change media time string to ms return media time from mezzanine QR code in milliseconds """ - # temp bug fix from content to be removed - if media_time_str == "00:00:60.000": - media_time_str = "00:01:00.000" - media_time_datetime = datetime.strptime(media_time_str, "%H:%M:%S.%f") ms = media_time_datetime.microsecond / 1000 @@ -213,6 +213,20 @@ def _media_time_str_to_ms(self, media_time_str: str) -> float: return media_time + @staticmethod + def frame_rate_str_to_fraction(frame_rate_str: str) -> Fraction: + """Convert string frame rate to float + fractional frame rate fund match from map to get accurate number""" + frame_rate_map = {} + with open("frame_rate_map.json") as f: + frame_rate_map = json.load(f) + try: + res = frame_rate_map[frame_rate_str].split('/') + frame_rate = Fraction(int(res[0]), int(res[1])) + except Exception: + frame_rate = Fraction(float(frame_rate_str)) + return frame_rate + def translate_qr( self, data: str, location: list, camera_frame_num: int ) -> DecodedQr: @@ -228,20 +242,21 @@ def translate_qr( match = _mezzanine_qr_data_re.match(data) if match: # matches a mezzanine signature so decode it as such - media_time = self._media_time_str_to_ms(match.group(2)) + media_time = DPCTFQrDecoder.media_time_str_to_ms(match.group(2)) + frame_rate = DPCTFQrDecoder.frame_rate_str_to_fraction(match.group(4)) code = MezzanineDecodedQr( data, location, match.group(1), media_time, int(match.group(3)), - float(match.group(4)), + frame_rate, camera_frame_num, ) else: try: json_data = json.loads(data) - code = self._translate_qr_test_runner( + code = DPCTFQrDecoder.translate_qr_test_runner( data, location, json_data, camera_frame_num ) except json.decoder.JSONDecodeError as e: diff --git a/exceptions.py b/exceptions.py index 1b80e64..8f49a91 100644 --- a/exceptions.py +++ b/exceptions.py @@ -23,6 +23,7 @@ Contributor: Eurofins Digital Product Testing UK Limited """ + class ObsFrameError(Exception): """Base for specific exceptions thrown by Observation Framework. @@ -43,9 +44,11 @@ class ObsFrameTerminate(ObsFrameError): """Specific exceptions thrown by Observation Framework. when this is raised the Observation Framework will be terminated. """ + pass class ConfigError(ObsFrameError): """Specific exception to indicate config errors""" + pass diff --git a/frame_rate_map.json b/frame_rate_map.json new file mode 100755 index 0000000..d1ed89e --- /dev/null +++ b/frame_rate_map.json @@ -0,0 +1,5 @@ +{ + "14.985": "15000/1001", + "29.97": "30000/1001", + "59.94": "60000/1001" +} \ No newline at end of file diff --git a/global_configurations.py b/global_configurations.py index bd5e0be..5158a89 100644 --- a/global_configurations.py +++ b/global_configurations.py @@ -27,10 +27,8 @@ """ import configparser import logging - from typing import Dict - logger = logging.getLogger(__name__) @@ -38,20 +36,36 @@ class GlobalConfigurations: """Global Configurations class""" config: configparser.RawConfigParser + ignore: str + """special condition to ignore + used to ignore corrupted frames for gopro9""" + system_mode: str + """system mode for debugging purpose only""" def __init__(self): self.config = configparser.ConfigParser() self.config.read("config.ini", "UTF-8") + self.ignore = "" + self.system_mode = "" - def get_system_mode(self) -> str: - try: - system_mode = self.config["GENERAL"]["system_mode"] - except KeyError: - system_mode = "" + def set_ignore(self, ignore: str) -> str: + """Set ignore""" + self.ignore = ignore + + def get_ignore(self) -> str: + """Get ignore""" + return self.ignore - return system_mode + def set_system_mode(self, mode: str) -> str: + """Set system_mode""" + self.system_mode = mode + + def get_system_mode(self) -> str: + """Get system_mode""" + return self.system_mode def get_sort_input_files_by(self) -> str: + """Get sort_input_files_by""" try: sort_input_files_by = self.config["GENERAL"]["sort_input_files_by"] except KeyError: @@ -60,6 +74,7 @@ def get_sort_input_files_by(self) -> str: return sort_input_files_by def get_log_file_path(self) -> str: + """Get log_file_path""" try: log_file_path = self.config["GENERAL"]["log_file_path"] except KeyError: @@ -67,6 +82,7 @@ def get_log_file_path(self) -> str: return log_file_path def get_result_file_path(self) -> str: + """Get result_file_path""" try: result_file_path = self.config["GENERAL"]["result_file_path"] except KeyError: @@ -74,15 +90,15 @@ def get_result_file_path(self) -> str: return result_file_path def get_session_log_threshold(self) -> int: + """Get session_log_threshold""" try: - session_log_threshold = int( - self.config["GENERAL"]["session_log_threshold"] - ) + session_log_threshold = int(self.config["GENERAL"]["session_log_threshold"]) except KeyError: session_log_threshold = 100 return session_log_threshold def get_test_runner_url(self) -> str: + """Get test_runner_url""" try: test_runner_url = self.config["GENERAL"]["test_runner_url"] except KeyError: @@ -90,6 +106,7 @@ def get_test_runner_url(self) -> str: return test_runner_url def get_missing_frame_threshold(self) -> int: + """Get missing_frame_threshold""" try: missing_frame_threshold = int( self.config["GENERAL"]["missing_frame_threshold"] @@ -99,6 +116,7 @@ def get_missing_frame_threshold(self) -> int: return missing_frame_threshold def get_consecutive_no_qr_threshold(self) -> int: + """Get consecutive_no_qr_threshold""" try: consecutive_no_qr_threshold = int( self.config["GENERAL"]["consecutive_no_qr_threshold"] @@ -108,6 +126,7 @@ def get_consecutive_no_qr_threshold(self) -> int: return consecutive_no_qr_threshold def get_end_of_session_timeout(self) -> int: + """Get end_of_session_timeout""" try: end_of_session_timeout = int( self.config["GENERAL"]["end_of_session_timeout"] @@ -117,39 +136,45 @@ def get_end_of_session_timeout(self) -> int: return end_of_session_timeout def get_no_qr_code_timeout(self) -> int: + """Get no_qr_code_timeout""" try: - no_qr_code_timeout = int( - self.config["GENERAL"]["no_qr_code_timeout"] - ) + no_qr_code_timeout = int(self.config["GENERAL"]["no_qr_code_timeout"]) except KeyError: no_qr_code_timeout = 5 return no_qr_code_timeout def get_search_qr_area_to(self) -> int: + """Get search_qr_area_to""" try: - search_qr_area_to = int( - self.config["GENERAL"]["search_qr_area_to"] - ) + search_qr_area_to = int(self.config["GENERAL"]["search_qr_area_to"]) except KeyError: search_qr_area_to = 60 return search_qr_area_to def get_qr_area_margin(self) -> int: + """Get qr_area_margin""" try: - qr_area_margin = int( - self.config["GENERAL"]["qr_area_margin"] - ) + qr_area_margin = int(self.config["GENERAL"]["qr_area_margin"]) except KeyError: qr_area_margin = 50 return qr_area_margin + def get_duplicated_qr_check_count(self) -> int: + """Get duplicated_qr_check_count""" + try: + duplicated_qr_check_count = int(self.config["GENERAL"]["duplicated_qr_check_count"]) + except KeyError: + duplicated_qr_check_count = 3 + return duplicated_qr_check_count + def get_tolerances(self) -> Dict[str, int]: + """Get tolerances""" tolerances = { "start_frame_num_tolerance": 0, "end_frame_num_tolerance": 0, "mid_frame_num_tolerance": 0, "splice_start_frame_num_tolerance": 0, - "splice_end_frame_num_tolerance": 0 + "splice_end_frame_num_tolerance": 0, } try: tolerances["start_frame_num_tolerance"] = int( diff --git a/log_handler.py b/log_handler.py index bb9aae6..b28bdc5 100644 --- a/log_handler.py +++ b/log_handler.py @@ -23,8 +23,8 @@ Contributor: Eurofins Digital Product Testing UK Limited """ import logging -from logging.handlers import RotatingFileHandler from logging import FileHandler +from logging.handlers import RotatingFileHandler MAX_LOGFILE_BYTES = 10 * 1024 * 1024 BAK_LOG_FILE_NUM = 5 diff --git a/observation_framework.py b/observation_framework.py index 0d70798..b57a46d 100644 --- a/observation_framework.py +++ b/observation_framework.py @@ -25,32 +25,29 @@ Contributor: Eurofins Digital Product Testing UK Limited """ import argparse -import os -import cv2 import errno import logging -import traceback +import os import shutil import sys - -from typing import List, Tuple +import traceback from pathlib import Path +from typing import List, Tuple + +import cv2 +from dpctf_qr_decoder import (DPCTFQrDecoder, MezzanineDecodedQr, + PreTestDecodedQr, TestStatusDecodedQr) +from exceptions import ConfigError, ObsFrameTerminate from global_configurations import GlobalConfigurations +from log_handler import LogManager from observation_framework_processor import ObservationFrameworkProcessor from qr_recognition.qr_recognition import FrameAnalysis -from dpctf_qr_decoder import ( - DPCTFQrDecoder, - MezzanineDecodedQr, - PreTestDecodedQr, - TestStatusDecodedQr, -) -from exceptions import ObsFrameTerminate, ConfigError -from log_handler import LogManager MAJOR = 1 -MINOR = 0 -PATCH = 3 -VERSION = f"{MAJOR}.{MINOR}.{PATCH}" +MINOR = 1 +PATCH = 0 +BETA = "" +VERSION = f"{MAJOR}.{MINOR}.{PATCH}{BETA}" logger = logging.getLogger(__name__) @@ -85,7 +82,8 @@ def iter_to_get_qr_area( width: int, height: int, end_iter_frame_num: int, - do_adaptiveThreshold_scan: bool + do_adaptive_threshold_scan: bool, + global_configurations: GlobalConfigurations, ) -> Tuple: """Iterate video frame by frame and detect mezzanine QR codes area. @@ -95,6 +93,7 @@ def iter_to_get_qr_area( width: recording image width height: recording image height end_iter_frame_num: frame number where system stops search qr areas + global_configurations: to get configuration from Returns: first_pre_test_qr_time: first pre test qr code detection time in ms @@ -106,14 +105,19 @@ def iter_to_get_qr_area( first_pre_test_qr_time = 0 qr_code_areas = [[], []] capture_frame_num = 0 + corrupted_frame_num = 0 len_frames = int(vidcap.get(cv2.CAP_PROP_FRAME_COUNT)) - while len_frames > capture_frame_num: + while (len_frames + corrupted_frame_num) > capture_frame_num: got_frame, image = vidcap.read() if not got_frame: - # work around for gopro - capture_frame_num += 1 - continue + if "corrupted" in global_configurations.get_ignore(): + # work around for gopro + corrupted_frame_num += 1 + capture_frame_num += 1 + continue + else: + break # print out where the processing is currently if capture_frame_num % 10 == 0: @@ -127,24 +131,20 @@ def iter_to_get_qr_area( # right half for test status rough_qr_code_areas[1] = [int(width / 2), 0, width, height] - analysis.full_scan( - image, rough_qr_code_areas, do_adaptiveThreshold_scan - ) + analysis.full_scan(image, rough_qr_code_areas, do_adaptive_threshold_scan) detected_qr_codes = analysis.all_codes() for detected_code in detected_qr_codes: - if ( - isinstance(detected_code, PreTestDecodedQr) - and not first_pre_test_found - ): + if isinstance(detected_code, PreTestDecodedQr) and not first_pre_test_found: first_pre_test_qr_time = capture_frame_num / camera_frame_rate * 1000 first_pre_test_found = True - logger.debug(f"First pre-test QR code is detected at time {first_pre_test_qr_time}.") - elif ( - isinstance(detected_code, MezzanineDecodedQr) - and not mezzanine_found - ): - logger.debug(f"Frame Number={detected_code.frame_number} Location={detected_code.location}") + logger.debug( + f"First pre-test QR code is detected at time {first_pre_test_qr_time}." + ) + elif isinstance(detected_code, MezzanineDecodedQr) and not mezzanine_found: + logger.debug( + f"Frame Number={detected_code.frame_number} Location={detected_code.location}" + ) new_qr_code_area = [ detected_code.location[0], detected_code.location[1], @@ -177,10 +177,11 @@ def iter_to_get_qr_area( ) elif ( - isinstance(detected_code, TestStatusDecodedQr) - and not test_status_found + isinstance(detected_code, TestStatusDecodedQr) and not test_status_found ): - logger.debug(f"Status={detected_code.status} Location={detected_code.location}") + logger.debug( + f"Status={detected_code.status} Location={detected_code.location}" + ) qr_code_areas[1] = [ detected_code.location[0], detected_code.location[1], @@ -214,7 +215,7 @@ def iter_to_get_qr_area( if not test_status_found: logger.info(f"Test Runner QR code areas not detected successfully.") return first_pre_test_qr_time, qr_code_areas - + # if not full area found set to unknown logger.debug(f"End of recording is reached.") if not mezzanine_found: @@ -228,7 +229,7 @@ def iter_to_get_qr_area( def get_qr_code_area( input_video_path_str: str, global_configurations: GlobalConfigurations, - do_adaptiveThreshold_scan: bool + do_adaptive_threshold_scan: bool, ) -> Tuple: """get mezzanine qr code area from recording this will used used for intensive scan to crop the QR code area @@ -265,9 +266,13 @@ def get_qr_code_area( if search_qr_area_to != 0: try: first_pre_test_qr_time, qr_code_areas = iter_to_get_qr_area( - vidcap, fps, width, height, + vidcap, + fps, + width, + height, int(fps * search_qr_area_to), - do_adaptiveThreshold_scan + do_adaptive_threshold_scan, + global_configurations, ) finally: vidcap.release() @@ -317,27 +322,25 @@ def run( input_video_files: List[str], log_manager: LogManager, global_configurations: GlobalConfigurations, - do_adaptiveThreshold_scan: bool + do_adaptive_threshold_scan: bool, ): """Runs the observation framework, loads configuration from Test Runner and reads the recorded video file """ observation_framework = None starting_camera_frame_number = 0 - logger.info(f"Device Observation Framework (v{VERSION}) analysis started!") - if (global_configurations.get_system_mode()) == "Debug": + logger.info(f"Device Observation Framework (V{VERSION}) analysis started!") + if (global_configurations.get_system_mode()) == "debug": logger.info( - f"Device Observation Framework is running in Debug mode, " - f"reads local configuration file from \"configuration\" folder " + f"Device Observation Framework is running in debug mode, " + f'reads local configuration file from "configuration" folder ' f"and will not post results back to the Test Runner." ) - if do_adaptiveThreshold_scan: + if do_adaptive_threshold_scan: logger.info(f"Intensive QR code scanning with additional adaptiveThreshold.") first_pre_test_qr_time, qr_code_areas = get_qr_code_area( - input_video_files[0], - global_configurations, - do_adaptiveThreshold_scan + input_video_files[0], global_configurations, do_adaptive_threshold_scan ) logger.info( f"QR code area for full scan is set to {qr_code_areas[0]} for mezzanine QR code, " @@ -368,10 +371,7 @@ def run( try: if observation_framework is None: observation_framework = ObservationFrameworkProcessor( - log_manager, - global_configurations, - fps, - do_adaptiveThreshold_scan + log_manager, global_configurations, fps, do_adaptive_threshold_scan ) last_camera_frame_number = observation_framework.iter_qr_codes_in_video( @@ -460,13 +460,26 @@ def main() -> None: default="general", choices=["general", "intensive"], ) + parser.add_argument( + "--mode", + help="System mode is for development purposes only.", + default="", + choices=["", "debug"], + ) + parser.add_argument( + "--ignore", + help="Specific condition to ignore.", + default="" + ) args = parser.parse_args() - do_adaptiveThreshold_scan = False + do_adaptive_threshold_scan = False if args.scan == "intensive": - do_adaptiveThreshold_scan = True + do_adaptive_threshold_scan = True global_configurations = GlobalConfigurations() + global_configurations.set_ignore(args.ignore) + global_configurations.set_system_mode(args.mode) log_file_path = global_configurations.get_log_file_path() log_file = log_file_path + "/events.log" @@ -500,7 +513,7 @@ def main() -> None: input_video_files, log_manager, global_configurations, - do_adaptiveThreshold_scan + do_adaptive_threshold_scan, ) except ObsFrameTerminate as e: logger.exception( @@ -513,8 +526,7 @@ def main() -> None: sys.exit(1) except ConfigError as e: logger.exception( - f"Serious error is detected, when analysing {input_video_files}!" - f"{e}", + f"Serious error is detected, when analysing {input_video_files}!" f"{e}", exc_info=False, ) except Exception as e: diff --git a/observation_framework_processor.py b/observation_framework_processor.py index ccf58e7..1722d4e 100644 --- a/observation_framework_processor.py +++ b/observation_framework_processor.py @@ -28,32 +28,29 @@ """ import csv import importlib -import cv2 -import logging import json +import logging import os - from typing import List -from dpctf_qr_decoder import ( - DPCTFQrDecoder, - MezzanineDecodedQr, - TestStatusDecodedQr, - PreTestDecodedQr, -) + +import cv2 from configuration_parser import ConfigurationParser +from dpctf_qr_decoder import (DPCTFQrDecoder, MezzanineDecodedQr, + PreTestDecodedQr, TestStatusDecodedQr) +from exceptions import ConfigError, ObsFrameTerminate from global_configurations import GlobalConfigurations +from log_handler import LogManager +from observation_result_handler import ObservationResultHandler from qr_recognition.qr_decoder import DecodedQr from qr_recognition.qr_recognition import FrameAnalysis -from observation_result_handler import ObservationResultHandler -from exceptions import ObsFrameTerminate, ConfigError -from log_handler import LogManager logger = logging.getLogger(__name__) class ObservationFrameworkProcessor: """Class to handle observation process""" - do_adaptiveThreshold_scan: bool + + do_adaptive_threshold_scan: bool """additional adaptiveThreshold in qr code scan""" log_manager: LogManager @@ -63,7 +60,7 @@ class ObservationFrameworkProcessor: """tests codes dictonary to map test code with module and class""" last_end_of_test_camera_frame_num: int - """recording frame number of the last ended event to check the end of session timeout""" + """recording frame number of the last finished event to check the end of session timeout""" end_of_session_timeout: int """end of session timeout when the gap is bigger that this, assume end of session is reached @@ -87,6 +84,8 @@ class ObservationFrameworkProcessor: observation_result_handler: ObservationResultHandler """Observation result handler to pass result to Test Runner""" + duplicated_qr_check_count: int + """qr code list check back count for duplicated qr code detection""" mezzanine_qr_codes: List[MezzanineDecodedQr] """detected list of mezzanine qr codes for current test""" @@ -121,16 +120,18 @@ class ObservationFrameworkProcessor: stop counter when mezzanine qr is detected at any time""" first_qr_is_detected: bool """start consecutive no qr code count after 1st mezzanine qr is detected - and stop counting when the status is ended""" + and stop counting when the status is finished""" test_started: bool - """True when pre_test QR code is detected and False when status is ended""" + """True when pre_test QR code is detected and False when status is finished""" + results: list + """ Holds the results of the observations """ def __init__( self, log_manager: LogManager, global_configurations: GlobalConfigurations, fps: float, - do_adaptiveThreshold_scan: bool + do_adaptive_threshold_scan: bool, ): """dict {test_code : (module_name, class_name)} test_code: test code from test runner configuration, this mapped from test ID from pre-test QR code @@ -153,7 +154,8 @@ def __init__( self.global_configurations ) - self.do_adaptiveThreshold_scan = do_adaptiveThreshold_scan + self.do_adaptive_threshold_scan = do_adaptive_threshold_scan + self.duplicated_qr_check_count = global_configurations.get_duplicated_qr_check_count() self.mezzanine_qr_codes = [] self.test_status_qr_codes = [] @@ -173,11 +175,13 @@ def __init__( self.consecutive_no_qr_count = 0 self.first_qr_is_detected = False self.test_started = False + self.results = [] def _discard_duplicated_qr_code(self, detected_codes: List[DecodedQr]): """discard duplicated qr code by its frame number QR codes that are detected on same frame - sort it to avoid out of order + sort newly detected mazzanine QR codes on same image + to avoid false out of order detection this function returns QR codes for different type individually """ new_mezzanine_qr_codes = [] @@ -186,8 +190,15 @@ def _discard_duplicated_qr_code(self, detected_codes: List[DecodedQr]): for detected_code in detected_codes: if isinstance(detected_code, MezzanineDecodedQr): + check_back_count = 0 duplicated = False for qr_code in self.mezzanine_qr_codes[::-1]: + check_back_count += 1 + if check_back_count > self.duplicated_qr_check_count: + # add to list even duplicated frame + # duplicated frame normally chack back for duplicated_qr_check_count + # default value is 3 becuase we have only 4 QR code position + break if qr_code == detected_code: duplicated = True # update last appear frame number @@ -262,7 +273,7 @@ def _load_new_test(self) -> None: except KeyError: raise Exception(f"Test '{test_code}' not supported!") - def _make_observations(self) -> None: + def _make_observations(self): """make observations when move to next test or at the end of the recording the observation result is to be posted after @@ -275,6 +286,8 @@ def _make_observations(self) -> None: self.test_status_qr_codes, self.time_diff_file, ) + self._save_results(results) + except ObsFrameTerminate as e: results = [] result = { @@ -288,9 +301,35 @@ def _make_observations(self) -> None: ) raise ObsFrameTerminate(result["message"]) - self.observation_result_handler.post_result( - self.pre_test_qr_code.session_token, self.test_path, results - ) + def _save_results(self, results: list) -> None: + """ + Save results to self.results + when previous presentation result is not empty merge two results. + Merge same result and append different result. + """ + if not self.results: + self.results = results + else: + for new_result in results: + for result in self.results: + if new_result["name"] == result["name"]: + result["message"] = result["message"] + new_result["message"] + if ( + new_result["status"] == "PASS" + and result["status"] == "PASS" + ): + result["status"] == "PASS" + else: + result["status"] = new_result["status"] + else: + self.results.append(new_result) + + def _post_observation_result(self) -> None: + """Post observation result to test runner""" + self.observation_result_handler.post_result( + self.pre_test_qr_code.session_token, self.test_path, self.results + ) + self.results = [] def _process_mezzanine_qr_codes( self, new_mezzanine_qr_codes: List[MezzanineDecodedQr] @@ -318,13 +357,12 @@ def _process_test_status_qr_code( f"Captured on Frame={new_test_status_qr_code.camera_frame_num}" ) self.test_status_qr_codes.append(new_test_status_qr_code) - - # when status ended is detected make observation - if new_test_status_qr_code.status == "ended": + if new_test_status_qr_code.status == "finished": self.last_end_of_test_camera_frame_num = ( new_test_status_qr_code.camera_frame_num ) self._make_observations() + self._post_observation_result() def _process_pre_test_qr_code(self, new_pre_test_qr_code: PreTestDecodedQr) -> None: """Process newly detected pre-test QR code""" @@ -392,7 +430,7 @@ def check_timeout( ) -> bool: """check timeout and log error message when timedout this is used to detect ened of sesssion: - timeout after the last status=ended is recived untill the next pre-test QR code + timeout after the last status=finished is recived untill the next pre-test QR code and idle time when there is no QR code detected Args: @@ -421,8 +459,7 @@ def check_timeout( def extract_qr_data_to_csv( self, camera_frame_number: int, detected_qr_codes: List[DecodedQr] ) -> None: - """Extract camera frame number and detected qr code data to a csv file - """ + """Extract camera frame number and detected qr code data to a csv file""" if not self.qr_list_file: return @@ -486,7 +523,7 @@ def extract_qr_data_to_csv( def check_consecutive_no_qr_code( self, camera_frame_number: int, detected_qr_codes: List[DecodedQr] ) -> None: - """ check the detected qr codes and if there are no mezzanine qr code is detected + """check the detected qr codes and if there are no mezzanine qr code is detected count the missing code camera frame number, if it exceed the threshold terminate system """ @@ -498,24 +535,25 @@ def check_consecutive_no_qr_code( # update threshold based on detected qr code frame rate self.consecutive_no_qr_threshold = round( self.global_configurations.get_consecutive_no_qr_threshold() - * self.camera_frame_rate / detected_code.frame_rate + * self.camera_frame_rate + / detected_code.frame_rate ) # first qr is detected when a new test is started if self.test_started: self.first_qr_is_detected = True if isinstance(detected_code, TestStatusDecodedQr): - if detected_code.status == "ended": + if detected_code.status == "finished": # changed from ended self.test_started = False self.first_qr_is_detected = False if isinstance(detected_code, PreTestDecodedQr): self.test_started = True - + if self.first_qr_is_detected and not mezzanine_qr_is_detected: self.consecutive_no_qr_count += 1 if ( - self.consecutive_no_qr_threshold != 0 and - self.consecutive_no_qr_count > self.consecutive_no_qr_threshold + self.consecutive_no_qr_threshold != 0 + and self.consecutive_no_qr_count > self.consecutive_no_qr_threshold ): raise ObsFrameTerminate( f"At camera frame {camera_frame_number} " @@ -538,18 +576,23 @@ def iter_qr_codes_in_video( Last camera frame number in this file +1 (i.e. can be used as input to the next call). """ capture_frame_num = 0 + corrupted_frame_num = 0 len_frames = int(vidcap.get(cv2.CAP_PROP_FRAME_COUNT)) - while len_frames > capture_frame_num: + while (len_frames + corrupted_frame_num) > capture_frame_num: got_frame, image = vidcap.read() if not got_frame: - # work around for gopro - capture_frame_num += 1 - continue + if "corrupted" in self.global_configurations.get_ignore(): + # work around for gopro + corrupted_frame_num += 1 + capture_frame_num += 1 + continue + else: + break camera_frame_number = starting_camera_frame_number + capture_frame_num - # check timeout after the last test ended event + # check timeout after the last test finished event if self.check_timeout( self.last_end_of_test_camera_frame_num, camera_frame_number, @@ -564,7 +607,7 @@ def iter_qr_codes_in_video( break analysis = FrameAnalysis(camera_frame_number, self.decoder) - analysis.full_scan(image, qr_code_area, self.do_adaptiveThreshold_scan) + analysis.full_scan(image, qr_code_area, self.do_adaptive_threshold_scan) detected_qr_codes = analysis.all_codes() if detected_qr_codes: self.no_qr_code_frame_num = 0 diff --git a/observation_result_handler.py b/observation_result_handler.py index deacf79..c17aeb1 100644 --- a/observation_result_handler.py +++ b/observation_result_handler.py @@ -27,17 +27,16 @@ Licensor: Consumer Technology Association Contributor: Eurofins Digital Product Testing UK Limited """ +import json import logging -import requests import os -import json - from datetime import datetime from json.decoder import JSONDecodeError from typing import List -from global_configurations import GlobalConfigurations -from exceptions import ObsFrameError, ConfigError +import requests +from exceptions import ConfigError, ObsFrameError +from global_configurations import GlobalConfigurations logger = logging.getLogger(__name__) OF_RESULT_PREFIX = "[OF]" @@ -115,10 +114,7 @@ def _update_subtest(self, subtests_data: list, observation_results: list) -> lis return subtests_data def _save_result_to_file( - self, - filename: str, - observation_results: List[dict], - observation_time: str + self, filename: str, observation_results: List[dict], observation_time: str ) -> None: """save observation result to a result file""" try: @@ -139,7 +135,7 @@ def _update_result_file( filename: str, test_path: str, observation_results: List[dict], - observation_time: str + observation_time: str, ) -> None: """Update result json file to add observation result to subtest section""" try: @@ -227,12 +223,14 @@ def post_result( self._create_results_dir(filename) observation_time_str = datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") - # if conf.ini mode is set to DEBUG then just save results to a file + # if debug mode then just save results to a file # (only used for development) - if (self.global_configurations.get_system_mode()) == "Debug": + if (self.global_configurations.get_system_mode()) == "debug": debug_result_filename = ( - result_file_path + "/" - + session_token + "/" + result_file_path + + "/" + + session_token + + "/" + test_path.replace("/", "-").replace(".html", "") + "_debug.json" ) diff --git a/observations/__init__.py b/observations/__init__.py index 35c2823..dd8ef32 100644 --- a/observations/__init__.py +++ b/observations/__init__.py @@ -19,4 +19,4 @@ License: Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0.txt Licensor: Consumer Technology Association Contributor: Eurofins Digital Product Testing UK Limited -""" \ No newline at end of file +""" diff --git a/observations/duration_matches_cmaf_track.py b/observations/duration_matches_cmaf_track.py index 544d869..1b3e28f 100644 --- a/observations/duration_matches_cmaf_track.py +++ b/observations/duration_matches_cmaf_track.py @@ -25,23 +25,29 @@ Contributor: Eurofins Digital Product Testing UK Limited """ import logging +from typing import Dict, List -from .observation import Observation -from typing import List, Dict from dpctf_qr_decoder import MezzanineDecodedQr, TestStatusDecodedQr from global_configurations import GlobalConfigurations +from test_code.test import TestType + +from .observation import Observation logger = logging.getLogger(__name__) + class DurationMatchesCMAFTrack(Observation): """DurationMatchesCMAFTrack class - The playback duration of the playback matches the duration of the CMAF Track, i.e. TR [k, S] = TR [k, 1] + td[k]. + The playback duration of the playback matches the duration of the CMAF Track, + i.e. TR [k, S] = TR [k, 1] + td[k]. """ + def __init__(self, global_configurations: GlobalConfigurations): super().__init__( "[OF] The playback duration of the playback matches the duration of the CMAF Track, " "i.e. TR [k, S] = TR [k, 1] + td[k].", - global_configurations) + global_configurations, + ) def _get_starting_missing_frame( self, expected_first_frame_num: int, first_qr_code: MezzanineDecodedQr @@ -75,9 +81,10 @@ def get_frame_change_after_play( test_status_qr_codes: List[TestStatusDecodedQr], camera_frame_duration_ms: dict, ) -> int: + """get fisrt play qr code index""" first_play_qr_index = 0 - event_found, play_ct = Observation._get_play_event( - test_status_qr_codes, camera_frame_duration_ms + event_found, play_ct = Observation._find_event( + "play", test_status_qr_codes, camera_frame_duration_ms ) if event_found: @@ -90,9 +97,199 @@ def get_frame_change_after_play( break return first_play_qr_index + def _get_waiting_duration(self, test_status_qr_codes, camera_frame_duration_ms): + """ + calculate waiting duration based on the test runner status qr code + return minimin possible gap duration and maximun possible gap duration + """ + min_gap_duration = 0 + max_gap_duration = 0 + waiting_start_time = 0 + playing_start_time = 0 + status = "" + + # start detecting waiting only after the play is started + # and ignore a few waiting status before the playback start + # assume test runner status is reported correctly on time + for x in range(len(test_status_qr_codes)): + if status == "" and test_status_qr_codes[x].status == "playing": + status = "playing" + elif status == "playing" and test_status_qr_codes[x].status == "waiting": + waiting_start_time = ( + test_status_qr_codes[x].camera_frame_num * camera_frame_duration_ms + - test_status_qr_codes[x + 1].delay + ) + status = "waiting" + elif status == "waiting" and test_status_qr_codes[x].status == "playing": + playing_start_time = ( + test_status_qr_codes[x].camera_frame_num * camera_frame_duration_ms + - test_status_qr_codes[x + 1].delay + ) + min_gap_duration += ( + playing_start_time - waiting_start_time - camera_frame_duration_ms + ) + max_gap_duration += ( + playing_start_time - waiting_start_time + camera_frame_duration_ms + ) + status = "playing" + return [min_gap_duration, max_gap_duration] + + def check_duration_match( + self, + expected_track_duration, + waiting_durations, + camera_frame_duration_ms, + mezzanine_qr_codes: List[MezzanineDecodedQr], + test_status_qr_codes: List[TestStatusDecodedQr], + parameters_dict: dict, + adjust_starting_missing_frames, + adjust_ending_missing_frames, + ) -> bool: + """ + check detected duration matches with the expected duration + """ + duration_tolerance = parameters_dict["duration_tolerance"] + duration_frame_tolerance = parameters_dict["duration_frame_tolerance"] + + first_play_qr_index = self.get_frame_change_after_play( + mezzanine_qr_codes, test_status_qr_codes, camera_frame_duration_ms + ) + last_frame_duration = 1000 / mezzanine_qr_codes[-1].frame_rate + + if adjust_starting_missing_frames: + starting_missing_frame = self._get_starting_missing_frame( + parameters_dict["first_frame_num"], mezzanine_qr_codes[0] + ) + first_frame_duration = 1000 / mezzanine_qr_codes[0].frame_rate + start_frames_to_take_out = starting_missing_frame + first_play_qr_index + # adjust expected track duration based on the missing frames + expected_track_duration -= start_frames_to_take_out * first_frame_duration + + if adjust_ending_missing_frames: + ending_missing_frame = self._get_ending_missing_frame( + parameters_dict["last_frame_num"], mezzanine_qr_codes[-1] + ) + # adjust expected track duration based on the missing frames + expected_track_duration -= ending_missing_frame * last_frame_duration + + if adjust_starting_missing_frames: + # playback duration get measured from the frame change after play() + # till the last detected frame + playback_duration = ( + mezzanine_qr_codes[-1].first_camera_frame_num + - mezzanine_qr_codes[first_play_qr_index].first_camera_frame_num + ) * camera_frame_duration_ms + last_frame_duration + else: + playback_duration = ( + mezzanine_qr_codes[-1].first_camera_frame_num + - mezzanine_qr_codes[0].first_camera_frame_num + ) * camera_frame_duration_ms + last_frame_duration + + total_tolerance_duration = ( + duration_tolerance + + duration_frame_tolerance * 1000 / mezzanine_qr_codes[-1].frame_rate + ) + if "mse_reset_tolerance" in parameters_dict: + total_tolerance_duration += parameters_dict["mse_reset_tolerance"] + if "stall_tolerance_margin" in parameters_dict: + total_tolerance_duration += parameters_dict["stall_tolerance_margin"] + if "random_access_from_tolerance" in parameters_dict: + total_tolerance_duration += parameters_dict["random_access_from_tolerance"] + + # duration check for truncated test presentation one + # where adjust_starting_missing_frames=True and adjust_ending_missing_frames=Flase + if adjust_starting_missing_frames and not adjust_ending_missing_frames: + duration_diff = playback_duration - expected_track_duration + if duration_diff >= 0: + result = True + self.result["message"] += ( + f"Playback duration {round(playback_duration, 2)}ms is " + f"equal to or greater than the duration of the expected track duration " + f"{round(expected_track_duration, 2)}ms." + ) + else: + result = False + self.result["message"] += ( + f"Playback duration {round(playback_duration, 2)}ms is not " + f"equal to or greater than the duration of the expected track duration " + f"{round(expected_track_duration, 2)}ms." + ) + return result + + # waiting in playback + # if gap in duration check the different duration is within the minimum possible gap + # and mximun possible gap taking into account the duration tolerance as well + if waiting_durations: + duration_diff = abs(expected_track_duration - playback_duration) + if ( + duration_diff > waiting_durations[1] + total_tolerance_duration + or duration_diff < waiting_durations[0] - total_tolerance_duration + ): + result = False + self.result["message"] += ( + f"Playback duration {round(playback_duration, 2)}ms does not match expected duration " + f"{round(expected_track_duration, 2)}ms. " + f"Minimum waiting durationn is {round(waiting_durations[0], 2)}ms, " + f"and Maximun waiting duration is {round(waiting_durations[1], 2)}ms." + ) + else: + result = True + self.result["message"] += ( + f"Playback duration is {round(playback_duration, 2)}ms, expected track duration is " + f"{round(expected_track_duration, 2)}ms. " + f"Minimum waiting durationn is {round(waiting_durations[0], 2)}ms, " + f"and Maximun waiting duration is {round(waiting_durations[1], 2)}ms." + ) + # all other general playback + else: + duration_diff = abs(expected_track_duration - playback_duration) + if duration_diff > total_tolerance_duration: + result = False + self.result["message"] += ( + f"Playback duration {round(playback_duration, 2)}ms does not match expected duration " + f"{round(expected_track_duration, 2)}ms +/- tolerance of {duration_tolerance}ms." + ) + else: + result = True + self.result["message"] += ( + f"Playback duration is {round(playback_duration, 2)}ms, expected track duration is " + f"{round(expected_track_duration, 2)}ms." + ) + + self.result[ + "message" + ] += f" Allowed tolerance is {duration_tolerance}ms and duration frame tolerance is {duration_frame_tolerance}." + if adjust_starting_missing_frames: + self.result["message"] += ( + f" Starting missing frame number is {starting_missing_frame}." + f" Starting frames to take out is {start_frames_to_take_out}." + ) + if adjust_ending_missing_frames: + self.result[ + "message" + ] += f" Ending missing frame number is {ending_missing_frame}." + + if "mse_reset_tolerance" in parameters_dict: + additional_tolerance = parameters_dict["mse_reset_tolerance"] + self.result[ + "message" + ] += f" Additional allowed mse_reset_tolerance is {additional_tolerance}ms." + if "stall_tolerance_margin" in parameters_dict: + additional_tolerance = parameters_dict["stall_tolerance_margin"] + self.result[ + "message" + ] += f" Additional allowed stall_tolerance_margin is {additional_tolerance}ms." + if "random_access_from_tolerance" in parameters_dict: + additional_tolerance = parameters_dict["random_access_from_tolerance"] + self.result[ + "message" + ] += f" Additional allowed random_access_from_tolerance is {additional_tolerance}ms." + + return result + def make_observation( self, - _unused1, + test_type, mezzanine_qr_codes: List[MezzanineDecodedQr], test_status_qr_codes: List[TestStatusDecodedQr], parameters_dict: dict, @@ -103,8 +300,6 @@ def make_observation( == expected_track_duration +/- tolerance """ logger.info(f"Making observation {self.result['name']}...") - duration_tolerance = parameters_dict["duration_tolerance"] - duration_frame_tolerance = parameters_dict["duration_frame_tolerance"] if len(mezzanine_qr_codes) < 2: self.result["status"] = "FAIL" @@ -115,51 +310,66 @@ def make_observation( return self.result camera_frame_duration_ms = parameters_dict["camera_frame_duration_ms"] - first_play_qr_index = self.get_frame_change_after_play( - mezzanine_qr_codes, test_status_qr_codes, camera_frame_duration_ms - ) - starting_missing_frame = self._get_starting_missing_frame( - parameters_dict["first_frame_num"], mezzanine_qr_codes[0] - ) - ending_missing_frame = self._get_ending_missing_frame( - parameters_dict["last_frame_num"], mezzanine_qr_codes[-1] - ) - first_frame_duration = 1000 / mezzanine_qr_codes[0].frame_rate - last_frame_duration = 1000 / mezzanine_qr_codes[-1].frame_rate - # playback duration get measured from the frame change after play() - # till the last detected frame - playback_duration = ( - mezzanine_qr_codes[-1].first_camera_frame_num - - mezzanine_qr_codes[first_play_qr_index].first_camera_frame_num - ) * camera_frame_duration_ms + last_frame_duration - - # adjust expected track duration based on the missing frames - start_frames_to_take_out = starting_missing_frame + first_play_qr_index - expected_duration = ( - parameters_dict["expected_track_duration"] - - start_frames_to_take_out * first_frame_duration - - ending_missing_frame * last_frame_duration - ) + waiting_durations = [] + # adjust expected duration based on waiting in playback + if test_type == TestType.WAITINGINPLAYBACK: + waiting_durations = self._get_waiting_duration( + test_status_qr_codes, camera_frame_duration_ms + ) - if abs(expected_duration - playback_duration) > duration_tolerance + duration_frame_tolerance * 1000 / mezzanine_qr_codes[-1].frame_rate: - self.result["status"] = "FAIL" - self.result["message"] = ( - f"Playback duration {round(playback_duration, 2)}ms does not match expected duration " - f"{round(expected_duration, 2)}ms +/- tolerance of {duration_tolerance}ms." + if test_type == TestType.TRUNCATED: + # check individualy for first presentation and second presentaion + change_starting_index_list = Observation.get_content_change_position( + mezzanine_qr_codes + ) + # only concider start missing frames + adjust_starting_missing_frames = True + adjust_ending_missing_frames = False + self.result["message"] += ("First presentation: ") + first_result = self.check_duration_match( + parameters_dict["expected_track_duration"][0], + waiting_durations, + camera_frame_duration_ms, + mezzanine_qr_codes[: change_starting_index_list[1] - 1], + test_status_qr_codes, + parameters_dict, + adjust_starting_missing_frames, + adjust_ending_missing_frames, + ) + # only concider ending missing frames + adjust_starting_missing_frames = False + adjust_ending_missing_frames = True + self.result["message"] += (" Second presentation: ") + second_result = self.check_duration_match( + parameters_dict["expected_track_duration"][1], + waiting_durations, + camera_frame_duration_ms, + mezzanine_qr_codes[change_starting_index_list[1] :], + test_status_qr_codes, + parameters_dict, + adjust_starting_missing_frames, + adjust_ending_missing_frames, ) + result = first_result and second_result else: - self.result["status"] = "PASS" - self.result["message"] = ( - f"Playback duration is {round(playback_duration, 2)}ms, expected track duration is " - f"{round(expected_duration, 2)}ms." + adjust_starting_missing_frames = True + adjust_ending_missing_frames = True + result = self.check_duration_match( + parameters_dict["expected_track_duration"], + waiting_durations, + camera_frame_duration_ms, + mezzanine_qr_codes, + test_status_qr_codes, + parameters_dict, + adjust_starting_missing_frames, + adjust_ending_missing_frames, ) - - self.result["message"] += ( - f" Allowed tolerance is {duration_tolerance}ms and duration frame tolerance is {duration_frame_tolerance}." - f" Starting missing frame number is {starting_missing_frame}." - f" Ending missing frame number is {ending_missing_frame}." - ) + + if result: + self.result["status"] = "PASS" + else: + self.result["status"] = "FAIL" logger.debug(f"[{self.result['status']}] {self.result['message']}") return self.result diff --git a/observations/earliest_sample_same_presentation_time.py b/observations/earliest_sample_same_presentation_time.py index 6be90fd..186290f 100644 --- a/observations/earliest_sample_same_presentation_time.py +++ b/observations/earliest_sample_same_presentation_time.py @@ -25,25 +25,28 @@ Contributor: Eurofins Digital Product Testing UK Limited """ import logging -from .sample_matches_current_time import SampleMatchesCurrentTime -from typing import List, Dict +from typing import Dict, List + from dpctf_qr_decoder import MezzanineDecodedQr, TestStatusDecodedQr +from .sample_matches_current_time import SampleMatchesCurrentTime + logger = logging.getLogger(__name__) class EarliestSampleSamePresentationTime(SampleMatchesCurrentTime): """EarliestSampleSamePresentationTime class N.B. Video only for phase one - The presentation starts with the earliest video sample and the audio sample that corresponds to the same + The presentation starts with the earliest video sample and + the audio sample that corresponds to the same presentation time. """ def __init__(self, _): super().__init__( None, - "[OF] Video only: The presentation starts with the earliest video sample and the audio sample " - "that corresponds to the same presentation time.", + "[OF] Video only: The presentation starts with the earliest video sample " + "and the audio sample that corresponds to the same presentation time.", ) def make_observation( @@ -61,7 +64,7 @@ def make_observation( if not mezzanine_qr_codes: self.result["status"] = "FAIL" - self.result["message"] = f"No QR mezzanine code detected." + self.result["message"] = "No QR mezzanine code detected." logger.info(f"[{self.result['status']}] {self.result['message']}") return self.result @@ -69,7 +72,11 @@ def make_observation( camera_frame_duration_ms = parameters_dict["camera_frame_duration_ms"] allowed_tolerance = parameters_dict["tolerance"] ct_frame_tolerance = parameters_dict["frame_tolerance"] - self.result["message"] += f" Allowed tolerance is {ct_frame_tolerance} frames, {allowed_tolerance}ms." + self.result[ + "message" + ] += ( + f" Allowed tolerance is {ct_frame_tolerance} frames, {allowed_tolerance}ms." + ) for i in range(0, len(test_status_qr_codes)): current_status = test_status_qr_codes[i] @@ -85,7 +92,7 @@ def make_observation( camera_frame_duration_ms, camera_frame_rate, mezzanine_qr_codes, - ct_frame_tolerance + ct_frame_tolerance, ) diff_found, time_diff = self._find_diff_within_tolerance( mezzanine_qr_codes, @@ -93,7 +100,7 @@ def make_observation( first_possible, last_possible, allowed_tolerance, - ct_frame_tolerance + ct_frame_tolerance, ) if not diff_found: self.result["status"] = "FAIL" diff --git a/observations/every_sample_rendered.py b/observations/every_sample_rendered.py index 67a6ee9..07e93c2 100644 --- a/observations/every_sample_rendered.py +++ b/observations/every_sample_rendered.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +# pylint: disable=import-error """observation every_sample_rendered make observation of every_sample_rendered @@ -26,33 +27,36 @@ """ import logging import math +from typing import Dict, List, Optional -from .observation import Observation -from typing import List, Dict, Optional +from configuration_parser import PlayoutParser from dpctf_qr_decoder import MezzanineDecodedQr -from global_configurations import GlobalConfigurations from exceptions import ObsFrameTerminate +from global_configurations import GlobalConfigurations from test_code.test import TestType -from configuration_parser import PlayoutParser + +from .observation import Observation logger = logging.getLogger(__name__) class EverySampleRendered(Observation): """EverySampleRendered class - Every sample S[k,s] shall be rendered and the samples shall be rendered in increasing presentation time order. + Every sample S[k,s] shall be rendered and the samples shall be rendered + in increasing presentation time order. """ missing_frame_count = 0 """total missing frame count""" mid_missing_frame_count = 0 - """mid missing frame count not include frame missing at start and end and when contents switches""" + """mid missing frame count not include frame missing at start and end and + when contents switches""" def __init__(self, global_configurations: GlobalConfigurations, name: str = None): if name is None: name = ( - "[OF] Every sample S[k,s] shall be rendered and the samples shall be rendered in increasing " - "presentation time order." + "[OF] Every sample S[k,s] shall be rendered and the samples shall be rendered " + "in increasing presentation time order." ) super().__init__(name, global_configurations) @@ -172,9 +176,9 @@ def _check_every_frame( self.missing_frame_count += len(missing_frames) if missing_frames: - self.result["message"] += ( - f" Following frames are missing{' in playout ' + str(playout_no) if playout_no else ''}:" - ) + self.result[ + "message" + ] += f" Following frames are missing{' in playout ' + str(playout_no) if playout_no else ''}:" print_range = len(missing_frames) if ( self.missing_frame_threshold != 0 @@ -189,16 +193,16 @@ def _check_every_frame( and self.missing_frame_count > self.missing_frame_threshold ): """if the missing frame exceeded the threshold - send error to the test runner, display error on the console - and end the observation framework - the following tests will not be observed. + send error to the test runner, display error on the console and + end the observation framework the following tests will not be observed. """ self.result["message"] += ( f"... too many missing frames, reporting truncated. " f"Total of missing frames " f"in {'playout ' + str(playout_no) if playout_no else ''} " f"is {self.missing_frame_count}. " - f"Device Observation Framework is exiting, and the following tests are not observed." + f"Device Observation Framework is exiting, " + f"and the following tests are not observed." ) raise ObsFrameTerminate(self.result["message"]) @@ -208,49 +212,26 @@ def _check_every_frame( return check - def get_content_change_position( - self, - mezzanine_qr_codes: List[MezzanineDecodedQr], - ) -> List[int]: - """ loop through the detected mezzanine list to save - content change positions - """ - current_content_id = mezzanine_qr_codes[0].content_id - current_frame_rate = mezzanine_qr_codes[0].frame_rate - change_starting_index_list = [0] - for i in range(1, len(mezzanine_qr_codes)): - if ( - mezzanine_qr_codes[i].content_id != current_content_id - or mezzanine_qr_codes[i].frame_rate != current_frame_rate - ): - # the content did change save the starting index - change_starting_index_list.append(i) - current_content_id = mezzanine_qr_codes[i].content_id - current_frame_rate = mezzanine_qr_codes[i].frame_rate - return change_starting_index_list - def check_every_frame_by_block( self, mezzanine_qr_codes: List[MezzanineDecodedQr], change_index_list: List[int], - playout_sequence: List[int] + playout_sequence: List[int], ) -> bool: """check mid frames for block by block each block is different track """ mid_frame_result = True - for i, starting_index in enumerate(change_index_list): + for i, starting_index in enumerate(change_index_list): if starting_index == change_index_list[-1]: # check mid frames for last block mid_frame_result = mid_frame_result and self._check_every_frame( - mezzanine_qr_codes[change_index_list[-1]:], - playout_sequence[-1] + mezzanine_qr_codes[change_index_list[-1] :], playout_sequence[-1] ) else: last_index = change_index_list[i + 1] - 1 mid_frame_result = mid_frame_result and self._check_every_frame( - mezzanine_qr_codes[starting_index:last_index], - playout_sequence[i] + mezzanine_qr_codes[starting_index:last_index], playout_sequence[i] ) return mid_frame_result @@ -280,7 +261,9 @@ def observe_switching_mid_frame( if playout[i] != playout[i - 1]: switching_positions.append(switching_position) - change_switching_index_list = self.get_content_change_position(mezzanine_qr_codes) + change_switching_index_list = Observation.get_playback_change_position( + mezzanine_qr_codes + ) # check configuration and actual switching matches configured_switching_num = len(switching_positions) @@ -301,10 +284,14 @@ def observe_switching_mid_frame( for i, starting_index in enumerate(change_switching_index_list): if i > 0: # check previous ending frame and new starting frame numbers - # the expected frame number position in the content being switched from is the expected relative time - # of the switch (derived from the test config) * that content's frames per second + # the expected frame number position in the content being switched from is + # the expected relative time of the switch + # (derived from the test config) * that content's frames per second + half_duration_frame = ( + (1000 / mezzanine_qr_codes[starting_index - 1].frame_rate) / 2 + ) previous_ending_frame_num = math.floor( - switching_positions[i] + (switching_positions[i] + half_duration_frame) / 1000 * mezzanine_qr_codes[starting_index - 1].frame_rate ) @@ -316,16 +303,21 @@ def observe_switching_mid_frame( if diff_ending_frame != 0: mid_frame_result = False self.result["message"] += ( - f" Playout {playout_sequence[i - 1]} ending frame found is {mezzanine_qr_codes[starting_index - 1].frame_number }," + f" Playout {playout_sequence[i - 1]} ending frame found is" + f" {mezzanine_qr_codes[starting_index - 1].frame_number }," f" expected to end with {previous_ending_frame_num}." ) - # the expected frame number position in the content being switched to is the expected relative time - # of the switch (derived from the test config) * that content's frames per second + # the expected frame number position in the content being switched to isthe expected + # the expected relative time of the switch + # (derived from the test config) * that content's frames per second # compare expected with the actual frame number detected at this switch point + half_duration_frame = ( + (1000 / mezzanine_qr_codes[starting_index].frame_rate) / 2 + ) current_starting_frame_num = ( math.floor( - switching_positions[i] + (switching_positions[i] + half_duration_frame) / 1000 * mezzanine_qr_codes[starting_index].frame_rate ) @@ -338,18 +330,20 @@ def observe_switching_mid_frame( if diff_starting_frame != 0: mid_frame_result = False self.result["message"] += ( - f" Playout {playout_sequence[i]} starting frame found is {mezzanine_qr_codes[starting_index].frame_number }," + f" Playout {playout_sequence[i]} starting frame found is" + f" {mezzanine_qr_codes[starting_index].frame_number }," f" expected to start from {current_starting_frame_num}." ) return mid_frame_result def observe_splicing_mid_frame( - self, mezzanine_qr_codes: List[MezzanineDecodedQr], + self, + mezzanine_qr_codes: List[MezzanineDecodedQr], playouts: List[List[int]], - fragment_duration_multi_mpd: dict + fragment_duration_multi_mpd: dict, ) -> bool: - """playout[i]: Provides the triple (Switching Set, CMAF track number, Fragment number) + """playout[i]: Provides the triple (Switching Set, CMAF track number, Fragment number) for every playout position i=1,…,N that is be played out. on each splicing point: @@ -364,7 +358,9 @@ def observe_splicing_mid_frame( "splice_end_frame_num_tolerance" ] - change_starting_index_list = self.get_content_change_position(mezzanine_qr_codes) + change_starting_index_list = Observation.get_playback_change_position( + mezzanine_qr_codes + ) change_type_list = PlayoutParser.get_change_type_list(playouts) ending_playout_list = PlayoutParser.get_ending_playout_list(playouts) starting_playout_list = PlayoutParser.get_starting_playout_list(playouts) @@ -386,7 +382,7 @@ def observe_splicing_mid_frame( if starting_index == change_starting_index_list[-1]: # check mid frames for last block check_frame_result = mid_frame_result and self._check_every_frame( - mezzanine_qr_codes[change_starting_index_list[-1]:] + mezzanine_qr_codes[change_starting_index_list[-1] :] ) mid_frame_result = mid_frame_result and check_frame_result else: @@ -398,11 +394,15 @@ def observe_splicing_mid_frame( if i > 0: # check previous ending frame and new starting frame numbers - ending_playout = ending_playout_list[i -1] - ending_fragment_duration = fragment_duration_multi_mpd[(ending_playout[0], ending_playout[1])] + ending_playout = ending_playout_list[i - 1] + ending_fragment_duration = fragment_duration_multi_mpd[ + (ending_playout[0], ending_playout[1]) + ] ending_fragment_num = ending_playout[2] previous_ending_frame_num = math.floor( - ending_fragment_num * ending_fragment_duration / 1000 + ending_fragment_num + * ending_fragment_duration + / 1000 * mezzanine_qr_codes[starting_index - 1].frame_rate ) @@ -412,7 +412,7 @@ def observe_splicing_mid_frame( - previous_ending_frame_num ) - if change_type_list[i-1] == "splicing": + if change_type_list[i - 1] == "splicing": if diff_ending_frame > splice_end_frame_num_tolerance: mid_frame_result = False self.result["message"] += ( @@ -430,12 +430,16 @@ def observe_splicing_mid_frame( f"expected to end with {previous_ending_frame_num}. " ) - starting_playout = starting_playout_list[i -1] - starting_fragment_duration = fragment_duration_multi_mpd[(starting_playout[0], starting_playout[1])] + starting_playout = starting_playout_list[i - 1] + starting_fragment_duration = fragment_duration_multi_mpd[ + (starting_playout[0], starting_playout[1]) + ] starting_fragment_num = starting_playout[2] - 1 current_starting_frame_num = ( math.floor( - starting_fragment_num * starting_fragment_duration / 1000 + starting_fragment_num + * starting_fragment_duration + / 1000 * mezzanine_qr_codes[starting_index].frame_rate ) + 1 @@ -447,7 +451,7 @@ def observe_splicing_mid_frame( - current_starting_frame_num ) - if change_type_list[i-1] == "splicing": + if change_type_list[i - 1] == "splicing": if diff_starting_frame > splice_start_frame_num_tolerance: mid_frame_result = False self.result["message"] += ( @@ -467,6 +471,410 @@ def observe_splicing_mid_frame( return mid_frame_result + def observe_gap_in_playback_mid_frame( + self, mezzanine_qr_codes: List[MezzanineDecodedQr], parameters_dict: dict + ) -> bool: + """ + observe gap_in_playback mid-frames + check mid frames from begining to gap_from_frame and from gap_to_frame till the end + check for any frames within gap_from_frame to gap_to_frame are not rendered + """ + mid_frame_result = False + start_index = 0 + end_index = 0 + + gap_from_frame = parameters_dict["gap_from_and_to_frames"][0] + gap_to_frame = parameters_dict["gap_from_and_to_frames"][1] + + if gap_to_frame < gap_from_frame: + self.result["message"] += ( + "Test configuration error: frame at the begining of gap " + "cannot be smaller than the ending of gap." + ) + return mid_frame_result + + # observe every frame is rendered by seperating qr codes into 2 parts + # search to get the end index of the adjusted_gap_from_frame (added tolerance) + adjusted_gap_from_frame = gap_from_frame + if "stall_tolerance_margin" in parameters_dict: + stall_tolerance_frame = ( + parameters_dict["stall_tolerance_margin"] + * mezzanine_qr_codes[-1].frame_rate + / 1000 + ) + adjusted_gap_from_frame += stall_tolerance_frame + if "random_access_from_tolerance" in parameters_dict: + random_access_from_tolerance_frame = ( + parameters_dict["random_access_from_tolerance"] + * mezzanine_qr_codes[-1].frame_rate + / 1000 + ) + adjusted_gap_from_frame += random_access_from_tolerance_frame + for x in range(len(mezzanine_qr_codes)): + if mezzanine_qr_codes[x].frame_number > adjusted_gap_from_frame: + end_index = x - 1 + break + + # reverse search to get the start_index of gap_to_frame + for x in range(len(mezzanine_qr_codes) - 1, 0, -1): + if mezzanine_qr_codes[x].frame_number < gap_to_frame: + start_index = x + 1 + break + # check every frame is rendered before and after the gap + check_frames_before_gap = self._check_every_frame( + mezzanine_qr_codes[:end_index] + ) + check_frames_after_gap = self._check_every_frame( + mezzanine_qr_codes[start_index:] + ) + if check_frames_before_gap and check_frames_after_gap: + mid_frame_result = True + + # check the gap_from_frame and gap_to_frame matched with + # the frames at end_index and start_index + if mezzanine_qr_codes[end_index].frame_number != gap_from_frame: + if "stall_tolerance_margin" in parameters_dict: + stall_tolerance_frame = ( + parameters_dict["stall_tolerance_margin"] + * mezzanine_qr_codes[-1].frame_rate + / 1000 + ) + if ( + abs(mezzanine_qr_codes[end_index].frame_number - gap_from_frame) + > stall_tolerance_frame + ): + mid_frame_result = False + self.result["message"] += ( + f" Last frame detected before gap {mezzanine_qr_codes[end_index].frame_number}" + f" exceeded 'stall_tolerance_margin':{stall_tolerance_frame} frame" + f" of expected frame {gap_from_frame}." + ) + else: + self.result["message"] += ( + f" Last frame detected before gap {mezzanine_qr_codes[end_index].frame_number}" + f" is within the tolerance of 'stall_tolerance_margin':{stall_tolerance_frame}" + f" frame of expected frame {gap_from_frame}." + ) + elif "random_access_from_tolerance" in parameters_dict: + random_access_from_tolerance_frame = ( + parameters_dict["random_access_from_tolerance"] + * mezzanine_qr_codes[-1].frame_rate + / 1000 + ) + if ( + abs(mezzanine_qr_codes[end_index].frame_number - gap_from_frame) + > random_access_from_tolerance_frame + ): + mid_frame_result = False + self.result["message"] += ( + f" Last frame detected before gap {mezzanine_qr_codes[end_index].frame_number} exceeded" + f" 'random_access_from_tolerance':{random_access_from_tolerance_frame} frame" + f" of expected frame {gap_from_frame}." + ) + else: + self.result["message"] += ( + f" Last frame detected before gap {mezzanine_qr_codes[end_index].frame_number} is within the tolerance of" + f" 'random_access_from_tolerance':{random_access_from_tolerance_frame} frame" + f" of expected frame {gap_from_frame}." + ) + else: + mid_frame_result = False + self.result["message"] += ( + f" Last frame detected before gap {gap_from_frame} doesn't matches" + f" expected frame {mezzanine_qr_codes[end_index].frame_number}." + ) + + if mezzanine_qr_codes[start_index].frame_number != gap_to_frame: + mid_frame_result = False + self.result["message"] += ( + f" First frame detected after gap {gap_to_frame} doesn't matches" + f" expected frame {mezzanine_qr_codes[start_index].frame_number}." + ) + + if (end_index + 1) != start_index: + mid_frame_result = False + unexpected_frame_count = start_index - 1 - end_index + self.result["message"] += ( + f" Samples within a gap shall not be rendered." + f" {unexpected_frame_count} number of following frames should not be rendered." + ) + for x in range(unexpected_frame_count): + if x > 10: + self.result[ + "message" + ] += f" ... {mezzanine_qr_codes[end_index + unexpected_frame_count].frame_number}." + break + self.result[ + "message" + ] += f" {mezzanine_qr_codes[end_index + 1 + x].frame_number}" + + return mid_frame_result + + def observe_truncated_mid_frame( + self, + mezzanine_qr_codes: List[MezzanineDecodedQr], + first_playout: List[List[int]], + second_playout: List[List[int]], + second_playout_switching_time: int, + fragment_duration_multi_mpd: dict, + ) -> bool: + """playout[i]: Provides the triple (Switching Set, CMAF track number, Fragment number) + for every playout position i=1,…,N that is be played out. + first_playout: The playout parameter for the first switching set + second_playout: The playout parameter for the second switching set + second_playout_switching_time: The play position at which to switch to the second switching set. + + on each splicing point: + check previous ending and new starting frames are correct for each periods + check that the samples shall be rendered in increasing order within the same period + for QRb to QRn: QR[i-1].mezzanine_frame_num + 1 == QR[i].mezzanine_frame_num + """ + # check presentation changes twice + content_starting_index_list = Observation.get_content_change_position( + mezzanine_qr_codes + ) + if len(content_starting_index_list) != 2: + self.result["message"] += ( + f"Truncated test should change presentatation once. " + f"Actual presentatation change is {len(content_starting_index_list)}. " + ) + return False + + mezzanine_qr_codes_1 = mezzanine_qr_codes[: content_starting_index_list[1]] + mezzanine_qr_codes_2 = mezzanine_qr_codes[content_starting_index_list[1] :] + + # check presentation one + switching_starting_index_list_1 = Observation.get_playback_change_position( + mezzanine_qr_codes_1 + ) + change_type_list_1 = PlayoutParser.get_change_type_list(first_playout) + + # check if the configured content change and actual content change matches + # if not report error + actual_change_num = len(switching_starting_index_list_1) + configured_change_num = len(change_type_list_1) + 1 + if actual_change_num != configured_change_num: + self.result["message"] += ( + f" For 1st presentation, number of changes does not match the 'playout' configuration. " + f"Test is configured to change {configured_change_num} times. " + f"Actual number of change is {actual_change_num}. " + ) + return False + + # check presentation one + switching_positions = [] + switching_position = 0 + switching_positions.append(switching_position) + for i in range(1, len(first_playout)): + switching_position += fragment_duration_multi_mpd[ + (first_playout[i][0], first_playout[i][1]) + ] + # when track change + if first_playout[i][1] != first_playout[i - 1][1]: + switching_positions.append(switching_position) + + change_switching_index_list = Observation.get_playback_change_position( + mezzanine_qr_codes_1 + ) + + # check configuration and actual switching matches + configured_switching_num = len(switching_positions) + actual_switching_num = len(change_switching_index_list) + if actual_switching_num != configured_switching_num: + self.result["message"] += ( + f" Presentatio 1: Number of switches does not match. " + f"Test is configured to switch {configured_switching_num} times. " + f"Actual number of switches is {actual_switching_num}. " + ) + return False + + # check mid frames block by block + playout_sequence = PlayoutParser.get_playout_sequence(first_playout) + mid_frame_result_1 = self.check_every_frame_by_block( + mezzanine_qr_codes_1, change_switching_index_list, playout_sequence + ) + for i, starting_index in enumerate(change_switching_index_list): + if i > 0: + # check previous ending frame and new starting frame numbers + # the expected frame number position in the content being switched from is the expected relative time + # of the switch (derived from the test config) * that content's frames per second + previous_ending_frame_num = math.floor( + switching_positions[i] + / 1000 + * mezzanine_qr_codes_1[starting_index - 1].frame_rate + ) + # compare expected with the actual frame number detected at this switch point + diff_ending_frame = abs( + mezzanine_qr_codes_1[starting_index - 1].frame_number + - previous_ending_frame_num + ) + if diff_ending_frame != 0: + mid_frame_result_1 = False + self.result["message"] += ( + f" Playout {playout_sequence[i - 1]} ending frame found is {mezzanine_qr_codes_1[starting_index - 1].frame_number }," + f" expected to end with {previous_ending_frame_num}." + ) + + # the expected frame number position in the content being switched to is the expected relative time + # of the switch (derived from the test config) * that content's frames per second + # compare expected with the actual frame number detected at this switch point + current_starting_frame_num = ( + math.floor( + switching_positions[i] + / 1000 + * mezzanine_qr_codes_1[starting_index].frame_rate + ) + + 1 + ) + diff_starting_frame = abs( + mezzanine_qr_codes_1[starting_index].frame_number + - current_starting_frame_num + ) + if diff_starting_frame != 0: + mid_frame_result_1 = False + self.result["message"] += ( + f" Playout {playout_sequence[i]} starting frame found is {mezzanine_qr_codes_1[starting_index].frame_number }," + f" expected to start from {current_starting_frame_num}." + ) + + # check presentation one ending frame this should be in range + # betweeen the second_playout_switching_time and end of playout + ending_frame_from = math.floor( + second_playout_switching_time * mezzanine_qr_codes_1[-1].frame_rate + ) + last_fragment = first_playout[-1] + fragment_duration = fragment_duration_multi_mpd[ + (last_fragment[0], last_fragment[1]) + ] + last_track_duration = fragment_duration * last_fragment[2] + ending_frame_to = math.floor( + last_track_duration / 1000 * mezzanine_qr_codes_1[-1].frame_rate + ) + if ( + mezzanine_qr_codes_1[-1].frame_number < ending_frame_from or + mezzanine_qr_codes_1[-1].frame_number > ending_frame_to + ): + end_frame_result = False + self.result["message"] += ( + f" 1st presentation ending frame found is {mezzanine_qr_codes_1[-1].frame_number}," + f" expected to end from {ending_frame_from} to {ending_frame_to}." + ) + else: + end_frame_result = True + + # check presentation two starting frame + starting_frame = 1 + if starting_frame != mezzanine_qr_codes_2[0].frame_number: + start_frame_result = False + self.result["message"] += ( + f" 2nd presentation starting frame found is {mezzanine_qr_codes_2[0].frame_number}," + f" expected to start with from {starting_frame}." + ) + else: + start_frame_result = True + + # check presentation two + switching_starting_index_list_2 = Observation.get_playback_change_position( + mezzanine_qr_codes_2 + ) + change_type_list_2 = PlayoutParser.get_change_type_list(second_playout) + + # check if the configured content change and actual content change matches + # if not report error + actual_change_num = len(switching_starting_index_list_2) + configured_change_num = len(change_type_list_2) + 1 + if actual_change_num != configured_change_num: + self.result["message"] += ( + f" For 2nd presentation number of changes does not match the 'playout' configuration. " + f"Test is configured to change {configured_change_num} times. " + f"Actual number of change is {actual_change_num}. " + ) + return False + + # check presentation two + switching_positions = [] + switching_position = 0 + switching_positions.append(switching_position) + for i in range(1, len(second_playout)): + switching_position += fragment_duration_multi_mpd[ + (second_playout[i][0], second_playout[i][1]) + ] + # when track change + if second_playout[i][1] != second_playout[i - 1][1]: + switching_positions.append(switching_position) + + change_switching_index_list = Observation.get_playback_change_position( + mezzanine_qr_codes_2 + ) + + # check configuration and actual switching matches + configured_switching_num = len(switching_positions) + actual_switching_num = len(change_switching_index_list) + if actual_switching_num != configured_switching_num: + self.result["message"] += ( + f" Presentatio 2: Number of switches does not match. " + f"Test is configured to switch {configured_switching_num} times. " + f"Actual number of switches is {actual_switching_num}. " + ) + return False + + # check mid frames block by block + playout_sequence = PlayoutParser.get_playout_sequence(second_playout) + mid_frame_result_2 = self.check_every_frame_by_block( + mezzanine_qr_codes_2, change_switching_index_list, playout_sequence + ) + for i, starting_index in enumerate(change_switching_index_list): + if i > 0: + # check previous ending frame and new starting frame numbers + # the expected frame number position in the content being switched from is the expected relative time + # of the switch (derived from the test config) * that content's frames per second + previous_ending_frame_num = math.floor( + switching_positions[i] + / 1000 + * mezzanine_qr_codes_2[starting_index - 1].frame_rate + ) + # compare expected with the actual frame number detected at this switch point + diff_ending_frame = abs( + mezzanine_qr_codes_2[starting_index - 1].frame_number + - previous_ending_frame_num + ) + if diff_ending_frame != 0: + mid_frame_result_2 = False + self.result["message"] += ( + f" Playout {playout_sequence[i - 1]} ending frame found is {mezzanine_qr_codes_2[starting_index - 1].frame_number }," + f" expected to end with {previous_ending_frame_num}." + ) + + # the expected frame number position in the content being switched to is the expected relative time + # of the switch (derived from the test config) * that content's frames per second + # compare expected with the actual frame number detected at this switch point + current_starting_frame_num = ( + math.floor( + switching_positions[i] + / 1000 + * mezzanine_qr_codes_2[starting_index].frame_rate + ) + + 1 + ) + diff_starting_frame = abs( + mezzanine_qr_codes_2[starting_index].frame_number + - current_starting_frame_num + ) + if diff_starting_frame != 0: + mid_frame_result_2 = False + self.result["message"] += ( + f" Playout {playout_sequence[i]} starting frame found is {mezzanine_qr_codes_2[starting_index].frame_number }," + f" expected to start from {current_starting_frame_num}." + ) + + mid_frame_result = ( + mid_frame_result_1 + and mid_frame_result_2 + and start_frame_result + and end_frame_result + ) + return mid_frame_result + def make_observation( self, test_type, @@ -485,7 +893,7 @@ def make_observation( QRn.mezzanine_frame_num == round(cmaf_track_duration * mezzanine_frame_rate) Args: - test_type: SWITCHING|SPLICING|SEQUENTIAL + test_type: defined in test.py mezzanine_qr_codes: lists of MezzanineDecodedQr _unused: parameters_dict: parameter dictionary @@ -512,7 +920,9 @@ def make_observation( ) if test_type == TestType.SWITCHING: - switching_playout = PlayoutParser.get_switching_playout(parameters_dict["playout"]) + switching_playout = PlayoutParser.get_switching_playout( + parameters_dict["playout"] + ) mid_frame_result = self.observe_switching_mid_frame( mezzanine_qr_codes, switching_playout, @@ -524,14 +934,26 @@ def make_observation( parameters_dict["playout"], parameters_dict["fragment_duration_multi_mpd"], ) + elif test_type == TestType.GAPSINPLAYBACK: + mid_frame_result = self.observe_gap_in_playback_mid_frame( + mezzanine_qr_codes, parameters_dict + ) + elif test_type == TestType.TRUNCATED: + mid_frame_result = self.observe_truncated_mid_frame( + mezzanine_qr_codes, + parameters_dict["playout"], + parameters_dict["second_playout"], + parameters_dict["second_playout_switching_time"], + parameters_dict["fragment_duration_multi_mpd"], + ) else: # check that the samples shall be rendered in increasing order: # for QRb to QRn: QR[i-1].mezzanine_frame_num + 1 == QR[i].mezzanine_frame_num mid_frame_result = self._check_every_frame(mezzanine_qr_codes) - self.result["message"] += ( - f" Total of missing frames is {self.missing_frame_count}." - ) + self.result[ + "message" + ] += f" Total of missing frames is {self.missing_frame_count}." if first_frame_result and last_frame_result and mid_frame_result: self.result["status"] = "PASS" diff --git a/observations/every_sample_rendered_in_cmaf_presentation.py b/observations/every_sample_rendered_in_cmaf_presentation.py index 9d8ac05..5a0fde1 100644 --- a/observations/every_sample_rendered_in_cmaf_presentation.py +++ b/observations/every_sample_rendered_in_cmaf_presentation.py @@ -25,9 +25,11 @@ Contributor: Eurofins Digital Product Testing UK Limited """ import logging -from .every_sample_rendered import EverySampleRendered + from global_configurations import GlobalConfigurations +from .every_sample_rendered import EverySampleRendered + logger = logging.getLogger(__name__) @@ -41,6 +43,7 @@ class EverySampleRenderedInCMAFPresentation(EverySampleRendered): def __init__(self, global_configurations: GlobalConfigurations): super().__init__( global_configurations, - "[OF] Video only: Every sample for every media type included in the CMAF Presentation duration " + "[OF] Video only: Every sample for every media type included " + "in the CMAF Presentation duration " "shall be rendered and shall be rendered in order.", ) diff --git a/observations/observation.py b/observations/observation.py index 2bad9b0..8896aef 100644 --- a/observations/observation.py +++ b/observations/observation.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +# pylint: disable=import-error, disable=consider-using-enumerate """observation base class The Software is provided to you by the Licensor under the License, as @@ -23,10 +24,10 @@ Contributor: Eurofins Digital Product Testing UK Limited """ import logging +from typing import Dict, List, Tuple -from typing import List, Dict, Tuple +from dpctf_qr_decoder import MezzanineDecodedQr, TestStatusDecodedQr from global_configurations import GlobalConfigurations -from dpctf_qr_decoder import TestStatusDecodedQr logger = logging.getLogger(__name__) @@ -46,7 +47,7 @@ class Observation: """ missing_frame_threshold: int """Threshold of missing frame. - If the number of missing frames on an individual test is greater than this + If the number of missing frames on an individual test is greater than this post error messege and terminate the session. """ @@ -62,28 +63,33 @@ def __init__(self, name: str, global_configurations: GlobalConfigurations = None self.missing_frame_threshold = 0 else: self.tolerances = global_configurations.get_tolerances() - self.missing_frame_threshold = global_configurations.get_missing_frame_threshold() + self.missing_frame_threshold = ( + global_configurations.get_missing_frame_threshold() + ) @staticmethod - def _get_play_event( + def _find_event( + event: str, test_status_qr_codes: List[TestStatusDecodedQr], camera_frame_duration_ms: float, ) -> (Tuple[bool, float]): - """loop through event qr code to find 1st playing play event + """loop through event qr code to find 1st event Args: + event: 1st event string to find test_status_qr_codes (List[TestStatusDecodedQr]): Test Status QR codes list containing currentTime as reported by MSE. camera_frame_duration_ms (float): duration of a camera frame on msecs. Returns: - (bool, float): True if the 1st play event is found, play_current_time from the 1st test runner play event. + (bool, float): True if the 1st event is found, + play_current_time from the 1st test runner event. """ for i in range(0, len(test_status_qr_codes)): current_status = test_status_qr_codes[i] # check for the 1st play action from TR events - if current_status.last_action == "play": + if current_status.last_action == event: play_event_camera_frame_num = current_status.camera_frame_num if i + 1 < len(test_status_qr_codes): @@ -96,3 +102,41 @@ def _get_play_event( break return False, 0 + + @staticmethod + def get_playback_change_position( + mezzanine_qr_codes: List[MezzanineDecodedQr], + ) -> List[int]: + """loop through the detected mezzanine list to save + playback change positions including content change + and playback switching + """ + current_content_id = mezzanine_qr_codes[0].content_id + current_frame_rate = mezzanine_qr_codes[0].frame_rate + change_starting_index_list = [0] + for i in range(1, len(mezzanine_qr_codes)): + if ( + mezzanine_qr_codes[i].content_id != current_content_id + or mezzanine_qr_codes[i].frame_rate != current_frame_rate + ): + # the content did change save the starting index + change_starting_index_list.append(i) + current_content_id = mezzanine_qr_codes[i].content_id + current_frame_rate = mezzanine_qr_codes[i].frame_rate + return change_starting_index_list + + @staticmethod + def get_content_change_position( + mezzanine_qr_codes: List[MezzanineDecodedQr], + ) -> List[int]: + """loop through the detected mezzanine list to save + content ID change positions + """ + current_content_id = mezzanine_qr_codes[0].content_id + change_starting_index_list = [0] + for i in range(1, len(mezzanine_qr_codes)): + if mezzanine_qr_codes[i].content_id != current_content_id: + # the content did change save the starting index + change_starting_index_list.append(i) + current_content_id = mezzanine_qr_codes[i].content_id + return change_starting_index_list diff --git a/observations/rendering_delay_within_threshold.py b/observations/rendering_delay_within_threshold.py new file mode 100644 index 0000000..a0a9fdf --- /dev/null +++ b/observations/rendering_delay_within_threshold.py @@ -0,0 +1,144 @@ +"""Observation rendering_delay_within_threshold + +Make observation of rendering + +The Software is provided to you by the Licensor under the License, as +defined below, subject to the following condition. + +Without limiting other conditions in the License, the grant of rights under +the License will not include, and the License does not grant to you, the +right to Sell the Software. + +For purposes of the foregoing, “Sell” means practicing any or all of the +rights granted to you under the License to provide to third parties, for a +fee or other consideration (including without limitation fees for hosting +or consulting/ support services related to the Software), a product or +service whose value derives, entirely or substantially, from the +functionality of the Software. Any license notice or attribution required +by the License must also include this Commons Clause License Condition +notice. + +Software: WAVE Observation Framework +License: Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0.txt +Licensor: Consumer Technology Association +Contributor: Eurofins Digital Product Testing UK Limited +""" +import logging +from typing import Dict, List, Tuple + +from dpctf_qr_decoder import MezzanineDecodedQr, TestStatusDecodedQr + +from .observation import Observation + +FIRST_FRAME_APPLIED_EVNT = "appended" + +logger = logging.getLogger(__name__) + + +class RenderingDelayWithinThreshold(Observation): + """RenderingDelayWithinThreshold class + The rendering delay is the time between successful appending of the first + CMAF fragment and the first media sample is visible or audible . + """ + + def __init__(self, _): + super().__init__( + "[OF] Measure the time between the successful appending of the first CMAF fragment " + "and the first media sample is visible or audible. " + "This value shall be compared against render_threshold." + ) + + @staticmethod + def _get_frame_applied_event( + test_status_qr_codes: List[TestStatusDecodedQr], camera_frame_duration_ms: float + ) -> (Tuple[bool, float]): + """loop through event qr code to find 1st FIRST_FRAME_APPLIED_EVNT event + + Args: + test_status_qr_codes (List[TestStatusDecodedQr]): Test Status QR codes list containing + currentTime as reported by MSE. + camera_frame_duration_ms (float): duration of a camera frame on msecs. + + Returns: + (bool, float): True if the 1st FIRST_FRAME_APPLIED_EVNT is found + event_current_time: current time of the 1st test runner FIRST_FRAME_APPLIED_EVNT event. + """ + for i in range(0, len(test_status_qr_codes)): + current_status = test_status_qr_codes[i] + # check for the 1st "appended" action from TR events + if current_status.status == FIRST_FRAME_APPLIED_EVNT: + event_camera_frame_num = current_status.camera_frame_num + if i + 1 < len(test_status_qr_codes): + next_status = test_status_qr_codes[i + 1] + previous_qr_generation_delay = next_status.delay + event_current_time = ( + event_camera_frame_num * camera_frame_duration_ms + ) - previous_qr_generation_delay + return True, event_current_time + break + + return False, 0 + + def make_observation( + self, + _unused, + mezzanine_qr_codes: List[MezzanineDecodedQr], + test_status_qr_codes: List[TestStatusDecodedQr], + parameters_dict: dict, + _unused2, + ) -> Dict[str, str]: + """Implements the logic: + render_delay = (QRa.first_camera_frame_num * camera_frame_duration_ms) + - ((event.camera_frame_num * camera_frame_duration_ms) - d) + render_delay < render_threshold + + Args: + _unused: + mezzanine_qr_codes: detected QR codes list from Mezzanine + test_status_qr_codes: detected QR codes list from test runner + parameters_dict: parameters are from test runner config file + and some are generated from OF + + Returns: + Result status and message. + """ + logger.info(f"Making observation {self.result['name']}...") + if len(mezzanine_qr_codes) < 2: + self.result["status"] = "FAIL" + self.result[ + "message" + ] = f"Too few mezzanine QR codes detected ({len(mezzanine_qr_codes)})." + logger.info(f"[{self.result['status']}] {self.result['message']}") + return self.result + + render_threshold = parameters_dict["render_threshold"] + camera_frame_duration_ms = parameters_dict["camera_frame_duration_ms"] + + event_found, event_ct = RenderingDelayWithinThreshold._get_frame_applied_event( + test_status_qr_codes, camera_frame_duration_ms + ) + + first_mezzanine_frame_time = ( + mezzanine_qr_codes[0].first_camera_frame_num * camera_frame_duration_ms + ) + if not event_found: + self.result["status"] = "FAIL" + self.result[ + "message" + ] = f"'{FIRST_FRAME_APPLIED_EVNT}' event was not found." + else: + render_delay = first_mezzanine_frame_time - event_ct + self.result["message"] = ( + f"Maximum permitted rendering delay is {render_threshold}ms." + f"The presentation rendering delay is {round(render_delay, 4)}ms" + ) + if render_delay < render_threshold: + self.result["status"] = "PASS" + elif render_delay < 0: + self.resuly["status"] = "FAIL" + self.result["message"] = f"{render_delay} is negative" + else: + self.result["status"] = "FAIL" + + logger.debug(f"[{self.result['status']}] {self.result['message']}") + return self.result diff --git a/observations/sample_matches_current_time.py b/observations/sample_matches_current_time.py index 2f0fdc2..bf9a0af 100644 --- a/observations/sample_matches_current_time.py +++ b/observations/sample_matches_current_time.py @@ -24,15 +24,16 @@ Licensor: Consumer Technology Association Contributor: Eurofins Digital Product Testing UK Limited """ +import csv import logging import sys -import csv +from typing import Dict, List, Tuple -from .observation import Observation -from typing import List, Dict, Tuple +from configuration_parser import PlayoutParser from dpctf_qr_decoder import MezzanineDecodedQr, TestStatusDecodedQr from test_code.test import TestType -from configuration_parser import PlayoutParser + +from .observation import Observation logger = logging.getLogger(__name__) @@ -63,7 +64,7 @@ def _get_target_camera_frame_num( camera_frame_duration_ms: float, camera_frame_rate: float, mezzanine_qr_codes: List[MezzanineDecodedQr], - ct_frame_tolerance: int + ct_frame_tolerance: int, ) -> (Tuple[float, float]): """Calculate expected target camera frame numbers of the current time event by compensating for the delay in the QR code generation and applying tolerances. @@ -89,7 +90,9 @@ def _get_target_camera_frame_num( mezzanine_frame_rate = mezzanine_qr_codes[i - 1].frame_rate break - sample_tolerance_in_recording = ct_frame_tolerance * camera_frame_rate / mezzanine_frame_rate + sample_tolerance_in_recording = ( + ct_frame_tolerance * camera_frame_rate / mezzanine_frame_rate + ) first_possible = ( target_camera_frame_num - CAMERA_FRAME_ADJUSTMENT @@ -110,7 +113,7 @@ def _find_diff_within_tolerance( first_possible: float, last_possible: float, allowed_tolerance: float, - ct_frame_tolerance: int + ct_frame_tolerance: int, ) -> (Tuple[bool, float]): """Applies the logic: for first_possible_camera_frame_num_of_target to last_possible_camera_frame_num_of_target @@ -144,7 +147,10 @@ def _find_diff_within_tolerance( if new_time_diff < time_diff: time_diff = new_time_diff - if time_diff <= allowed_tolerance + ct_frame_tolerance * 1000 / code.frame_rate: + if ( + time_diff + <= allowed_tolerance + ct_frame_tolerance * 1000 / code.frame_rate + ): diff_found = True break @@ -154,8 +160,7 @@ def _find_diff_within_tolerance( def _write_time_differences( time_diff_file: str, time_differences: List[Tuple[int, int]] ): - """export time differences to csv file - """ + """export time differences to csv file""" logger.debug(f"Exporting time differences to csv file {time_diff_file}...") with open(time_diff_file, "a") as csvfile: @@ -203,7 +208,11 @@ def make_observation( allowed_tolerance = parameters_dict["tolerance"] ct_frame_tolerance = parameters_dict["frame_tolerance"] failure_report_count = 0 - self.result["message"] += f" Allowed tolerance is {ct_frame_tolerance} frames, {allowed_tolerance}ms." + self.result[ + "message" + ] += ( + f" Allowed tolerance is {ct_frame_tolerance} frames, {allowed_tolerance}ms." + ) # for splicing test adjust media time in mezzanine_qr_codes # media time for period 2 starts from 0 so the actual media time is += period_duration[0] @@ -211,30 +220,35 @@ def make_observation( # so the actual media time is += period_duration[1] if test_type == TestType.SPLICING: period_list = PlayoutParser.get_splicing_period_list( - parameters_dict["playout"], parameters_dict["fragment_duration_multi_mpd"] + parameters_dict["playout"], + parameters_dict["fragment_duration_multi_mpd"], + ) + change_type_list = PlayoutParser.get_change_type_list( + parameters_dict["playout"] ) - change_type_list = PlayoutParser.get_change_type_list(parameters_dict["playout"]) period_index = 0 change_count = 0 current_content_id = mezzanine_qr_codes[0].content_id current_frame_rate = mezzanine_qr_codes[0].frame_rate for i in range(1, len(mezzanine_qr_codes)): - if (mezzanine_qr_codes[i].content_id != current_content_id or - mezzanine_qr_codes[i].frame_rate != current_frame_rate): + if ( + mezzanine_qr_codes[i].content_id != current_content_id + or mezzanine_qr_codes[i].frame_rate != current_frame_rate + ): # the content did change change_count += 1 current_content_id = mezzanine_qr_codes[i].content_id current_frame_rate = mezzanine_qr_codes[i].frame_rate - if change_type_list[change_count-1] == "splicing": + if change_type_list[change_count - 1] == "splicing": period_index += 1 if period_index > 0: mezzanine_qr_codes[i].media_time += period_list[period_index - 1] time_differences = [] - + for i in range(0, len(test_status_qr_codes)): current_status = test_status_qr_codes[i] if i + 1 < len(test_status_qr_codes): @@ -242,24 +256,31 @@ def make_observation( current_status.status == "playing" and current_status.last_action == "play" ): + if "render_threshold" in parameters_dict: + # skip the ct=0.0 check for low_latency_initialization test + # 1st frame wont be rendered until chunk is appended + if current_status.current_time == 0.0: + continue first_possible, last_possible = self._get_target_camera_frame_num( - current_status.camera_frame_num, - test_status_qr_codes[i + 1].delay, - camera_frame_duration_ms, - camera_frame_rate, - mezzanine_qr_codes, - ct_frame_tolerance - ) + current_status.camera_frame_num, + test_status_qr_codes[i + 1].delay, + camera_frame_duration_ms, + camera_frame_rate, + mezzanine_qr_codes, + ct_frame_tolerance, + ) diff_found, time_diff = self._find_diff_within_tolerance( mezzanine_qr_codes, current_status, first_possible, last_possible, allowed_tolerance, - ct_frame_tolerance + ct_frame_tolerance, ) # The multiplication happens so that we get the results in ms - time_differences.append((current_status.current_time * 1000, time_diff)) + time_differences.append( + (current_status.current_time * 1000, time_diff) + ) if not diff_found: self.result["status"] = "FAIL" diff --git a/observations/start_up_delay.py b/observations/start_up_delay.py index 24710af..dcfbffb 100644 --- a/observations/start_up_delay.py +++ b/observations/start_up_delay.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +# pylint: disable=import-error """Observation start_up_delay Make observation of start_up_delay @@ -25,11 +26,11 @@ Contributor: Eurofins Digital Product Testing UK Limited """ import logging +from typing import Dict, List -from .observation import Observation -from typing import List, Dict from dpctf_qr_decoder import MezzanineDecodedQr, TestStatusDecodedQr - +from test_code.test import TestType +from .observation import Observation logger = logging.getLogger(__name__) @@ -46,7 +47,7 @@ def __init__(self, _): def make_observation( self, - _unused, + test_type, mezzanine_qr_codes: List[MezzanineDecodedQr], test_status_qr_codes: List[TestStatusDecodedQr], parameters_dict: dict, @@ -58,14 +59,19 @@ def make_observation( start_up_delay < TSMax Args: - _unused: + test_type: defined in test.py mezzanine_qr_codes: detected QR codes list from Mezzanine test_status_qr_codes: detected QR codes list from test runner - parameters_dict: parameters are from test runner config file and some are generated from OF + parameters_dict: parameters are from test runner config file + and some are generated from OF Returns: Result status and message. """ + if test_type == TestType.TRUNCATED: + self.result["name"] = self.result["name"].replace( + "The start-up delay", "The start-up delay for second presentation" + ) logger.info(f"Making observation {self.result['name']}...") if len(mezzanine_qr_codes) < 2: @@ -79,8 +85,26 @@ def make_observation( max_permitted_startup_delay_ms = parameters_dict["ts_max"] camera_frame_duration_ms = parameters_dict["camera_frame_duration_ms"] - event_found, play_ct = Observation._get_play_event( - test_status_qr_codes, camera_frame_duration_ms + if test_type == TestType.TRUNCATED: + # check presentation changes twice + content_starting_index_list = Observation.get_content_change_position( + mezzanine_qr_codes + ) + if len(content_starting_index_list) != 2: + self.result["message"] += ( + f"Truncated test should change presentatation once. " + f"Actual presentatation change is {len(content_starting_index_list)}. " + ) + return False + + # only check the 2nd presentation start up delay + mezzanine_qr_codes = mezzanine_qr_codes[content_starting_index_list[1] :] + event = "representation_change" + else: + event = "play" + + event_found, event_ct = Observation._find_event( + event, test_status_qr_codes, camera_frame_duration_ms ) frame_change_found = False @@ -88,23 +112,21 @@ def make_observation( frame_ct = ( mezzanine_qr_code.first_camera_frame_num * camera_frame_duration_ms ) - if frame_ct > play_ct: + if frame_ct > event_ct: frame_change_found = True break - + if not event_found: self.result["status"] = "FAIL" self.result["message"] = ( - f"A test status QR code with first 'play' last_action " - f"followed by a further test status QR code was not found." + f"A test status QR code with first '{event}' last_action " + "followed by a further test status QR code was not found." ) elif not frame_change_found: self.result["status"] = "FAIL" - self.result["message"] = ( - f"No frame change detected after 'play'." - ) + self.result["message"] = f"No frame change detected after '{event}'." else: - start_up_delay = frame_ct - play_ct + start_up_delay = frame_ct - event_ct self.result["message"] = ( f"Maximum permitted startup delay is {max_permitted_startup_delay_ms}ms." f"The presentation start up delay is {round(start_up_delay, 4)}ms" diff --git a/of_testname_map.json b/of_testname_map.json index 85de0f0..9a2a690 100644 --- a/of_testname_map.json +++ b/of_testname_map.json @@ -62,5 +62,45 @@ "splicing-of-wave-program-with-baseline-constraints.html": [ "splicing_of_wave_program_with_baseline_constraints", "SplicingOfWaveProgramWithBaselineConstraints" + ], + "source-buffer-re-initialization-without-changetype.html":[ + "source_buffer_re_initialization_without_changetype", + "SourceBufferReInitializationWithoutChangetype" + ], + "mse-appendwindow.html":[ + "mse_append_window", + "MseAppendWindow" + ], + "source-buffer-re-initialization-with-changetype.html":[ + "source_buffer_re_initialization_with_changetype", + "SourceBufferReInitializationWithChangetype" + ], + "buffer-underrun-and-recovery.html": [ + "buffer_underrun_and_recovery", + "BufferUnderrunAndRecovery" + ], + "random-access-from-one-place-in-a-stream-to-a-different-place-in-the-same-stream.html":[ + "random_access_from_one_place_in_a_stream_to_a_different_place_in_the_same_stream", + "RandomAccessFromOnePlaceInAStreamToADifferentPlaceInTheSameStream" + ], + "truncated-playback-and-restart.html":[ + "truncated_playback_and_restart", + "TruncatedPlaybackAndRestart" + ], + "low-latency-initialization.html" : [ + "low_latency_initialization", + "LowLatencyInitialization" + ], + "low-latency-playback-over-gaps.html" : [ + "low_latency_playback_over_gaps", + "LowLatencyPlaybackOverGaps" + ], + "low-latency-short-buffer-playback.html" : [ + "buffer_underrun_and_recovery", + "BufferUnderrunAndRecovery" + ], + "long-duration-playback.html":[ + "long_duration_playback", + "LongDurationPlayback" ] } \ No newline at end of file diff --git a/qr_recognition/__init__.py b/qr_recognition/__init__.py index 35c2823..dd8ef32 100644 --- a/qr_recognition/__init__.py +++ b/qr_recognition/__init__.py @@ -19,4 +19,4 @@ License: Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0.txt Licensor: Consumer Technology Association Contributor: Eurofins Digital Product Testing UK Limited -""" \ No newline at end of file +""" diff --git a/qr_recognition/qr_recognition.py b/qr_recognition/qr_recognition.py index acaef30..4995659 100644 --- a/qr_recognition/qr_recognition.py +++ b/qr_recognition/qr_recognition.py @@ -24,15 +24,15 @@ Licensor: Consumer Technology Association Contributor: Eurofins Digital Product Testing UK Limited """ -import cv2 import logging +from typing import Any, List + +import cv2 import numpy as np +from pyzbar.pyzbar import ZBarSymbol, decode -from typing import Any, List -from pyzbar.pyzbar import decode, ZBarSymbol from .qr_decoder import DecodedQr, QrDecoder - logger = logging.getLogger(__name__) @@ -108,7 +108,7 @@ def full_scan( self, webcam_image: OpenCvImageHint, qr_code_areas: list, - do_adaptiveThreshold_scan: bool + do_adaptive_threshold_scan: bool, ) -> None: """Do a full scan of the specified webcam capture video frame.""" image = cv2.cvtColor(webcam_image, cv2.COLOR_BGR2GRAY) @@ -124,9 +124,8 @@ def full_scan( self.scan_cropped_image(image, qr_code_areas) # do adaptiveThreshold scan when it is defined to do so - if do_adaptiveThreshold_scan and not self.all_code_found(): + if do_adaptive_threshold_scan and not self.all_code_found(): thresholded_image = cv2.adaptiveThreshold( - image, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, - cv2.THRESH_BINARY, 11, 2 + image, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C, cv2.THRESH_BINARY, 11, 2 ) self._scan_image(thresholded_image) diff --git a/test_code/__init__.py b/test_code/__init__.py index 35c2823..dd8ef32 100644 --- a/test_code/__init__.py +++ b/test_code/__init__.py @@ -19,4 +19,4 @@ License: Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0.txt Licensor: Consumer Technology Association Contributor: Eurofins Digital Product Testing UK Limited -""" \ No newline at end of file +""" diff --git a/test_code/buffer_underrun_and_recovery.py b/test_code/buffer_underrun_and_recovery.py new file mode 100644 index 0000000..9e28648 --- /dev/null +++ b/test_code/buffer_underrun_and_recovery.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +"""DPCTF device observation test code buffer_underrun_and_recovery + +The Software is provided to you by the Licensor under the License, as +defined below, subject to the following condition. + +Without limiting other conditions in the License, the grant of rights under +the License will not include, and the License does not grant to you, the +right to Sell the Software. + +For purposes of the foregoing, “Sell” means practicing any or all of the +rights granted to you under the License to provide to third parties, for a +fee or other consideration (including without limitation fees for hosting +or consulting/ support services related to the Software), a product or +service whose value derives, entirely or substantially, from the +functionality of the Software. Any license notice or attribution required +by the License must also include this Commons Clause License Condition +notice. + +Software: WAVE Observation Framework +License: Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0.txt +Licensor: Consumer Technology Association +Contributor: Eurofins Digital Product Testing UK Limited +""" +import logging + +from .mse_append_window import MseAppendWindow +from .test import TestType + +logger = logging.getLogger(__name__) + + +class BufferUnderrunAndRecovery(MseAppendWindow): + """BufferUnderrunAndRecovery to handle test buffer_underrun_and_recovery.html + Derived from MseAppendWindow test code. Uses same logic. + """ + + def _set_test_type(self) -> None: + """set test type""" + self.test_type = TestType.WAITINGINPLAYBACK + + def _init_parameters(self) -> None: + self.parameters = [ + "tolerance", + "frame_tolerance", + "duration_tolerance", + "duration_frame_tolerance", + ] + self.content_parameters = ["cmaf_track_duration"] diff --git a/test_code/long_duration_playback.py b/test_code/long_duration_playback.py new file mode 100644 index 0000000..4806c55 --- /dev/null +++ b/test_code/long_duration_playback.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +"""DPCTF device observation test code long_duration_playback + +The Software is provided to you by the Licensor under the License, as +defined below, subject to the following condition. + +Without limiting other conditions in the License, the grant of rights under +the License will not include, and the License does not grant to you, the +right to Sell the Software. + +For purposes of the foregoing, “Sell” means practicing any or all of the +rights granted to you under the License to provide to third parties, for a +fee or other consideration (including without limitation fees for hosting +or consulting/ support services related to the Software), a product or +service whose value derives, entirely or substantially, from the +functionality of the Software. Any license notice or attribution required +by the License must also include this Commons Clause License Condition +notice. + +Software: WAVE Observation Framework +License: Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0.txt +Licensor: Consumer Technology Association +Contributor: Eurofins Digital Product Testing UK Limited +""" +import logging + +from .regular_playback_of_a_cmaf_presentation import \ + RegularPlaybackOfACmafPresentation + +logger = logging.getLogger(__name__) + + +class LongDurationPlayback(RegularPlaybackOfACmafPresentation): + """LongDurationPlayback to handle test long-duration-playback.html + Derived from RegularPlaybackOfACmafPresentation test code. + """ + + def _init_observations(self) -> None: + """initialise the observations required for the test""" + self.observations = [ + ( + "every_sample_rendered_in_cmaf_presentation", + "EverySampleRenderedInCMAFPresentation", + ), + ("duration_matches_cmaf_track", "DurationMatchesCMAFTrack"), + ("sample_matches_current_time", "SampleMatchesCurrentTime"), + ] diff --git a/test_code/low_latency_initialization.py b/test_code/low_latency_initialization.py new file mode 100644 index 0000000..1167f20 --- /dev/null +++ b/test_code/low_latency_initialization.py @@ -0,0 +1,55 @@ +"""DPCTF device observation test code low_latency_initialization + +The Software is provided to you by the Licensor under the License, as +defined below, subject to the following condition. + +Without limiting other conditions in the License, the grant of rights under +the License will not include, and the License does not grant to you, the +right to Sell the Software. + +For purposes of the foregoing, “Sell” means practicing any or all of the +rights granted to you under the License to provide to third parties, for a +fee or other consideration (including without limitation fees for hosting +or consulting/ support services related to the Software), a product or +service whose value derives, entirely or substantially, from the +functionality of the Software. Any license notice or attribution required +by the License must also include this Commons Clause License Condition +notice. + +Software: WAVE Observation Framework +License: Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0.txt +Licensor: Consumer Technology Association +Contributor: Eurofins Digital Product Testing UK Limited +""" +import logging + +from .mse_append_window import MseAppendWindow +from .test import TestType + +logger = logging.getLogger(__name__) + + +class LowLatencyInitialization(MseAppendWindow): + """LowLatencyInitialization to handle test low_latency_initialization.html + Derived from MseAppendWindow test code. Uses same logic. + """ + + def _init_parameters(self) -> None: + self.parameters = [ + "ts_max", + "tolerance", + "frame_tolerance", + "duration_tolerance", + "duration_frame_tolerance", + "render_threshold", + ] + self.content_parameters = ["cmaf_track_duration"] + + def _init_observations(self) -> None: + """initialise the observations required for the test""" + self.observations = [ + ("every_sample_rendered", "EverySampleRendered"), + ("duration_matches_cmaf_track", "DurationMatchesCMAFTrack"), + ("sample_matches_current_time", "SampleMatchesCurrentTime"), + ("rendering_delay_within_threshold", "RenderingDelayWithinThreshold"), + ] diff --git a/test_code/low_latency_playback_over_gaps.py b/test_code/low_latency_playback_over_gaps.py new file mode 100644 index 0000000..a476f8d --- /dev/null +++ b/test_code/low_latency_playback_over_gaps.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- +"""DPCTF device observation test code low_latency_playback_over_gaps + +The Software is provided to you by the Licensor under the License, as +defined below, subject to the following condition. + +Without limiting other conditions in the License, the grant of rights under +the License will not include, and the License does not grant to you, the +right to Sell the Software. + +For purposes of the foregoing, “Sell” means practicing any or all of the +rights granted to you under the License to provide to third parties, for a +fee or other consideration (including without limitation fees for hosting +or consulting/ support services related to the Software), a product or +service whose value derives, entirely or substantially, from the +functionality of the Software. Any license notice or attribution required +by the License must also include this Commons Clause License Condition +notice. + +Software: WAVE Observation Framework +License: Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0.txt +Licensor: Consumer Technology Association +Contributor: Eurofins Digital Product Testing UK Limited +""" +import logging +import math +from fractions import Fraction + +from .random_access_from_one_place_in_a_stream_to_a_different_place_in_the_same_stream import \ + RandomAccessFromOnePlaceInAStreamToADifferentPlaceInTheSameStream + +logger = logging.getLogger(__name__) + + +class LowLatencyPlaybackOverGaps( + RandomAccessFromOnePlaceInAStreamToADifferentPlaceInTheSameStream +): + """LowLatencyPlaybackOverGaps to handle test low_latency_playback_over_gaps.html + Derived from MseAppendWindow test code. Uses same logic. + """ + + def _init_parameters(self) -> None: + self.parameters = [ + "tolerance", + "frame_tolerance", + "duration_tolerance", + "duration_frame_tolerance", + "min_buffer_duration", + "gap_duration", + "playback_mode", + "stall_tolerance_margin", + ] + self.content_parameters = ["cmaf_track_duration", "fragment_duration"] + + def _get_gap_from_and_to_frames(self, frame_rate: Fraction) -> list: + """return gap from and to frames""" + gap_from = self.parameters_dict["min_buffer_duration"] + if "gap_duration" in self.parameters_dict: + gap_to = gap_from + self.parameters_dict["gap_duration"] / 1000 + else: + gap_to = gap_from + self.parameters_dict["fragment_duration"] / 1000 + gap_from_frame = math.floor(gap_from * frame_rate) + gap_to_frame = math.floor(gap_to * frame_rate) + 1 + return [gap_from_frame, gap_to_frame] + + def _get_expected_track_duration(self) -> float: + """return expected cmaf track duration""" + cmaf_track_duration_ms = self.parameters_dict["cmaf_track_duration"] + expected_track_duration = cmaf_track_duration_ms + if self.parameters_dict["playback_mode"] == "vod": + if "gap_duration" in self.parameters_dict: + expected_track_duration = ( + cmaf_track_duration_ms - self.parameters_dict["gap_duration"] + ) + else: + expected_track_duration = ( + cmaf_track_duration_ms - self.parameters_dict["fragment_duration"] + ) + return expected_track_duration diff --git a/test_code/mse_append_window.py b/test_code/mse_append_window.py new file mode 100644 index 0000000..cc2484f --- /dev/null +++ b/test_code/mse_append_window.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +"""DPCTF device observation test code mse_append_window + +The Software is provided to you by the Licensor under the License, as +defined below, subject to the following condition. + +Without limiting other conditions in the License, the grant of rights under +the License will not include, and the License does not grant to you, the +right to Sell the Software. + +For purposes of the foregoing, “Sell” means practicing any or all of the +rights granted to you under the License to provide to third parties, for a +fee or other consideration (including without limitation fees for hosting +or consulting/ support services related to the Software), a product or +service whose value derives, entirely or substantially, from the +functionality of the Software. Any license notice or attribution required +by the License must also include this Commons Clause License Condition +notice. + +Software: WAVE Observation Framework +License: Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0.txt +Licensor: Consumer Technology Association +Contributor: Eurofins Digital Product Testing UK Limited +""" +import logging + +from .sequential_track_playback import SequentialTrackPlayback + +logger = logging.getLogger(__name__) + + +class MseAppendWindow(SequentialTrackPlayback): + """MseAppendWindow to handle test mse_appendwindow.html + Derived from SequentialTrackPlayback test code. Uses same logic except + start_up_delay observation. + """ + + def _init_observations(self) -> None: + """initialise the observations required for the test""" + self.observations = [ + ("every_sample_rendered", "EverySampleRendered"), + ("duration_matches_cmaf_track", "DurationMatchesCMAFTrack"), + ("sample_matches_current_time", "SampleMatchesCurrentTime"), + ] diff --git a/test_code/playback_over_wave_baseline_splice_constraints.py b/test_code/playback_over_wave_baseline_splice_constraints.py index 344cd33..11913b2 100644 --- a/test_code/playback_over_wave_baseline_splice_constraints.py +++ b/test_code/playback_over_wave_baseline_splice_constraints.py @@ -27,6 +27,8 @@ """ import logging import math +from fractions import Fraction + from .sequential_track_playback import SequentialTrackPlayback from .test import TestType @@ -53,20 +55,23 @@ def _init_parameters(self) -> None: "frame_tolerance", "playout", "duration_tolerance", - "duration_frame_tolerance" - ] - self.content_parameters = [ - "fragment_duration_multi_mpd" + "duration_frame_tolerance", ] + self.content_parameters = ["fragment_duration_multi_mpd"] - def _get_last_frame_num(self, frame_rate: float) -> int: + def _get_last_frame_num(self, frame_rate: Fraction) -> int: """return last frame number this is calculated based on last track duration """ last_playout = self.parameters_dict["playout"][-1] - fragment_duration = self.parameters_dict["fragment_duration_multi_mpd"][(last_playout[0], last_playout[1])] + fragment_duration = self.parameters_dict["fragment_duration_multi_mpd"][ + (last_playout[0], last_playout[1]) + ] last_track_duration = fragment_duration * last_playout[2] - last_frame_num = math.floor(last_track_duration / 1000 * frame_rate) + half_duration_frame = (1000 / frame_rate) / 2 + last_frame_num = math.floor( + (last_track_duration + half_duration_frame) / 1000 * frame_rate + ) return last_frame_num def _get_expected_track_duration(self) -> float: @@ -75,6 +80,8 @@ def _get_expected_track_duration(self) -> float: """ cmaf_track_duration = 0 for playout in self.parameters_dict["playout"]: - fragment_duration = self.parameters_dict["fragment_duration_multi_mpd"][(playout[0], playout[1])] + fragment_duration = self.parameters_dict["fragment_duration_multi_mpd"][ + (playout[0], playout[1]) + ] cmaf_track_duration += fragment_duration return cmaf_track_duration diff --git a/test_code/random_access_from_one_place_in_a_stream_to_a_different_place_in_the_same_stream.py b/test_code/random_access_from_one_place_in_a_stream_to_a_different_place_in_the_same_stream.py new file mode 100644 index 0000000..dce1831 --- /dev/null +++ b/test_code/random_access_from_one_place_in_a_stream_to_a_different_place_in_the_same_stream.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- +"""DPCTF device observation test code random_access_from_one_place_in_a_stream_to_a_different_place_in_the_same_stream + +test random_access_from_one_place_in_a_stream_to_a_different_place_in_the_same_stream + +The Software is provided to you by the Licensor under the License, as +defined below, subject to the following condition. + +Without limiting other conditions in the License, the grant of rights under +the License will not include, and the License does not grant to you, the +right to Sell the Software. + +For purposes of the foregoing, “Sell” means practicing any or all of the +rights granted to you under the License to provide to third parties, for a +fee or other consideration (including without limitation fees for hosting +or consulting/ support services related to the Software), a product or +service whose value derives, entirely or substantially, from the +functionality of the Software. Any license notice or attribution required +by the License must also include this Commons Clause License Condition +notice. + +Software: WAVE Observation Framework +License: Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0.txt +Licensor: Consumer Technology Association +Contributor: Eurofins Digital Product Testing UK Limited +""" +import logging +import math +from fractions import Fraction + +from .mse_append_window import MseAppendWindow +from .test import TestType + +logger = logging.getLogger(__name__) + + +class RandomAccessFromOnePlaceInAStreamToADifferentPlaceInTheSameStream( + MseAppendWindow +): + + """RandomAccessFromOnePlaceInAStreamToADifferentPlaceInTheSameStream to handle + test random-access-from-one-place-in-a-stream-to-a-different-place-in-the-same-stream.html. + Derived from MseAppendWindow test code. Uses same logic except start frame and duration take + account of the random start point. + """ + + def _set_test_type(self) -> None: + """set test type""" + self.test_type = TestType.GAPSINPLAYBACK + + def _init_parameters(self) -> None: + self.parameters = [ + "tolerance", + "frame_tolerance", + "random_access_to", + "random_access_from", + "random_access_from_tolerance", + "duration_tolerance", + "duration_frame_tolerance", + ] + self.content_parameters = ["cmaf_track_duration"] + + def _get_gap_from_and_to_frames(self, frame_rate: Fraction) -> list: + """return gap from and to frames""" + random_access_from_frame = math.floor( + (self.parameters_dict["random_access_from"]) * frame_rate + ) + random_access_to_frame = ( + math.floor((self.parameters_dict["random_access_to"]) * frame_rate) + 1 + ) + return [random_access_from_frame, random_access_to_frame] + + def _get_expected_track_duration(self) -> float: + """return expected cmaf track duration""" + cmaf_track_duration_ms = self.parameters_dict["cmaf_track_duration"] + random_access_from_ms = self.parameters_dict["random_access_from"] * 1000 + random_access_to_ms = self.parameters_dict["random_access_to"] * 1000 + expected_track_duration = random_access_from_ms + ( + cmaf_track_duration_ms - random_access_to_ms + ) + return expected_track_duration diff --git a/test_code/random_access_of_a_wave_presentation.py b/test_code/random_access_of_a_wave_presentation.py index 822a212..96e06d1 100644 --- a/test_code/random_access_of_a_wave_presentation.py +++ b/test_code/random_access_of_a_wave_presentation.py @@ -25,10 +25,12 @@ Contributor: Eurofins Digital Product Testing UK Limited """ import logging + from .random_access_to_fragment import RandomAccessToFragment logger = logging.getLogger(__name__) + class RandomAccessOfAWavePresentation(RandomAccessToFragment): """RandomAccessOfAWavePresentation to handle test random-access-of-a-wave-presentation.html. Derived from RandomAccessToFragment test code. But different observations. @@ -37,7 +39,13 @@ class RandomAccessOfAWavePresentation(RandomAccessToFragment): def _init_observations(self) -> None: """initialise the observations required for the test""" self.observations = [ - ("every_sample_rendered_in_cmaf_presentation", "EverySampleRenderedInCMAFPresentation"), + ( + "every_sample_rendered_in_cmaf_presentation", + "EverySampleRenderedInCMAFPresentation", + ), ("duration_matches_cmaf_track", "DurationMatchesCMAFTrack"), - ("earliest_sample_same_presentation_time", "EarliestSampleSamePresentationTime"), + ( + "earliest_sample_same_presentation_time", + "EarliestSampleSamePresentationTime", + ), ] diff --git a/test_code/random_access_to_fragment.py b/test_code/random_access_to_fragment.py index e7bdf5c..0a27fd7 100644 --- a/test_code/random_access_to_fragment.py +++ b/test_code/random_access_to_fragment.py @@ -26,15 +26,19 @@ """ import logging import math +from fractions import Fraction + from .sequential_track_playback import SequentialTrackPlayback logger = logging.getLogger(__name__) + class RandomAccessToFragment(SequentialTrackPlayback): """RandomAccessToFragment to handle test random-access-to-fragment.html. Derived from SequentialTrackPlayback test code. Uses same logic except start frame and duration take account of the random start point. """ + def _init_parameters(self) -> None: self.parameters = [ "ts_max", @@ -42,28 +46,27 @@ def _init_parameters(self) -> None: "frame_tolerance", "random_access_fragment", "duration_tolerance", - "duration_frame_tolerance" - ] - self.content_parameters = [ - "cmaf_track_duration", - "fragment_duration" + "duration_frame_tolerance", ] + self.content_parameters = ["cmaf_track_duration", "fragment_duration"] - def _get_first_frame_num(self, frame_rate: float) -> int: - """return first frame number - """ + def _get_first_frame_num(self, frame_rate: Fraction) -> int: + """return first frame number""" random_access_fragment = self.parameters_dict["random_access_fragment"] fragment_duration_in_second = self.parameters_dict["fragment_duration"] / 1000 - first_frame_num = random_access_fragment * fragment_duration_in_second * frame_rate + 1 + first_frame_num = ( + random_access_fragment * fragment_duration_in_second * frame_rate + 1 + ) return math.floor(first_frame_num) def _get_expected_track_duration(self) -> float: - """return expected cmaf track duration - """ + """return expected cmaf track duration""" random_access_fragment = self.parameters_dict["random_access_fragment"] fragment_duration = self.parameters_dict["fragment_duration"] - cmaf_track_duration = self.parameters_dict["cmaf_track_duration"] - expected_track_duration = cmaf_track_duration - random_access_fragment * fragment_duration + cmaf_track_duration = self.parameters_dict["cmaf_track_duration"] + expected_track_duration = ( + cmaf_track_duration - random_access_fragment * fragment_duration + ) - return expected_track_duration \ No newline at end of file + return expected_track_duration diff --git a/test_code/random_access_to_time.py b/test_code/random_access_to_time.py index 5241a6e..45f5d7c 100644 --- a/test_code/random_access_to_time.py +++ b/test_code/random_access_to_time.py @@ -26,6 +26,8 @@ """ import logging import math +from fractions import Fraction + from .sequential_track_playback import SequentialTrackPlayback logger = logging.getLogger(__name__) @@ -44,13 +46,11 @@ def _init_parameters(self) -> None: "frame_tolerance", "random_access_time", "duration_tolerance", - "duration_frame_tolerance" - ] - self.content_parameters = [ - "cmaf_track_duration" + "duration_frame_tolerance", ] + self.content_parameters = ["cmaf_track_duration"] - def _get_first_frame_num(self, frame_rate: float) -> int: + def _get_first_frame_num(self, frame_rate: Fraction) -> int: """return first frame number""" random_access_time = self.parameters_dict["random_access_time"] first_frame_num = math.floor(random_access_time * frame_rate) diff --git a/test_code/regular_playback_of_a_cmaf_presentation.py b/test_code/regular_playback_of_a_cmaf_presentation.py index edd49cc..e617687 100644 --- a/test_code/regular_playback_of_a_cmaf_presentation.py +++ b/test_code/regular_playback_of_a_cmaf_presentation.py @@ -25,6 +25,7 @@ Contributor: Eurofins Digital Product Testing UK Limited """ import logging + from .sequential_track_playback import SequentialTrackPlayback logger = logging.getLogger(__name__) @@ -38,7 +39,13 @@ class RegularPlaybackOfACmafPresentation(SequentialTrackPlayback): def _init_observations(self) -> None: """initialise the observations required for the test""" self.observations = [ - ("every_sample_rendered_in_cmaf_presentation", "EverySampleRenderedInCMAFPresentation"), + ( + "every_sample_rendered_in_cmaf_presentation", + "EverySampleRenderedInCMAFPresentation", + ), ("duration_matches_cmaf_track", "DurationMatchesCMAFTrack"), - ("earliest_sample_same_presentation_time", "EarliestSampleSamePresentationTime"), + ( + "earliest_sample_same_presentation_time", + "EarliestSampleSamePresentationTime", + ), ] diff --git a/test_code/sequential_track_playback.py b/test_code/sequential_track_playback.py index ab091bd..40073b5 100644 --- a/test_code/sequential_track_playback.py +++ b/test_code/sequential_track_playback.py @@ -27,19 +27,20 @@ import importlib import logging import math +from typing import List +from fractions import Fraction -from .test import TestType -from typing import List, Optional from configuration_parser import ConfigurationParser -from global_configurations import GlobalConfigurations from dpctf_qr_decoder import MezzanineDecodedQr, TestStatusDecodedQr +from global_configurations import GlobalConfigurations +from .test import TestType logger = logging.getLogger(__name__) class SequentialTrackPlayback: - """SequentialTrackPlayback to handle test + """SequentialTrackPlayback to handle test sequential-track-playback.html regular-playback-of-chunked-content.html regular-playback-of-chunked-content-non-aligned-append.html @@ -87,7 +88,7 @@ def __init__( self.global_configurations = global_configurations self.parameters_dict["camera_frame_rate"] = camera_frame_rate self.parameters_dict["camera_frame_duration_ms"] = camera_frame_duration_ms - + def _set_test_type(self) -> None: """set test type SEQUENTIAL|SWITCHING|SPLICING""" self.test_type = TestType.SEQUENTIAL @@ -108,11 +109,9 @@ def _init_parameters(self) -> None: "tolerance", "frame_tolerance", "duration_tolerance", - "duration_frame_tolerance" - ] - self.content_parameters = [ - "cmaf_track_duration" + "duration_frame_tolerance", ] + self.content_parameters = ["cmaf_track_duration"] def _load_parameters_dict( self, configuration_parser: ConfigurationParser, test_path: str, test_code: str @@ -130,13 +129,21 @@ def _load_parameters_dict( ) ) - def _get_first_frame_num(self, _) -> int: + def _get_first_frame_num(self, _frame_rate: Fraction) -> int: """return first frame number""" return 1 - def _get_last_frame_num(self, frame_rate: float) -> int: + def _get_last_frame_num(self, frame_rate: Fraction) -> int: """return last frame number""" - return math.floor(self.parameters_dict["cmaf_track_duration"] / 1000 * frame_rate) + half_duration_frame = (1000 / frame_rate) / 2 + return math.floor( + (self.parameters_dict["cmaf_track_duration"] + half_duration_frame) + / 1000 * frame_rate + ) + + def _get_gap_from_and_to_frames(self, _frame_rate: Fraction): + """return gap from and to frames""" + return [] def _get_expected_track_duration(self) -> float: """return expected track duration""" @@ -159,6 +166,16 @@ def make_observations( """ results = [] + frame_rate = mezzanine_qr_codes[-1].frame_rate + self.parameters_dict["first_frame_num"] = self._get_first_frame_num(frame_rate) + self.parameters_dict["last_frame_num"] = self._get_last_frame_num(frame_rate) + self.parameters_dict[ + "expected_track_duration" + ] = self._get_expected_track_duration() + self.parameters_dict[ + "gap_from_and_to_frames" + ] = self._get_gap_from_and_to_frames(frame_rate) + for observation in self.observations: # create instance of the relevant observation class observation_class = getattr( @@ -166,17 +183,6 @@ def make_observations( observation[1], )(self.global_configurations) - frame_rate = mezzanine_qr_codes[-1].frame_rate - self.parameters_dict["first_frame_num"] = self._get_first_frame_num( - frame_rate - ) - self.parameters_dict["last_frame_num"] = self._get_last_frame_num( - frame_rate - ) - self.parameters_dict[ - "expected_track_duration" - ] = self._get_expected_track_duration() - result = observation_class.make_observation( self.test_type, mezzanine_qr_codes, diff --git a/test_code/source_buffer_re_initialization_with_changetype.py b/test_code/source_buffer_re_initialization_with_changetype.py new file mode 100644 index 0000000..0426f99 --- /dev/null +++ b/test_code/source_buffer_re_initialization_with_changetype.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- + +""" +DPCTF device observation test code source-buffer-re-initialization-with-changetype + +The Software is provided to you by the Licensor under the License, as +defined below, subject to the following condition. + +Without limiting other conditions in the License, the grant of rights under +the License will not include, and the License does not grant to you, the +right to Sell the Software. + +For purposes of the foregoing, “Sell” means practicing any or all of the +rights granted to you under the License to provide to third parties, for a +fee or other consideration (including without limitation fees for hosting +or consulting/ support services related to the Software), a product or +service whose value derives, entirely or substantially, from the +functionality of the Software. Any license notice or attribution required +by the License must also include this Commons Clause License Condition +notice. + +Software: WAVE Observation Framework +License: Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0.txt +Licensor: Consumer Technology Association +Contributor: Eurofins Digital Product Testing UK Limited +""" + +import logging + +from .source_buffer_re_initialization_without_changetype import \ + SourceBufferReInitializationWithoutChangetype + +logger = logging.getLogger(__name__) + + +class SourceBufferReInitializationWithChangetype( + SourceBufferReInitializationWithoutChangetype +): + def _init_parameters(self) -> None: + """initialise the test_config_parameters required for the test""" + self.parameters = [ + "tolerance", + "frame_tolerance", + "duration_tolerance", + "duration_frame_tolerance", + "playout", + ] diff --git a/test_code/source_buffer_re_initialization_without_changetype.py b/test_code/source_buffer_re_initialization_without_changetype.py new file mode 100644 index 0000000..3faea46 --- /dev/null +++ b/test_code/source_buffer_re_initialization_without_changetype.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- +""" +DPCTF device observation test code source-buffer-re-initialization-without-changetype + +The Software is provided to you by the Licensor under the License, as +defined below, subject to the following condition. + +Without limiting other conditions in the License, the grant of rights under +the License will not include, and the License does not grant to you, the +right to Sell the Software. + +For purposes of the foregoing, “Sell” means practicing any or all of the +rights granted to you under the License to provide to third parties, for a +fee or other consideration (including without limitation fees for hosting +or consulting/ support services related to the Software), a product or +service whose value derives, entirely or substantially, from the +functionality of the Software. Any license notice or attribution required +by the License must also include this Commons Clause License Condition +notice. + +Software: WAVE Observation Framework +License: Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0.txt +Licensor: Consumer Technology Association +Contributor: Eurofins Digital Product Testing UK Limited +""" + +import logging +import math +from fractions import Fraction + +from .mse_append_window import MseAppendWindow +from .test import TestType + +logger = logging.getLogger(__name__) + + +class SourceBufferReInitializationWithoutChangetype(MseAppendWindow): + def _set_test_type(self) -> None: + """set test type SEQUENTIAL|SWITCHING|SPLICING""" + self.test_type = TestType.SPLICING + + def _init_parameters(self) -> None: + """initialise the test_config_parameters required for the test""" + self.parameters = [ + "mse_reset_tolerance", + "tolerance", + "frame_tolerance", + "duration_tolerance", + "duration_frame_tolerance", + "playout", + ] + self.content_parameters = ["fragment_duration_multi_mpd"] + + def _get_last_frame_num(self, frame_rate: Fraction) -> int: + """return last frame number + this is calculated based on last track duration + """ + last_playout = self.parameters_dict["playout"][-1] + fragment_duration = self.parameters_dict["fragment_duration_multi_mpd"][ + (last_playout[0], last_playout[1]) + ] + last_track_duration = fragment_duration * last_playout[2] + half_duration_frame = (1000 / frame_rate) / 2 + last_frame_num = math.floor( + (last_track_duration + half_duration_frame) / 1000 * frame_rate + ) + return last_frame_num + + def _get_expected_track_duration(self) -> float: + """return expected CMAF duration + for splicing test this is sum of all fragment duration from the playout + """ + cmaf_track_duration = 0 + for playout in self.parameters_dict["playout"]: + fragment_duration = self.parameters_dict["fragment_duration_multi_mpd"][ + (playout[0], playout[1]) + ] + cmaf_track_duration += fragment_duration + return cmaf_track_duration diff --git a/test_code/splicing_of_wave_program_with_baseline_constraints.py b/test_code/splicing_of_wave_program_with_baseline_constraints.py index 94f9027..bbf281a 100644 --- a/test_code/splicing_of_wave_program_with_baseline_constraints.py +++ b/test_code/splicing_of_wave_program_with_baseline_constraints.py @@ -26,13 +26,17 @@ Contributor: Eurofins Digital Product Testing UK Limited """ import logging -from .playback_over_wave_baseline_splice_constraints import PlaybackOverWaveBaselineSpliceConstraints + +from .playback_over_wave_baseline_splice_constraints import \ + PlaybackOverWaveBaselineSpliceConstraints logger = logging.getLogger(__name__) -class SplicingOfWaveProgramWithBaselineConstraints(PlaybackOverWaveBaselineSpliceConstraints): - """SplicingOfWaveProgramWithBaselineConstraints to handle test +class SplicingOfWaveProgramWithBaselineConstraints( + PlaybackOverWaveBaselineSpliceConstraints +): + """SplicingOfWaveProgramWithBaselineConstraints to handle test splicing-of-wave-program-with-baseline-constraints.html. This class is derived from PlaybackOverWaveBaselineSpliceConstraints and uses the same observations logic. """ @@ -40,7 +44,13 @@ class SplicingOfWaveProgramWithBaselineConstraints(PlaybackOverWaveBaselineSplic def _init_observations(self) -> None: """initialise the observations required for the test""" self.observations = [ - ("every_sample_rendered_in_cmaf_presentation", "EverySampleRenderedInCMAFPresentation"), + ( + "every_sample_rendered_in_cmaf_presentation", + "EverySampleRenderedInCMAFPresentation", + ), ("duration_matches_cmaf_track", "DurationMatchesCMAFTrack"), - ("earliest_sample_same_presentation_time", "EarliestSampleSamePresentationTime"), + ( + "earliest_sample_same_presentation_time", + "EarliestSampleSamePresentationTime", + ), ] diff --git a/test_code/switching_set_playback.py b/test_code/switching_set_playback.py index eb86560..5b81cda 100644 --- a/test_code/switching_set_playback.py +++ b/test_code/switching_set_playback.py @@ -25,6 +25,7 @@ Contributor: Eurofins Digital Product Testing UK Limited """ import logging + from .sequential_track_playback import SequentialTrackPlayback from .test import TestType @@ -50,9 +51,6 @@ def _init_parameters(self) -> None: "frame_tolerance", "playout", "duration_tolerance", - "duration_frame_tolerance" + "duration_frame_tolerance", ] - self.content_parameters = [ - "cmaf_track_duration", - "fragment_duration_list" - ] \ No newline at end of file + self.content_parameters = ["cmaf_track_duration", "fragment_duration_list"] diff --git a/test_code/test.py b/test_code/test.py index 8345342..fd3ee6c 100644 --- a/test_code/test.py +++ b/test_code/test.py @@ -30,9 +30,14 @@ class TestType(Enum): SEQUENTIAL: general playback test with contents played back from starting point to the end. SWITCHING: switching test that contents switches between representations. SPLICING: splicing test which is concatenates different content at any point during the playback. + GAPSINPLAYBACK: playback test which contents played back with some gaps between start to end. + WAITINGINPLAYBACK: playback test which contents waiting time in playback but no gaps in frames. The original content may then be returned to (such as an advert insertion test). """ SEQUENTIAL = 1 SWITCHING = 2 SPLICING = 3 + GAPSINPLAYBACK = 4 + WAITINGINPLAYBACK = 5 + TRUNCATED = 6 diff --git a/test_code/truncated_playback_and_restart.py b/test_code/truncated_playback_and_restart.py new file mode 100644 index 0000000..8c7af44 --- /dev/null +++ b/test_code/truncated_playback_and_restart.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +"""DPCTF device observation test code truncated_playback_and_restart + +The Software is provided to you by the Licensor under the License, as +defined below, subject to the following condition. + +Without limiting other conditions in the License, the grant of rights under +the License will not include, and the License does not grant to you, the +right to Sell the Software. + +For purposes of the foregoing, “Sell” means practicing any or all of the +rights granted to you under the License to provide to third parties, for a +fee or other consideration (including without limitation fees for hosting +or consulting/ support services related to the Software), a product or +service whose value derives, entirely or substantially, from the +functionality of the Software. Any license notice or attribution required +by the License must also include this Commons Clause License Condition +notice. + +Software: WAVE Observation Framework +License: Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0.txt +Licensor: Consumer Technology Association +Contributor: Eurofins Digital Product Testing UK Limited +""" +import logging +import math +from fractions import Fraction + +from .sequential_track_playback import SequentialTrackPlayback +from .test import TestType + +logger = logging.getLogger(__name__) + + +class TruncatedPlaybackAndRestart(SequentialTrackPlayback): + """TruncatedPlaybackAndRestart to handle test truncated-playback-and-restart.html + Derived from SequentialTrackPlayback test code. + """ + + def _set_test_type(self) -> None: + """set test type""" + self.test_type = TestType.TRUNCATED + + def _init_parameters(self) -> None: + self.parameters = [ + "ts_max", + "tolerance", + "frame_tolerance", + "duration_tolerance", + "duration_frame_tolerance", + "playout", + "second_playout", + "second_playout_switching_time", + ] + self.content_parameters = ["fragment_duration_multi_mpd"] + + def _get_last_frame_num(self, frame_rate: Fraction) -> int: + """return last frame number + this is calculated based on last track duration + """ + last_playout = self.parameters_dict["second_playout"][-1] + fragment_duration = self.parameters_dict["fragment_duration_multi_mpd"][ + (last_playout[0], last_playout[1]) + ] + last_track_duration = fragment_duration * last_playout[2] + half_duration_frame = (1000 / frame_rate) / 2 + last_frame_num = math.floor( + (last_track_duration + half_duration_frame) / 1000 * frame_rate + ) + return last_frame_num + + def _get_expected_track_duration(self) -> float: + """return expected CMAF duration + first representation duration is second_playout_switching_time + second representation duration is sum of all fragment duration from the second_playout + """ + cmaf_track_durations = [] + cmaf_track_durations.append( + self.parameters_dict["second_playout_switching_time"] * 1000 + ) + second_duration = 0.0 + for second_playout in self.parameters_dict["second_playout"]: + fragment_duration = self.parameters_dict["fragment_duration_multi_mpd"][ + (second_playout[0], second_playout[1]) + ] + second_duration += fragment_duration + cmaf_track_durations.append(second_duration) + + return cmaf_track_durations