Categories
Streaming Tech

Twitch Alerts Using a Green Screen

Everyone uses Twitch alerts. They’re awesome! However, I’ve noticed that most of them are the same. I wanted to make my own but I figured it would be a lengthy process and I’m no graphic designer but I am however a darn good video and effects editor with a huge background in computer programming… I think I can figure something out! So, this is how I created my own Twitch alerts (In StreamElements but this would work for Streamlabs too) using a diy green screen, a camera, some free software, and a bit of command line. Don’t worry if you don’t know how to code or edit. I will explain every detail and walk you thru all of it. This is going to be a bit lengthy but come along and you’ll have yourself some custom notifications in Twitch!

The Videos

I know I just said I’d walk you thru all of it but I really can’t walk you through making the greenscreen videos. If you don’t have a greenscreen (Wait what? Seriously?… Buy one! Use dry wall hook screws on your ceiling. Buy some chain, then buy a PVC pipe. Sling the pipe thru the hole in the greenscreen, then sling the chain thru the PVC, hook the chains to the drywall screws. Boom. Instant greenscreen. Iron it before mounting!) then what are you doing with your life? However, I get it. We all have different motivations.

If you don’t have one nor want to invest in one, you can check out this website for free or paid clips of different greenscreen videos. Personally, I use their paid program because each month you pay for it, you just wrack up premium points for premium downloads which is great for me because I don’t always need video assets.

Anyways, now that you have your videos, we’re going to move over to the editing process to remove the green background.

Removing the Green

Now, this step is slightly involved but fairly straight forward. I’m going to be using a free video editing software that is absolutely fantastic. I can’t say enough good things about Davinci Resolve. They have a free and paid version but the free version is so powerful that a lite user won’t even feel that it’s free.. It kind of feels like you stole it. Trust me, once you hit 4K editing and Fusion compositing, you’ll be happy to fork over the $300 to get the paid version. Actually, right now, they’re offering an editing tool and Davinci Resolve on Amazon for $300 which gives you both for half off. Link here.

Alright, now that I’m done fan-boying over DR, let’s move forward. I’m assuming you have Resolve installed by now so go ahead and start it up and make a new Project, calling it Twitch Alerts. I could spend all day explaining how Resolve works but for the sake of brevity, I’m going to try to keep this as short as possible.

Go to your Media tab at the bottom and find your greenscreen files. You can also drag and drop them into the striped line area to have Resolve directly to them. Now drag those files to where it says “No Clips in Media Pool”. Once dragged, you’ll now have them in your Media Pool, go to the Cut tab below.

From here, you’re going to drag your videos from the Media Pool to your Timeline.

Now move to the Edit tab.

From here, you can trim your videos to the desired length using the Razor Tool.

Just find on the Timeline where you’d like the middle to be and slice off the beginning and end to the video only contains the parts that you want.

Now move to the Fusion tab.

This tab looks scary, but it’s going to be fairly easy what we’re doing. You should see something similar to below.

Click and drag the Rectangle button (that’s all the way to the left side) down into the Nodes section.

If you drag it onto that Yellow line, you’ll connect it together.

And it’ll create a Merge Node like so.

What we have just done is put a Background Node into our Composition. This is key. Next we’re going to make the background invisible by click on the Backgroud Node and going to the right side panel called the Inspector. Here, you’re looking for the slider called Alpha.

If you don’t see these settings, you probably still have the Merge Node selected. Just click on the node called “Background” then look again.

Now that you see the Alpha slider, drop it to 0.

You should now see your greenscreen video appear. However, you’ll noticed that the “green” part of the greenscreen is still there. Let’s get rid of that next.

Navigate your eyes over to the left side of Resolve and you’ll see the Effects Library. If you don’t see is, click the below button at the top left.

Now that the Effects Library has appeared, refer to the above screenshot. See the magnifying glass above the beginning of the arrow? Click that and type “Key”. You’ll see a list of Effects pop up and we’re looking for Ultra Keyer.

Like the Background Node, if you drag it onto the line (In front of our other Node), it will attach itself in line and be ready to use.

Select it and move back to the right side in the Inspector and you’ll see these options.

What we’re interested in is the “Background Color”. Specifically, the little eye dropper next to it. Click it then move to your greenscreen video. Click and drap a selected “Green” area and you’ll see something like this.

