Streaming webcam to a server

From DanIT
Jump to navigation Jump to search

This tutorial will show you how you can watch a webcam feed from multiple computers, without the need of using a 3rd-party platform like YouTube or Twitch.
The computer from where the camera is connected to will feed the camera stream to an RTMP server. You can view the stream of this server from any device.

Setup

RTMP Server

MonaServer.png

You could install the server on the same computer as where the camera is connected to, but this is not required.
This server is just a hub where the streamer and watchers come together.

  1. Make sure port 1935 (RTMP) is open in your firewall, to be able to connect to the RTMP server from outside the local network.
  2. Download MonaServer, and run the executable. Keep this running as long as you need the server to be online.

Upstream

OBS Stream Custom.png

You can use any application that provides streaming services, as long as it supports a custom stream.
In this case we will use OBS, mainly because it is free, easy to use, and very popular.

  1. Install OBS on the computer with the camera.
  2. Go to File >> Settings >> Stream.
  3. For Service, select "Custom".
  4. For Server, enter "rtmp://127.0.0.1/live" (replace 127.0.0.1 with the (public) IP address of the RTMP Server).
  5. For Stream Key, you can enter any stream number you want, as you can stream multiple feeds to the server. In this case we use "1".

View

VLC Stream.png

There are many media players that support viewing an RTMP stream, but in this case we'll use VLC.

  1. Open VLC.
  2. Go to Media >> Open Network Stream.
  3. Enter the RTMP server address, like "rtmp://127.0.0.1/live/1" (don't forget the "/1" at the end, to indicate the stream number).