ffmpeg-stream-to-numpy


Nameffmpeg-stream-to-numpy JSON
Version 0.10 PyPI version JSON
download
home_pagehttps://github.com/hansalemaos/ffmpeg_stream_to_numpy
Summaryffmpeg stream to numpy arrays
upload_time2022-12-29 16:30:21
maintainer
docs_urlNone
authorJohannes Fischer
requires_python
licenseMIT
keywords ffmpeg numpy cv2 video stream
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# ffmpeg stream to numpy arrays 

```python

# ffmpeg must be installed! 

$pip install ffmpeg-stream-to-numpy
from ffmpeg_stream_to_numpy import NumpyVideo
import cv2 
vi = NumpyVideo(
    videofile=r"C:\Users\Gamer\Videos\dfbs4.mp4",
    ffmpeg_param=(
        "-re", # real speed
        "-hwaccel",
        "cuda",
        "-c:v",
        "h264_cuvid",
    ),
)

for ini, i in enumerate(vi.play_video_ffmpeg()):
    # do something here 
    cv2.imshow("test", i)
    if cv2.waitKey(1) & 0xFF == ord("q"):
        break
    if ini == 100:
        vi.playvideo = False # stops the stream
cv2.destroyAllWindows()

    
```





            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hansalemaos/ffmpeg_stream_to_numpy",
    "name": "ffmpeg-stream-to-numpy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "ffmpeg,numpy,cv2,video,stream",
    "author": "Johannes Fischer",
    "author_email": "<aulasparticularesdealemaosp@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/7c/55/b9e928bfacc332685249869021beb072c90bf003e05a04885ef9fec0cf9c/ffmpeg_stream_to_numpy-0.10.tar.gz",
    "platform": null,
    "description": "\n# ffmpeg stream to numpy arrays \n\n```python\n\n# ffmpeg must be installed! \n\n$pip install ffmpeg-stream-to-numpy\nfrom ffmpeg_stream_to_numpy import NumpyVideo\nimport cv2 \nvi = NumpyVideo(\n    videofile=r\"C:\\Users\\Gamer\\Videos\\dfbs4.mp4\",\n    ffmpeg_param=(\n        \"-re\", # real speed\n        \"-hwaccel\",\n        \"cuda\",\n        \"-c:v\",\n        \"h264_cuvid\",\n    ),\n)\n\nfor ini, i in enumerate(vi.play_video_ffmpeg()):\n    # do something here \n    cv2.imshow(\"test\", i)\n    if cv2.waitKey(1) & 0xFF == ord(\"q\"):\n        break\n    if ini == 100:\n        vi.playvideo = False # stops the stream\ncv2.destroyAllWindows()\n\n    \n```\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "ffmpeg stream to numpy arrays",
    "version": "0.10",
    "split_keywords": [
        "ffmpeg",
        "numpy",
        "cv2",
        "video",
        "stream"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "40b0c87ec307c6531f64d18e0f1d26e0",
                "sha256": "591801e796c8911ad2d8ae7c596bff8c0e3b830eab39924a366d61308ef5e38e"
            },
            "downloads": -1,
            "filename": "ffmpeg_stream_to_numpy-0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "40b0c87ec307c6531f64d18e0f1d26e0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5341,
            "upload_time": "2022-12-29T16:30:19",
            "upload_time_iso_8601": "2022-12-29T16:30:19.878777Z",
            "url": "https://files.pythonhosted.org/packages/dc/b8/2ca7957d7f8aaa600c5488e390e1bff8cb9543de3ca96b68ec506423f7c4/ffmpeg_stream_to_numpy-0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "a1a6ba3070260a3bc96cbebb981e9961",
                "sha256": "32cc5b38aa65cd9ecb8d2e206457ad09e1090fc0602b6b35126e8354b7dc94b8"
            },
            "downloads": -1,
            "filename": "ffmpeg_stream_to_numpy-0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "a1a6ba3070260a3bc96cbebb981e9961",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3837,
            "upload_time": "2022-12-29T16:30:21",
            "upload_time_iso_8601": "2022-12-29T16:30:21.599215Z",
            "url": "https://files.pythonhosted.org/packages/7c/55/b9e928bfacc332685249869021beb072c90bf003e05a04885ef9fec0cf9c/ffmpeg_stream_to_numpy-0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-29 16:30:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "hansalemaos",
    "github_project": "ffmpeg_stream_to_numpy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "ffmpeg-stream-to-numpy"
}
        
Elapsed time: 0.02614s