{ "info": { "author": "IndyKoning", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# P2PCam\nClass to retrieve camera images from cameras using the p2p protocol\n\nFirst of all i just wrote it to work as a class, the original connection and retrieval process has been made by [Jheyman](https://github.com/jheyman/) in his [videosurveillance script](https://github.com/jheyman/videosurveillance/).\nI rewrote it to run as a class instead of an application.\n\nSo i had this [chinese camera](https://nl.aliexpress.com/item/Phone-monitor-P2P-Free-DDNS-Ontop-RT8633-HD-1-4-CMOS-1-0MP-Network-IP-Camera/990524792.html) laying around, it had this feature that you could access it from outside your home without the need for port forwarding. However after a couple of years this brand dissappeared and with it their services so i couldn't connect to it outside of my own network using [this app](https://play.google.com/store/apps/details?id=x.p2p.cam).\n\nWhich made owning this camera quite useless. But i had since gotten into Home Asssistant and got the idea to get it working in there since my instance ran locally so it should be able to access the camera.\n\n## Usage\n```\nimport p2pcam\nimport cv2\nimport numpy as np\n\ndef saveFile(cam, jpeg):\n RGBImage = cv2.imdecode(np.fromstring(jpeg, dtype=np.uint8), cv2.IMREAD_COLOR)\n cv2.imwrite('image.jpg', RGBImage)\n\ncamera = p2pcam.P2PCam(, )\nsaveFile(camera, camera.retrieveImage())\n```\n## Methods and Variables\n### Methods\nAny methods that may be useful.\n\n`camera.initialize()` Set some variables and attempt to connect to the camera for the first time.\n\n`camera.retrieveImage()` Retrieve a jpeg string from the camera.\n\n`camera.start()` Start a while true loop staying connected, this will not do anything if `onJpegReceived` isn't set.\n\n`camera.loop()` Start a while loop doing `retrieveImage()` until a socket error occurs.\n### Variables\nSome variables you may want to set.\n\n`camera.horizontal_flip` Flip camera horizontally. (if true requires numpy and cv2)\n\n`camera.vertical_flip` Flip camera vertically. (if true requires numpy and cv2)\n\n`camera.addTimeStamp` Add a timestamp to the image. (if true requires numpy and cv2)\n\n`camera.debug` If true prints out some debugging information.\n\n\nThe port information will have to be set before initialisation.\n\n`camera.UDP_PORT_HOST` Host udp port default: 5123\n\n`camera.UDP_PORT_TARGET` Target udp port default: 5000\n\n`camera.SOCKET_TIMEOUT` Sets the socket timeout in seconds.\n\n`camera.NB_FRAGMENTS_TO_ACCUMULATE` How many packets to get a full image. If you put this number high you will get a higher quality image but it will take longer to retrieve. Default: 80\n\n`camera.onJpegReceived` Callback that will be executed if a jpeg image is retrieved. first argument will be the camera class, the second argument will be the jpeg image string.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/indykoning/PyPI_p2pcam", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "p2pcam", "package_url": "https://pypi.org/project/p2pcam/", "platform": "", "project_url": "https://pypi.org/project/p2pcam/", "project_urls": { "Homepage": "https://github.com/indykoning/PyPI_p2pcam" }, "release_url": "https://pypi.org/project/p2pcam/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "A package to talk to p2p cameras", "version": "0.0.2" }, "last_serial": 5602086, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "4ae0d3faa9fc7027a49b4eb30fffcaf1", "sha256": "3c75bf898b2cf6d7e412558b13356722679083b05fc4ff311757674217f55a55" }, "downloads": -1, "filename": "p2pcam-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4ae0d3faa9fc7027a49b4eb30fffcaf1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8758, "upload_time": "2019-07-29T21:37:30", "url": "https://files.pythonhosted.org/packages/1b/93/76d6aac50a72f500eae6fa22770536cf7b38c429407bca94aacec2cc4882/p2pcam-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "41ac39396b371f390ba50749f5a20d27", "sha256": "a1f533a8217948f276d89bf118177d0c30718aba0033bf057a846491a224d957" }, "downloads": -1, "filename": "p2pcam-0.0.1.tar.gz", "has_sig": false, "md5_digest": "41ac39396b371f390ba50749f5a20d27", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7611, "upload_time": "2019-07-29T21:37:32", "url": "https://files.pythonhosted.org/packages/9c/31/6a9ef3649f1d779589646fd8e8ef54cc540453b7ba793ae63971ac9dfb0e/p2pcam-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "d0efe0cddcac1e1d808ae16eede3a78d", "sha256": "ee5d5ea235c03d323c5b8a5d4847141b19ba405754694cf7a4d9c1502e519935" }, "downloads": -1, "filename": "p2pcam-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "d0efe0cddcac1e1d808ae16eede3a78d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8756, "upload_time": "2019-07-29T21:46:27", "url": "https://files.pythonhosted.org/packages/5a/62/fa0b6d406e2b98449abc1eee6bf4464ee5aca1ee7fd85aa6de287e8a103e/p2pcam-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ca87a1697276ceed5f59dcb013fdfbb5", "sha256": "2bf8123f7ebfe33364a8a6e60dfae5e1c326b5242e86fed346002bea63b64adc" }, "downloads": -1, "filename": "p2pcam-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ca87a1697276ceed5f59dcb013fdfbb5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7598, "upload_time": "2019-07-29T21:46:29", "url": "https://files.pythonhosted.org/packages/77/78/8990d1f9b951611e28650866f56013b42275a120530d92321673bf4a349f/p2pcam-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d0efe0cddcac1e1d808ae16eede3a78d", "sha256": "ee5d5ea235c03d323c5b8a5d4847141b19ba405754694cf7a4d9c1502e519935" }, "downloads": -1, "filename": "p2pcam-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "d0efe0cddcac1e1d808ae16eede3a78d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8756, "upload_time": "2019-07-29T21:46:27", "url": "https://files.pythonhosted.org/packages/5a/62/fa0b6d406e2b98449abc1eee6bf4464ee5aca1ee7fd85aa6de287e8a103e/p2pcam-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ca87a1697276ceed5f59dcb013fdfbb5", "sha256": "2bf8123f7ebfe33364a8a6e60dfae5e1c326b5242e86fed346002bea63b64adc" }, "downloads": -1, "filename": "p2pcam-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ca87a1697276ceed5f59dcb013fdfbb5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7598, "upload_time": "2019-07-29T21:46:29", "url": "https://files.pythonhosted.org/packages/77/78/8990d1f9b951611e28650866f56013b42275a120530d92321673bf4a349f/p2pcam-0.0.2.tar.gz" } ] }