cv-videowriter


Namecv-videowriter JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryWrapper around OpenCV VideoWriter with some extra features
upload_time2024-08-26 11:15:07
maintainerNone
docs_urlNone
authorIbai Gorordo
requires_pythonNone
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # cv_videowriter
Wrapper around OpenCV VideoWriter with some extra features.

## Features
- Raise an exception if the video file is not created due to wrong configuration parameters.
- Automatically select the video size based on the first written frame.
- Raise an exception if the passed frame has a different size than the video size.
- Add force resize option to resize the frame to a predefined size.
- It will run cvtColor if the frame color is not the same as the video color. Or it will raise an exception if the frame color is not convertible to the video color.

## Installation [![PyPI](https://img.shields.io/pypi/v/cv_videowriter?color=2BAF2B)](https://pypi.org/project/cv_videowriter/)
```bash
pip install cv_videowriter
```

## Usage

```python
import cv2
import numpy as np
from cv_videowriter import VideoWriter

writer = VideoWriter('test.mp4', cv2.VideoWriter_fourcc(*'mp4v'), 30)

for i in range(10):
    frame = np.random.randint(0, 255, (460, 640, 3), dtype=np.uint8)
    writer.write(frame)
```

## Parameters
- `filename`: str - Path to the video file.
- `fourcc`: int - FourCC code of the codec used to compress the frames.
- `fps`: float (default: 30) - Frame rate of the created video.
- `force_resize`: tuple[int, int] (default: None) - Resize the frame to the specified size (height, width) before writing it to the video file.
- `api_preference`: int (default: cv2.CAP_ANY) - API backends for video capturing.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cv-videowriter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Ibai Gorordo",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/39/4a/5694edb0d61aebe51a3eb7fbc346393ded7dec2a805f5699d81b5078c1f8/cv_videowriter-0.1.0.tar.gz",
    "platform": null,
    "description": "# cv_videowriter\r\nWrapper around OpenCV VideoWriter with some extra features.\r\n\r\n## Features\r\n- Raise an exception if the video file is not created due to wrong configuration parameters.\r\n- Automatically select the video size based on the first written frame.\r\n- Raise an exception if the passed frame has a different size than the video size.\r\n- Add force resize option to resize the frame to a predefined size.\r\n- It will run cvtColor if the frame color is not the same as the video color. Or it will raise an exception if the frame color is not convertible to the video color.\r\n\r\n## Installation [![PyPI](https://img.shields.io/pypi/v/cv_videowriter?color=2BAF2B)](https://pypi.org/project/cv_videowriter/)\r\n```bash\r\npip install cv_videowriter\r\n```\r\n\r\n## Usage\r\n\r\n```python\r\nimport cv2\r\nimport numpy as np\r\nfrom cv_videowriter import VideoWriter\r\n\r\nwriter = VideoWriter('test.mp4', cv2.VideoWriter_fourcc(*'mp4v'), 30)\r\n\r\nfor i in range(10):\r\n    frame = np.random.randint(0, 255, (460, 640, 3), dtype=np.uint8)\r\n    writer.write(frame)\r\n```\r\n\r\n## Parameters\r\n- `filename`: str - Path to the video file.\r\n- `fourcc`: int - FourCC code of the codec used to compress the frames.\r\n- `fps`: float (default: 30) - Frame rate of the created video.\r\n- `force_resize`: tuple[int, int] (default: None) - Resize the frame to the specified size (height, width) before writing it to the video file.\r\n- `api_preference`: int (default: cv2.CAP_ANY) - API backends for video capturing.\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Wrapper around OpenCV VideoWriter with some extra features",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/ibaiGorordo/cv_videowriter"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "150f8575e2f915986b6ac620f1f96409ba1fddc4a92a0effc8896d3e7665447f",
                "md5": "0701d60be6c22a2e6445aa2c093128d5",
                "sha256": "d0007e47afa2e0b0c4363621716a741e64fc4c369fde7725b3ad38808e4a315f"
            },
            "downloads": -1,
            "filename": "cv_videowriter-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0701d60be6c22a2e6445aa2c093128d5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 3189,
            "upload_time": "2024-08-26T11:15:06",
            "upload_time_iso_8601": "2024-08-26T11:15:06.072471Z",
            "url": "https://files.pythonhosted.org/packages/15/0f/8575e2f915986b6ac620f1f96409ba1fddc4a92a0effc8896d3e7665447f/cv_videowriter-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "394a5694edb0d61aebe51a3eb7fbc346393ded7dec2a805f5699d81b5078c1f8",
                "md5": "674f8971ed9abf32d4d5c3f8ce130e19",
                "sha256": "b1506a6c8eec4e21ecd32b8b5af601600fe3be10af2b2ccf8e7fb38a8bd1d709"
            },
            "downloads": -1,
            "filename": "cv_videowriter-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "674f8971ed9abf32d4d5c3f8ce130e19",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3328,
            "upload_time": "2024-08-26T11:15:07",
            "upload_time_iso_8601": "2024-08-26T11:15:07.276730Z",
            "url": "https://files.pythonhosted.org/packages/39/4a/5694edb0d61aebe51a3eb7fbc346393ded7dec2a805f5699d81b5078c1f8/cv_videowriter-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-26 11:15:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ibaiGorordo",
    "github_project": "cv_videowriter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "cv-videowriter"
}
        
Elapsed time: 0.30530s