How to protect a stream from copying

Limit unauthorized embedding, the passing around of links and unwanted viewing

The copying of live streams is a serious problem. Another site may try to embed someone else's player, a published link may reach people it was not meant for, and automated requests can create unnecessary load.

rtsp.me offers several layers of protection. Choose the method that suits you, or combine several mechanisms for tighter control.

Set up protection

What you can protect

Protection helps you control where the player runs, who gets access to the video, and which network addresses may reach the stream or the original camera.

There is no way to completely prevent a recording of video that has already been shown: a viewer can use a screen recorder or film the monitor with another device. The point of protection is to make theft substantially harder, to limit re-use and to keep control of access.

1. Protection from copying

Level of protection: medium

Allow the player to run only on the sites you name. If the stream's code is embedded on another domain, playback will be blocked.

In the settings, enter the domain name only — no https://, no path and no page address:

example.com

Several allowed sites can be listed separated by commas:

example.com, video.example.com, partner.ru

Add every domain the player is meant to work on, including a separate subdomain if you use one. This method protects you from someone simply copying the HTML code onto their own site.

2. Password access

Level of protection: medium

Access to the video is granted only after the password you have set has been entered correctly. This option suits temporary private streams and a limited audience.

A shared password can be forwarded to someone else, so for control at the level of the individual it is better to use sign-in or temporary links.

3. IP blacklist

Level of protection: medium

Users at the IP addresses you add will not be able to reach the stream. Addresses to block can be taken from the statistics log.

  1. Open the stream's statistics.
  2. Find an IP address with a suspiciously large number of requests.
  3. Make sure it is not your own office, a proxy server or a network your viewers share.
  4. Add the address to the blacklist.
  5. Keep watching the statistics after the block.
A single public IP address may be shared by the staff of an office, by mobile subscribers or by users on a network behind CGNAT. Weigh up the risk of cutting off legitimate viewers before you block it.

4. Access for signed-in users

Level of protection: strong

The stream is available only to users who have signed in at rtsp.me and been given the right to view it.

You create the streams in your own account and grant access to the users you choose. They can watch the cameras in the rtsp.me interface itself.

User → sign in at rtsp.me → access check → watch the camera

This option suits staff, contractors and regular customers: access is tied to an account rather than to a shared password or a public player code.

5. Protection through PHP code

Level of protection: strong

PHP integration lets you place the stream on your website with stronger protection from copying. A unique link is created for each visitor, and it stays valid for 10 minutes.

Your site must run PHP version 5.3 or above. The integration's secret parameters are held on the server and are not published in HTML or JavaScript.

Visitor → your PHP server → a unique link for 10 minutes → player
  1. The site checks the user and their right to view.
  2. The PHP code builds a personal, temporary link.
  3. The player receives the link only once the check has passed.
  4. After 10 minutes the link that was issued stops working.

The steps for placing the player in the ordinary way and the principles behind PHP integration are described on the page “How to embed a stream on your website”.

6. Whitelist on the router

Protecting the original stream

Add the IP addresses of the rtsp.me streaming servers to your router's whitelist and allow connections to the camera's RTSP port from those addresses only.

Ask rtsp.me technical support for the current list of servers. Do not use addresses from older instructions: the infrastructure may change.

rtsp.me servers only → router → the camera's RTSP port
  1. Get the current list of IP addresses from support.
  2. Create allow rules for those addresses.
  3. Block all other incoming connections to the RTSP port.
  4. Check that the stream works once the rules are in place.
This method protects the original camera from direct connections, but it does not limit the copying of a player that has already been embedded. Use it together with allowed domains, sign-in or PHP links.

How to choose your protection

For the greatest practical effect, combine the layers. For example, restrict the player to a domain, issue temporary links through PHP, keep an eye on the statistics and allow only the rtsp.me servers to reach the camera.

Frequently asked questions

Can video theft be ruled out entirely?
There is no guaranteed way to prevent a screen recording, but you can block unauthorized embedding, restrict access and make copied links useless.
How should allowed domains be written?
Without https:// and without a path: example.com, for instance. Several domains are listed separated by commas.
When should I block an IP address?
When the statistics show an unusually large number of requests from one address. Before blocking it, make sure the address does not belong to a network shared by legitimate viewers.
Why is PHP protection stronger than an ordinary link?
A separate link is created for each visitor and lasts 10 minutes. The secret parameters stay on your own server.
Where do I get the streaming servers' IP addresses?
Ask rtsp.me technical support for the current list before you set up the whitelist on your router.

Protect your stream

Choose the restrictions that suit you in rtsp.me and combine several mechanisms for tighter control of access.

Open the settings