-
Notifications
You must be signed in to change notification settings - Fork 43
RTSP Stream
RTSP is a streaming protocol that allows very low latency (usually 1 second or less) video and audio streaming into VRChat. RTSP is not to be mistaken for RTMP which can also stream into VRC, but has a much higher latency of usually >10 seconds. Which is not acceptable for many use cases.
There are services that provide an already-setup server for RTSP streaming already such as VRCDN and Topazchat. It is recommended that you use the video player setups that they provide, but it is possible to input the RTSP link they provide into the stream player and use them the same though USharpVideo if you wish.
The only thing that you need to do in these cases is make sure that the Low Latency Stream
check box is enabled on the U# video player.
You can fairly quickly start an RTSP server for sharing your screen or hosting your own stream. For this guide I will use DigitalOcean as the server host, but any host works. The software you will need for this is Putty and OBS.
If you already have a server setup with docker, you can skip the digitalocean server setup.
-
Create an account at https://www.digitalocean.com/
-
Create a droplet
a. Reference the how to create a droplet guide for more detail https://docs.digitalocean.com/products/droplets/how-to/create/
b. Under the Choose an image section, choose the Marketplace tab and select the Docker on Ubuntu option. If that option does not exist search for the "Docker" keyword.
c. Under Choose a plan you will need to choose appropriate specs for the PC. If you're just streaming to a couple of people, a basic shared CPU can work. If you're streaming to more people I'd recommend choosing the cheapest CPU Optimized instance.
d. Choose a datacenter that is close to your location
e. For authentication you can use a SSH key, but I will not explain that here since it requires additional setup. If you are not familiar with SSH keys just select password for authentication and create a password.
f. Click create droplet and you're done creating the droplet
-
Connect using Putty
a. Follow https://docs.digitalocean.com/products/droplets/how-to/connect-with-ssh/putty/ and skip the SSH key section if you're using a password. Your username is
root
by default.b. Click Open to connect and put your password in
c. You should now be connected to your server
Setting up RtspSimpleServer
RtspSimpleServer is one of the few servers I've found that actually has functional RTSP support.
You should be connected to your server through Putty at this point and it should be setup for Docker. The docker setup is done if you used the Docker marketplace selection on DigitalOcean.
- Enter the following in the command line:
docker run --rm -it -e RTSP_PROTOCOLS=tcp -p 8554:8554 -p 1935:1935 aler9/rtsp-simple-server
- After entering the command the RTSP server should be setup.
- Open OBS's settings menu
- Go to the stream options and select
Custom...
for the service - For the server, put
rtmp://<your server IP>
for example if your droplet's IP were 123.123.123.123 you'd putrtmp://123.123.123.123
- For the stream key put a key of your choice, it can me anything alphanumeric. For instance
mylivestream
would work. Multiple people can stream through the same server if they use different stream keys. - Apply and exit the settings and setup your screen capture on OBS, then click Start Streaming. Your stream should connect and you should see output on the server's console that says an RTMP connection was opened.
If you want to test your stream outside of VRChat you can connect to it in VLC. To connect in VLC, open VLC go to the Media menu and click Open Network Stream...
. For the network URL put in the following rtsp://<your server IP>:8554/<your stream key>
. For the prior examples this would be rtspt://123.123.123.123:8554/mylivestream
.
- If you want the low latency that RTSP provides, you may enable the
Low Latency Stream
option on the USharpVideo player settings. - Upload your world with USharpVideo
- Go to your world and select the stream player.
- Make sure untrusted URLs are allowed and put the same URL you used for VLC above into the video player.
- You should now be streaming and people should be able to watch your stream in VRC.
Digitalocean will still charge you for server time as long as the server exists. Shutting down the server will still charge you for server time. So make sure you destroy your droplet after you are done streaming if you do not want to accrue server costs.
Getting Started
How-to