{"id":19834952,"url":"https://github.com/j0hn-b/opencv_webcam","last_synced_at":"2026-04-30T22:36:33.505Z","repository":{"id":227534299,"uuid":"771605350","full_name":"J0hn-B/opencv_webcam","owner":"J0hn-B","description":"Access your shared webcam live streaming inside a container","archived":false,"fork":false,"pushed_at":"2024-03-13T19:42:57.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-22T02:44:45.814Z","etag":null,"topics":["developer-tools","docker-container","flask","live-streaming","opencv","opencv-python","python","video-streaming"],"latest_commit_sha":null,"homepage":"","language":"Python","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/J0hn-B.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-03-13T15:54:07.000Z","updated_at":"2024-11-29T18:00:07.000Z","dependencies_parsed_at":"2024-03-13T20:57:47.124Z","dependency_job_id":"c419730f-0f56-4df5-a38e-a10ea9ed76cf","html_url":"https://github.com/J0hn-B/opencv_webcam","commit_stats":null,"previous_names":["j0hn-b/opencv_webcam"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/J0hn-B/opencv_webcam","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J0hn-B%2Fopencv_webcam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J0hn-B%2Fopencv_webcam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J0hn-B%2Fopencv_webcam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J0hn-B%2Fopencv_webcam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/J0hn-B","download_url":"https://codeload.github.com/J0hn-B/opencv_webcam/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/J0hn-B%2Fopencv_webcam/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32479448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"ssl_error","status_checked_at":"2026-04-30T13:12:06.837Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["developer-tools","docker-container","flask","live-streaming","opencv","opencv-python","python","video-streaming"],"created_at":"2024-11-12T12:06:02.778Z","updated_at":"2026-04-30T22:36:28.496Z","avatar_url":"https://github.com/J0hn-B.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenCV live streaming in Docker\n\n- Share your laptop webcam on the local network\n\n  - Access your laptop webcam feed and a shared directory inside a Docker container\n\n    - Run the vision application inside the container and display the live camera feed, modify the vision application and see the changes.\n\n## Start Here\n\n```bash\ngit clone https://github.com/J0hn-B/opencv_webcam.git \u0026\u0026 cd opencv_webcam\n```\n\n## Share your laptop webcam on local network\n\n\u003e To change the default settings, edit the [camera](camera_server/camera.py) `camera_feed` \u0026 `local_port` variables\n\nIf your want to share the camera of a `Windows machine` and you have `Task` installed:\n\n`Taskfile.yml`\n\n```bash\ntask share_camera\n```\n\nelse:\n\n```bash\npip3 install -r camera_server/requirements.txt\n\npython3 camera_server/camera.py\n```\n\nStarting the server, `the IP address and port number will be displayed in the terminal`\n\n---\n\n## Access your laptop webcam feed inside a container\n\n\u003e ! Important: The container uses `-v /tmp/.X11-unix:/tmp/.X11-unix` to display the camera feed.\n\u003e\n\u003e For `-v /tmp/.X11-unix:/tmp/.X11-unix` to work effectively, you should use a Unix-based host such as Linux, WSL or MacOS to run the container.\n\u003e\n\u003e For Windows, you need to install an X server like VcXsrv\n\nUpdate the `camera_feed` IP address in [app](vision/app/main.py) file **with the IP address and port number displayed in the previous step**\n\n```python\ncamera_feed = \"\" # example: http://192.168.0.10:5000\n```\n\nContinue with:\n\n```bash\ntask run_vision\n```\n\nelse:\n\n```bash\n# Build the image\ndocker build -t vision:latest vision\n```\n\n```bash\n# Run the container\ndocker run -it -e DISPLAY=$DISPLAY -v $(pwd)/vision/app/:/vision -v /tmp/.X11-unix:/tmp/.X11-unix --network=\"host\" vision:latest /bin/bash\n```\n\n---\n\n## Run the vision application\n\n**From inside the container:**\n\n```bash\n# root@docker-desktop:/vision#\n\npip install -r requirements.txt\n```\n\n```bash\n# root@docker-desktop:/vision#\n\npython main.py\n```\n\nA new window will open displaying the live camera feed\n\n![opencv](https://github.com/J0hn-B/opencv_webcam/assets/40946247/4acc6be2-01d3-4096-a834-e8fa6670b23f)\n\n## Stop the app and exit the container\n\n```bash\n# root@docker-desktop:/vision#\n\nCTRL+C\n\nexit\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj0hn-b%2Fopencv_webcam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj0hn-b%2Fopencv_webcam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj0hn-b%2Fopencv_webcam/lists"}