{"id":19722024,"url":"https://github.com/sensoranalyticsaus/remote_rtsp","last_synced_at":"2026-04-12T18:10:33.426Z","repository":{"id":62414165,"uuid":"560415645","full_name":"SensorAnalyticsAus/remote_rtsp","owner":"SensorAnalyticsAus","description":"For accessing RTSP camera udp streams remotely with opencv-python.","archived":false,"fork":false,"pushed_at":"2024-05-21T06:33:57.000Z","size":36,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-10T16:23:36.114Z","etag":null,"topics":["ipcamera","opencv","python","rtsp"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SensorAnalyticsAus.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,"publiccode":null,"codemeta":null}},"created_at":"2022-11-01T13:04:44.000Z","updated_at":"2024-05-21T06:34:01.000Z","dependencies_parsed_at":"2025-01-16T03:13:23.435Z","dependency_job_id":null,"html_url":"https://github.com/SensorAnalyticsAus/remote_rtsp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SensorAnalyticsAus%2Fremote_rtsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SensorAnalyticsAus%2Fremote_rtsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SensorAnalyticsAus%2Fremote_rtsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SensorAnalyticsAus%2Fremote_rtsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SensorAnalyticsAus","download_url":"https://codeload.github.com/SensorAnalyticsAus/remote_rtsp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241044203,"owners_count":19899478,"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":["ipcamera","opencv","python","rtsp"],"created_at":"2024-11-11T23:16:14.956Z","updated_at":"2025-11-20T19:04:40.659Z","avatar_url":"https://github.com/SensorAnalyticsAus.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# How to programatically connect to a RTSP camera URL remotely with OpenCV-Python\n\nAccessing a RTSP cam stream from a remote site with ````opencv````, requires two basic computers, e.g. rpi3s, one in each LAN.\n\n[Remote RTSP LAN access setup](https://www.sensoranalytics.com.au/misc/Sof.jpg)\n\nA serial vpn link is setup between the two rpis with the following commands on the remote rpi.\n\nInstall ````ppp```` package on both the rpis:\n````\nsudo apt update\nsudo apt upgrade\nsudo apt install ppp\n````\n### Enable IP Forwarding\nCheck IP forwarding is enabled on both the rpis:\n````\nsysctl net.ipv4.ip_forward\nnet.ipv4.ip_forward = 1\n````\nIf the value is '0' then:\nedit `/etc/sysctl.conf`. Search for a line containing the entry `#net.ipv4.ip_forward=1`, and remove the # at the beginning of the line. Save the file and run the `sysctl` command to enable the edited setting:\n````\nsudo sysctl -p /etc/sysctl.conf\n````\n\n````vpn-s````\n\n````\n#/bin/bash\n# vpn-s script sets up a point-to-point vpn between remote computer \n# and local computer on the home LAN. \n# Run this script on the remote computer. Tested on Raspbian and Debian10.\nsudo /usr/sbin/pppd updetach connect-delay 60000 noauth pty\\\n \"sudo -u usrname_remote /usr/bin/ssh -t -t usrname@home_router_ip -p home_router_port_no_fwd_to_rpi\\\n  sudo /usr/sbin/pppd noauth 192.168.186.2:192.168.186.1\"\n````\n\n````fwdonremote````\n````\n#!/bin/bash\n# Edit in below your actual local, i.e. home, LAN address (as provided by ISP).\n#start ssh vpn first (vpn-s) then run this script on remote computer.\nsudo iptables -F\nsudo iptables -t nat -F\nsudo ip r add 192.168.1.0/24 dev ppp0\nsudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE\n````\n\n```` fwdonlocal ````\n````\n#!/bin/bash\n# Edit in below your actual remote LAN address (as provided by ISP).\n#After ssh vpn has been established by remote run this script here on\n#the local computer.\nsudo iptables -F\nsudo iptables -t nat -F\nsudo ip route add 192.168.0.0/24 dev ppp0\nsudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE\n````\n\nInstall the following ````python```` packages if not previously installed on remote rpi.\n\n````\npip install --upgrade pip\npip install numpy\npip install opencv-python\n````\n\nRunning ```` open_uri.py```` with your own camera rtsp://url edited in should connect to the ipcam on home LAN and open a display window in the remote rpi. \n\n**Note:** If remote rpi is running in headless mode, connection to it should be made with X forwarding enabled to access the display say with ````ssh -XY rpi3-remote````.\n\n### Troubleshooting\n````vpn-s```` requires the ````ssh```` login from remote rpi to local rpi is passwordless with no keyboard interaction. The ````sudo```` command on both the rpis is also passwordless with no keyboard interacion.\n\n````fwdon```` scripts require the ````iptables```` on both the rpis are in their default setting before use, which can be set as:\n```` \nsudo iptables -F\nsudo -t nat -F\n````\nCheck if your rpis have ````ufw````, check if it's active. If so, it may be blocking network traffic in some way.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensoranalyticsaus%2Fremote_rtsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensoranalyticsaus%2Fremote_rtsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensoranalyticsaus%2Fremote_rtsp/lists"}