It only got a little right? Keep selecting green! And only green too. If you get part of your subject, it’ll key them out too. Then after a few drags, you’ll see something like this.

Notice the checkered invisible background? That’s a huge step forward! However, those green artifacts next to my subjects hair have to go! I like a clean plate with no green showing. So we’re going to zoom in using Ctrl+ scroll wheel on our mouse. You can pan the video around by center click and holding the mouse wheel and moving it around. Zoom in really close on the hair.

See those green areas? Carefully select just those. If you mess up, hit Ctrl+Z to undo and try again.

After doing that, you should have a very clean keyed out video that looks like this.

If you’re happy with the result, you can move on to Step 3 but I’m going to fine tune the video just a little more using some settings. There’s no default way to do this but I will show you the settings I adjusted to refine the quality.

In the Image tab, I adjust Spill Methed, Fringe Gamma, and Fringe Size to the above settings.

In the Matte Tab, I adjust Blur, Contrast/Expand, and Threshold to the above settings. Doing this took allow me to get a finished video like this.

Slight but way more refined.

Delivery Method

We’re almost, kind of, sort of done with these twitch alerts. At least this is the last step in Resolve. Navigate to the Delivery tab at the bottom.

From here, look at the left side panel called Render Settings and choose the below options.

Make sure to check “Individual Clips” if you’re doing more than one. Then Format must be Quicktime, GoPro CineFrom, and RGB 16-Bit or you won’t see the “Export Alpha” option. The Export Alpha option is what ties this whole thing together so it’s absolutely crucial that you have it check. Make sure quality is set to best. Also, go to the Audio tab and uncheck “Export Audio” as we’ll not be needing it. At this point you can hit “Add to Render Queue” then “Render All” over on the right side panel called “Render Queue”.

You should now have a .mov file that doesn’t play on anything at all as is completely useless! You’re welcome. Onward to step 4 to make Twitch alerts out of this useless file.

Prerequisite Software

This step for the alert process is pretty simple. However, you do have to install some stuff. Don’t worry, I’ve tied it all together for you so that the process is extremely painless. You’re going to need FFMPEG to do the conversion process and you’ll need Chocolatey to easily install and maintain FFMPEG. Both are open source and wildly popular in the FOSS community. Chocolatey is a windows package management software that operates in command-line while FFMPEG is a command-line video conversion tool that’s so powerful, even Davinci Resolve uses part of the code in there rendering process. Lucky for you, I’ve put together an easy copy/paste command that’ll install both of them together. Open Powershell as an admin (Right click -> Run as Administrator) then paste this.

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install ffmpeg -y

This command should install Chocolatey and continue into the FFMPEG install. If all goes according to plan. you should be able to type “ffmpeg” in your Powershell window and see this response.

PS C:\> ffmpeg
ffmpeg version 4.4-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

This means FFMPEG is install and you’re ready to go! If you don’t see that, try restart the Powershell window then typing “ffmpeg”. If you STILL don’t see it, comment below and I’ll do what I can to help you.

Tying it All Together

You ready? This, I’m happy to inform, is the easiest part of the whole process. First, make sure to have the Powershell window open as an admin. Next, navigate to the directory where you’re files are located using the CD command. Such as, if you stored them in your default video location in a folder called “Alerts” you’d type this out.

cd C:\Users\Person\Videos\Alerts

From here, you’re going to type the below command and watch the magic happen.

ffmpeg -i Alert-Before.mov -c:v libvpx-vp9 -pix_fmt yuva420p Alert-After.webm

To understand what we’re doing:

  1. ffmpeg – Calls the ffmpeg program
  2. -i Alert-Before.mov – Specifies which file you want to convert
  3. -c:v libvpx-vp9 – Desinates the Codec to use
  4. -pix_fmt yuva420p – Formatting
  5. Alert-After.webm – Output File name/type

You want to make sure the file type is .webm as this is what Streamelements and Streamlabs use for the Twitch alerts.

If all goes well you should end up with something like this!

Congratulations!

Tada! Invisible background and all. You’ve successfully made a Twitch alert from a greenscreened video. All that’s left to do is implement them in to StreamElements or Streamlabs into alerts. If you’d like help with that, you can check out THIS article for help.

Rating: 5 out of 5.

Leave a Reply

Your email address will not be published. Required fields are marked *