Restreaming

This article describes how to restream Z1R matches.

* Dual core+ CPU
* 8 GB RAM
* GTX 760 or better

	+ (python error solution, not needed in 2.0 releases of streamlink/gui and beyond)

#### Other Links

* RandoMania Tracking System
* Racetime

### First Time Setup

1. Install applications in the following order:
	1. VLC
	2. Streamlink
	3. Streamlink GUI
2. Configure Settings for Streamlink GUI
	1. Click on **Open Streamlink GUI**
	2. Select **Streaming**
	3. Under *Streaming Provider*, use **Streamlink**
	4. The executable should be automatically located; however, you may have to locate it using the next search window provided using the magnifying glass to find the route to the file
	5. *Player input* should be set to **Standard** input
	6. Further down, there will be a check box for *Keep Player Window*; make sure this box is checked
		* **Note**: Depending on the update, it might read differently, but we do not want the player to close when the stream ends
3. Configure Player Settings
	1. Click on **Player**
		1. Have it preset to use VLC Media Player, and then under the executable locate the VLC version you are using
			* If your VLC player is having issues, locate the 2.2.8 download as this version is known to be stable for viewing streams
		2. On *Close Player* make sure that the player is set to not close
			* **Note**: *Single Instance* mode being checked and set custom title being checked are fine
			* Minimal player layout is not checked
4. Configure Stream Settings
	1. Click on **Streams**
	2. Under *Preferred quality*, you may want to adjust to fit your download/upload capabilities
		* This will tell Streamlink to first look for those level of qualities if the stream is outputting at multiple rates

### OBS Setup

This guide assumes you know how to place the background image from the race you are streaming, basic window capture, and how to set your resolution and bitrate resolution to the following values:

* Resolution: 1280x720 in base and output
* Bitrate: 2000

Audio splitting is built into Windows 10 and onwards, so if that is your OS then you’ll be set to split audios without additional resources. Please see here for VAC setup guide (you need free and $5 version to make this work) if your OS does not have this functionality automatically built into it.

### Profiles

Very important. You’ll want at least 2 profiles: 1) Your personal 2) One for the restream channel. What these different profiles do is allow you to save different settings for different streams. You’ll want to run the restream channel at 1500-2000 bitrate and 1280x720 resolution.

The following settings will be different from your personal stream to the *Restream* profile:

1. Stream key - So it goes to the correct channel. (don’t forget to change profile)
2. Audio - Disable your mic. Your role on stream is to make sure player audio to commentary audio are balanced and the visuals are good, so we won’t be using your mic on stream.
3. This will allow you to issue directions to commentators as a producer would on TV/Radio

### Restream Setup

#### Video

1. Open https://tracker.randomania.net or the tracker you were provided
	1. Select game if you have access to the link.
	2. Click the menu in bottom right corner
	3. Enter runners' names and commentary names
	4. Perform a browser capture in OBS and enter the URL into the URL section
	5. Crop tracker down to fit
	6. Open all streams in VLC via Streamlink GUI.
	7. Add a window capture and name it **Player 1**
	8. Crop and resize *Player 1* to the game feed, and place in the allotted area on layout
		* Before you do window capture for the second Player, you may need to click on the VLC window of the second Player. (There was an issue in the past with OBS Studio where it only would capture the window that was last used amongst all windows with the same filename.)
	9. Repeat Steps 7-9, except they will read **Player 2** instead of **Player 1**.
	10. Start web tracker timer when player’s start the race.

#### Audio

1. Make your headphones the default speakers on Windows
2. Make sure ALL extra notifications from ALL programs are silenced
3. Have the OST on standby (you can use this while waiting for the race to get started or if neither Player has usable audio)
	* Keep it paused with the volume 1 notch away from being mute
4. Determine before the stream goes live if either Player needs to turn their game volume up for you to capture it
	* It’s far easier to turn down too loud on your end than to boost too quiet
5. Make sure the game audio does not overpower the commentators and they can be clearly heard over the game audio
6. If you need to switch player audio:
	1. Use a DIFFERENT device (i.e. phone, laptop) to determine if the other player’s audio is usable
	2. Gradually fade the first player’s audio down until it is barely heard
	3. Gradually fade the second player’s audio in slowly

### Shortcuts and Tips

* Hold Alt, then click on the corner of a source to quickly crop
* After clicking and holding Shift, you can resize without keeping proportions
	+ Some Players stream Game feeds at 4:3, others at 8:7, and also 16:9
* After you get your quick crop done, you can further fine tune crop and positioning by right-clicking, then **Transform** > **Select Transform**
* Prior to starting any restream please have a Z1R admin set Game Title and other !commands

You’ll be ready to start stream at this point.

### Streaming to discord for commentary

1. Before going live use the **start virtual camera** button in obs this will act like a web cam of your feed
2. In discord join the channel for commentary/restream
3. Click the green video button
4. Change your camera to OBS Virtual Camera

### Why Streamlink/VLC Media Player?

If you try to pause a stream on twitch website and immediately hit play again, what happens? It reloads the stream completely. With this setup up, you’ll be able to pause one stream, and when you hit play, it starts exactly where you paused it. So to sync Players on stream (both players must be using timers that started at the exact same time in relation to the game), you simply pause the stream with the higher timer, and resume as soon as the other stream “catches up.” If you can get the streams have timers be within 1 second of each other, it's fine. If either Player is dropping frames, however, you won’t be able to maintain their sync.

After the restream is over, please be sure to close OBS with your personal profile open as to not go live on Z1R but your own personal twitch page.