zerotohero-dev / ama

Ask me anything!
https://github.com/v0lkan/ama/issues?q=is%3Aissue+is%3Aclosed
4 stars 0 forks source link

[anonymous]: Can you talk about your streaming setup #9

Closed v0lkan closed 3 years ago

v0lkan commented 3 years ago

Can you talk about your streaming setup?

v0lkan commented 3 years ago

I’ve been asked this question a lot, so I think it’s time for me to elaborate on this a bit.

I stream on ZeroToHeroDev Twitch channel at least three times a few, often more.

And every time I figure something out, I modify my setup to provide a better viewing experience for people.

Aside

By the way, if you are curious about my overall developer setup, I have written it here. Here, I’ll only talk about the relevant parts of that setup to streaming.

Hardware

First things first, the hardware:

Audio Setup

Since I’m streaming on a Mac, it’s not as straightforward to stream the computer audio. I’ve tweeted about it, too, but the gist is:

multi-output-device

And you should be off to the races.

Capturing Desktop

Aside

OBS on Mac does not capture the mouse pointer when you do select the RDP session and capture it only. So to show my mouse pointer too, I had to do a full screen capture and scale up the capture to only show the 1080p portion (on the top left) and use a full Display Capture instead of a Window Capture so that it shows my mouse clicks too.

Also when you do a window capture, there is a lag between the video and your voice, so even without capturing your mouse clicks, it’s sill not the best experience.

As far as I know, this problem does not exist on the Windows version of the software.

I use OBS Studio to broadcast my desktop.

My screen is fairly large, I select a 1080p portion of it and only broadcast that part, which gives me some extra space to put things like the chat window, and the music player out of the view, just showing what I want to present.

I do my development on a Azure Windows VM; I connect to it through RDP and fit the RDP window into the 1080p section that I outlined above.

Let me show it with a picture to clarify:

Screen Shot 2020-10-19 at 9 22 15 AM

The part you see is the portion of my screen that is captured and streamed by OBS, whereas the “light grey / dark grey” hatched part is the rest of the screen that is not visible. I had to experiment with sizes, and manually move the Display capture around, and scale it up, until the top left portion perfectly fitted the 1080p region that I wanted to stream.

Here’s my entire screen for comparison:

Screen Shot 2020-10-19 at 9 29 23 AM

Stream Capture Settings

Here are various OBS Studio settings that I use.

Especially making the audio work with the capturing device took a while to figure out.

I’m putting screenshots here for reference.

Stream Settings

Screen Shot 2020-10-19 at 9 41 35 AM

Output

Screen Shot 2020-10-19 at 9 41 54 AM

Audio

Screen Shot 2020-10-19 at 9 42 23 AM

Video

Screen Shot 2020-10-19 at 9 42 37 AM

Other Advanced Settings

Screen Shot 2020-10-19 at 9 42 47 AM

Also on my Mic/Aux capturing device I have defined a compressor and a noise filter which greatly improved the output sound quality, though they consume a fair amount of CPU too, so use them at your own risk.

Screen Shot 2020-10-19 at 9 40 18 AM

Screen Shot 2020-10-19 at 9 40 27 AM

Other Stream-Related Apps

And that’s all the extra tooling I use, I guess. I’ll add more if I remember any.

Why Are You Using a Virtual Machine to Stream Your Work?

For several reasons:

But Why Not Linux? Why Windows for a VM?

For several technical reasons again:

RDP, as a protocol, works much better than VLC. I can share files between my guest and host OSs; I can use both of my monitors if I need; the video quality is much better, I can stream audio of the connected machine too, and the frame rate that I get off of it, especially when the machine is remote, is way better.

So overall, RDP is a better protocol, so it more-or-less constraints me to use a windows anyway.

The only alternative protocol that can reliably compete with RDP is PCoIP, and the only “as a service” solution that gives that reliably is Amazon Workspaces.

Now, Amazon Workspaces is a little more expensive than my Azure setup; well it’s not “that” big of a difference for me to not try it out. And when I use an Amazon Linux Desktop, thru PCoIP, using Amazon workspaces I can say that the overall experience is comparable to RDP and even better at certain areas.

But, aside from that, I was bitten by Amazon’s proprietary DNS implementation and a [GoLang patch] for Go 1.11 and above that expects the DNS provider to follow industry standards, and hence not honoring Amazon’s custom DNS rules.

But long story short, I was not able to connect to my MongoDB Atlas cluster unless I edited my /etc/resolv.conf. And when I edited my /etc/resolv.conf I opened a different can of worms (as in, if I get disconnected, I’d need to reboot the machine to reconnect; or when I need to execute commands as root, my virtual machine was not recognizing my root user, etc.)

So if I was going to use GoLang and MongoDB Atlas together and debug things locally, then an Amazon Linux Workspace was not an option.

I also tried Amazon Windows Workspaces, but I would not recommend them as a remote workspace, as it had its own set of issues, the biggest of which is the Desktop that Amazon advertises as a “Windows 10” machine is modified windows server; it is not a Windows 10 box, so it’s really hard to install WSL on it. And without WSL, windows is a “no go” for me anyways.

Which leaves the only option as an Azure remote VM for the time being.