cv2-ffmpeg-streaming


Namecv2-ffmpeg-streaming JSON
Version 1.0.4 PyPI version JSON
download
home_pagehttps://github.com/BlackCatDevel0per/python-opencv_ffmpeg_streaming
SummarySimple ffmpeg streaming util for opencv2
upload_time2022-03-29 12:03:02
maintainer
docs_urlNone
authorbcdev
requires_python>=3.7
licenseMIT
keywords ffmpeg streaming cv2 opencv utils
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # face-recognition-system
Simple face recognition system

## Installation
```
pip install cv2-ffmpeg_streaming 
```
or
```
git clone https://github.com/BlackCatDevel0per/python-opencv_ffmpeg_streaming
cd python-opencv_ffmpeg_streaming
python setup.py install
```

## Install requirements
```
sudo apt-get install libboost-numpy-dev
```

# Examples in tests directory
```
import cv2
import time
from rtmp_streaming import StreamerConfig, Streamer

cap = cv2.VideoCapture(0)
# run "ffplay -listen 1 -i 'rtmp://127.0.0.1:8000/stream' to display
ret, frame = cap.read()

sc = StreamerConfig()
sc.source_width = frame.shape[1]
sc.source_height = frame.shape[0]
sc.stream_width = 640
sc.stream_height = 480
sc.stream_fps = 20
sc.stream_bitrate = 1000000
sc.stream_profile = 'main' #'high444' # 'main'
sc.stream_server = 'rtmp://127.0.0.1:8000/stream'


streamer = Streamer()
streamer.init(sc)
#streamer.enable_av_debug_log()


prev = time.time()

show_cap = True

while(True):

    ret, frame = cap.read()
    now = time.time()
    duration = now - prev
    streamer.stream_frame_with_duration(frame, int(duration*100)) #0
    prev = now
    #if show_cap:
    #    cv2.imshow('frame', frame)
    #    if cv2.waitKey(1) & 0xFF == ord('q'):
    #        break


cap.release()
#if show_cap:
#    cv2.destroyAllWindows()
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/BlackCatDevel0per/python-opencv_ffmpeg_streaming",
    "name": "cv2-ffmpeg-streaming",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "ffmpeg streaming cv2 opencv utils",
    "author": "bcdev",
    "author_email": "bcdev@mail.ru",
    "download_url": "https://files.pythonhosted.org/packages/eb/80/87c25f99c0b01a00836d2aba9f42646cd834fe790d47e691cb28dbe10c9f/cv2-ffmpeg_streaming-1.0.4.tar.gz",
    "platform": null,
    "description": "# face-recognition-system\nSimple face recognition system\n\n## Installation\n```\npip install cv2-ffmpeg_streaming \n```\nor\n```\ngit clone https://github.com/BlackCatDevel0per/python-opencv_ffmpeg_streaming\ncd python-opencv_ffmpeg_streaming\npython setup.py install\n```\n\n## Install requirements\n```\nsudo apt-get install libboost-numpy-dev\n```\n\n# Examples in tests directory\n```\nimport cv2\nimport time\nfrom rtmp_streaming import StreamerConfig, Streamer\n\ncap = cv2.VideoCapture(0)\n# run \"ffplay -listen 1 -i 'rtmp://127.0.0.1:8000/stream' to display\nret, frame = cap.read()\n\nsc = StreamerConfig()\nsc.source_width = frame.shape[1]\nsc.source_height = frame.shape[0]\nsc.stream_width = 640\nsc.stream_height = 480\nsc.stream_fps = 20\nsc.stream_bitrate = 1000000\nsc.stream_profile = 'main' #'high444' # 'main'\nsc.stream_server = 'rtmp://127.0.0.1:8000/stream'\n\n\nstreamer = Streamer()\nstreamer.init(sc)\n#streamer.enable_av_debug_log()\n\n\nprev = time.time()\n\nshow_cap = True\n\nwhile(True):\n\n    ret, frame = cap.read()\n    now = time.time()\n    duration = now - prev\n    streamer.stream_frame_with_duration(frame, int(duration*100)) #0\n    prev = now\n    #if show_cap:\n    #    cv2.imshow('frame', frame)\n    #    if cv2.waitKey(1) & 0xFF == ord('q'):\n    #        break\n\n\ncap.release()\n#if show_cap:\n#    cv2.destroyAllWindows()\n```\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Simple ffmpeg streaming util for opencv2",
    "version": "1.0.4",
    "split_keywords": [
        "ffmpeg",
        "streaming",
        "cv2",
        "opencv",
        "utils"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "a1c69ee5c4e16edeaa05d45b5cbe69d7",
                "sha256": "811bc4b4cb13b07b427646b3f9061c64828014095d475584b47c9fc3251909c3"
            },
            "downloads": -1,
            "filename": "cv2-ffmpeg_streaming-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "a1c69ee5c4e16edeaa05d45b5cbe69d7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 9597,
            "upload_time": "2022-03-29T12:03:02",
            "upload_time_iso_8601": "2022-03-29T12:03:02.716785Z",
            "url": "https://files.pythonhosted.org/packages/eb/80/87c25f99c0b01a00836d2aba9f42646cd834fe790d47e691cb28dbe10c9f/cv2-ffmpeg_streaming-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-03-29 12:03:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "BlackCatDevel0per",
    "github_project": "python-opencv_ffmpeg_streaming",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "cv2-ffmpeg-streaming"
}
        
Elapsed time: 0.31133s