{"id":15197149,"url":"https://github.com/tordwessman/r2cam","last_synced_at":"2026-03-06T02:04:02.295Z","repository":{"id":238594461,"uuid":"795707199","full_name":"TordWessman/r2Cam","owner":"TordWessman","description":"Stream video from your Raspberry Pi or ESP32 to your iOS App","archived":false,"fork":false,"pushed_at":"2024-05-07T11:51:40.000Z","size":29,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T21:43:24.032Z","etag":null,"topics":["arduino","esp32","raspberrypi","raspberrypi-cam","video-streaming"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TordWessman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-03T21:23:47.000Z","updated_at":"2024-10-28T01:05:34.000Z","dependencies_parsed_at":"2024-09-23T23:31:01.360Z","dependency_job_id":"cb56f66a-7ebf-4477-927c-6a798d84e05a","html_url":"https://github.com/TordWessman/r2Cam","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"862f8d4d3e7bc35c08afab9416ccc2a5db7f4403"},"previous_names":["tordwessman/r2cam"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TordWessman%2Fr2Cam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TordWessman%2Fr2Cam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TordWessman%2Fr2Cam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TordWessman%2Fr2Cam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TordWessman","download_url":"https://codeload.github.com/TordWessman/r2Cam/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241577072,"owners_count":19984940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","esp32","raspberrypi","raspberrypi-cam","video-streaming"],"created_at":"2024-09-28T00:43:16.593Z","updated_at":"2026-03-06T02:04:02.254Z","avatar_url":"https://github.com/TordWessman.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# r2Cam\n\nr2Cam is a real-time video streaming framework in Swift for Raspberry Pi, ESP32 and and others.\n\nThe purpose of this library is to provide a simple client interface displaying a real-time H.264 video (e.g. Raspberry Pi Camera) and JPEG buffers (e.g. ESP32-CAM or any equivalent).\n\nIt currently expects TCP server endpoints to provide the video stream.\n\n## 1. Conceptual Usage\nThe snippet below demonstrates how the streaming client can be created and how an `AVSampleBufferDisplayLayer` is attached. For a full example, see the [Example Project](Example).\n```swift\nimport AVFoundation\n\n// ...\n\n// The video stream can be enqued directly to an `AVSampleBufferDisplayLayer`.\nlet displayLayerRPi = AVSampleBufferDisplayLayer()\nlet displayLayerESP = AVSampleBufferDisplayLayer()\n\n// ...\n\n// For Raspberry Pi Camera\nlet videoConnectionRPi = VideoConnectionFactory.shared.create(.h264(host: \"192.168.0.42\", port: 4444))\n// `displayLayerRPi` will receive the video stream from your Raspberry Pi Camera.\nvideoConnectionRPi.displayLayer = displayLayerRPi\n\n// For ESP32-CAM\nlet videoConnectionESP = VideoConnectionFactory.shared.create(.jpeg(host: \"192.168.0.43\", port: 4444))\n// `displayLayerESP` will receive the video stream from your ESP32-CAM.\nvideoConnectionESP.displayLayer = displayLayerESP\n\n// Start receiving images from your Raspberry Pi Camera.\ntry? videoConnectionRPi.start()\n\n// Start receiving images from your ESP32-CAM.\ntry? videoConnectionESP.start()\n\n```\n\n## 2. Server Side\nThe framework currently only supports TCP connections.\n\n### 2.1 Raspberry Pi Camera\nThere are plenty of ways how to provide a TCP server endpoint exposing your Raspberry Pi Camera stream, and here's one using (the now obsolete `raspivid`).\n\n`$ raspivid -n -ih -t 0 -rot 0 -w 640 -h 480 -fps 15 -b 1000000 -o - | nc -lkv4 4444`\n\n### 2.2 ESP32-CAM (or similar)\nTo stream video over TCP from your ESP device, the `esp_camera.h` library, and a `WiFiClient` from the `WiFi.h` library can be used. A tested example can be found here: [Arduino / ESP32-CAM TCP Server](https://github.com/TordWessman/ESP32-CAM-TCP-server).\n\n## 3. Configuration\nAt the time of writing, the number of configuration options is very limited...\n\n### 3.1 Declarations\n* `VideoConnection` is the protocol for the video stream router.\n* A `VideoConnectionDelegate` can be assigned to a `VideoConnection`s `delegate` property to receive image buffers and error information.\n\n## 4. Disclaimer\nThis project is currently in a POC state, but I dare _everyone_ to try it. Or even better - help me.\n\n## 5. License\nr2Cam is released under the MIT license. See [LICENCE](LICENCE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftordwessman%2Fr2cam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftordwessman%2Fr2cam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftordwessman%2Fr2cam/lists"}