Categories
Tech Explorations

Building a better Elgato Game Capture HD

Back in 2015 I got myself a brand new Elgato Game Capture HD. At the time, it was one of the best capture cards on the consumer market; it has HDMI passthrough, Standard definition inputs with very reasonable analog-to-digital converters, and decent enough support for a range of different setups.

Despite its age, I still find it very handy, especially for non-HDMI inputs, but the original design is saddled with flaws which prevent it from taking advantage of its entire potential. This is how I built a better one.

Using this card in the field

After a few months of using it to capture PS3 footage and even making some crude streaming setups for small events using a camera with a clean HDMI output, two very big flaws were quickly apparent: First, the plastic case’s hermetic design and lack of thermal management solutions made it run really hot, which after prolonged operation resulted in dropouts which sometimes required disconnecting and reconnecting the device and/or its inputs, and second, the SD inputs are very frustrating; the connectors are non-standard and the dongles provided are iffy and don’t even allow for taking full advantage of its capabilities without tracking down some long discontinued accessories.

My first modification to it was rather crude: after it failed on a livestream, I took the Dremel to it and made a couple of holes for ventilation, coupled with an old PC fan that I ran using USB power (the undervolting of the fan provided enough cooling without being deafening). This obviously worked, but it introduced more problems: the card now made noise, which could be picked up by microphones, and it now had a big gaping hole with rotating blades that was just waiting to snatch a fingernail. This wouldn’t do.

Solving thermal issues

It quicly became clear that the original case for the Elgato Game Capture HD was a thermal design nightmare: it provided no passive cooling, neither by having heatsinks or vents. The outer case design was sleek, but it sacrificed stability on the way.

This device is packed with chips, all of which provide different functions: HDMI receivers and transmitters, ADCs, RAM, and many other glue logic parts, which meant that power consumption was going to be high. Having a custom LSI solution or even using FPGAs could have been better in terms of power consumption, but this is often way more expensive. Amongst all of the ICs, one stood out in terms of heat generation: a Fujitsu MB86H58 H.264 Full HD Transcoder. This was doing all the leg work in terms of picking up a video stream and packaging into a compressed stream and piping it through a USB 2.0 connection. It’s pretty advanced stuff for the time, and it even boasts about it’s low power consumption in the datasheet. I don’t know exactly why it runs so hot, but it does, and past a certain threshold it struggles and stutters to keep a video signal moving.

There was nothing worth saving in the original enclosure, so I whipped up a new one in Fusion 360 which includes many ventilation holes, and enough space above the chip so I could add a chipset heatsink from an old motherboard. I stuck it down with double sided tape, which is not particularly thermally conductive, but along with the improved ventilation is enough to keep the chip to frying itself to oblivion. I ran another protracted test, and none of the chips got hot enough to raise suspicion, and even after three hours of continuous video, the image was still being received appropriately. I initially though there could be other chips in need of heatsinks, but it appears that the heat from this transcoder was the one pushing it over the edge, without it the other ICs got barely warm.

Since we made a new enclosure, let’s do something about that SD input.

Redesigning the SD video inputs

This card hosts a very healthy non-HDMI feature set: It supports composite video, S-Video, and Y/Pb/Pr component video, along with stereo audio. The signal is clean and the deinterlacing is perfectly serviceable, which makes it a good candidate for recording old gaming consoles and old analog media like VHS or Video8/Hi8. However, Elgato condensed all of these signals into a single non-standard pseudo-miniDIN plug, which mated with included dongles. Along with a PlayStation AV MULTI connector, it came with a component breakout dongle which allowed any source to be used. With the included instructions you could even get composite video in this way. S-Video however was much more of a pain; while it was possible to connect an S-Video signal straight into the plug, it left you without audio, and the official solution for this was to purchase an additional dongle which of course by the time I got it no one had.

To solve it, I started by simply desoldering the connector off the board. I saw some tutorials on how to modify S-Video plugs for the 7-pin weirdness of the Elgato, and even considered placing a special order for them, but in the end I realized that it was moot. The dongles sat very loosely on the connector, and any expansion I wished to make on it was going to be limited by that connector, so I just removed it.

To the now exposed pad, I soldered an array of panel-mount RCA and S-Video connectors I pulled out of an old projector, so I could use them with whatever standard I pleased: three jacks for Y/Pb/Pr component video, a jack for S-Video, a jack for composite video, and two jacks for stereo audio, complete with their proper colors too. The SD input combines the different standards into a single three-wire bus: Pb (component blue) is also S-Video chroma (C), Pr (component red) is also composite video, and Y (component green) is S-Video Luma (Y), so the new connectors are electrically connected to the others, but for simplicity I much prefer it to having to remember which one is which, or having to keep track of adapters for S-Video (which I use a lot for old camcorders).

Final assembly and finished product

After printing the new enclosure I slotted in the board (it was made for a press fit with the case, to avoid using additional fasteners), and soldered the new plugs to the bare pads of the connector using thin wire from an old IDE cable. The connectors were attached to the case using small screws, and the design was such that all of the connectors were on the bottom side of the case, which meant no loose wires. The top stays in place using small pieces of double sided tape and some locating pins, which makes dissassembly easy, great for future works or just showing off.

I wish this was the product I received from Elgato. It allows the hardware to work to its true potential, and it makes it infinitely more useful in daily usage. No more faffing around with dongles, no more moving parts, or dropouts on a hot day. It feels like this was what the engineers at Elgato envisioned when they came out with this thing. The Elgato Game Capture HD is now my main non-HD capture device and even for HDMI stuff it still gets some usage, when I can’t be bothered to set up the ATEM switcher.

Finishing thoughts

I love the Elgato Game Capture HD, both for what it is capable of doing and what it did to the nascent streaming and video creation scene back in it’s day. I love its featureset and I’m even fond of its quirks, but with this mod I feel like I have its true potential available without compromises. It changed its place in my toolkit from a thing I kinda know how to use that stays in the bottom of my drawer to a proven and reliable piece of equipment. If you have one of these devices and feel unsatisfied with its performance, I urge you to give it a try, you will no doubt notice the difference and maybe you’ll keep it from going into the bin.

Categories
Tech Explorations

RTMP systems for multistreaming

Given the current events, livestreaming has become an enticing alternative for giving some continuity to many activities that otherwise would not be possible during these difficult times. However, creating a professional quality setup for broadcasting live events is quite a challenge, especially because until just about a decade ago, the idea of creating a live TV studio in your bedroom was ludicrous to say the least. If you’re working with large groups of people, consider it a powerful tool to reach out to your audience.

This post is going to narrate the hoops I went through in the process of creating such broadcasts with professional quality and a relatively friendly budget in mind, as well as explaining a bit how livestreaming works, and how everything ties together for creating both creative and functional livestreams.

I: The gist of it all

Pretty much every social network worth its salt has some sort of livestreaming capability built in, ranging from the gimmicky to studio quality. For the purposes of this article, we’re going to be focusing on three: Facebook, Instagram, and YouTube, as they’re the ones I usually broadcast in.

  • YouTube is pretty much a pioneer on the subject, introducing one of the first livestreaming services available for everyone to use, and has pretty much everything nailed down at this point, providing a stable and reliable platform for pretty much every scenario.
  • Facebook also has a pretty solid platform for livestreaming, and it’s a personal favorite of mine because it will process and transmit pretty much everything you throw at it.
  • Instagram is the most frustrating one to work with, as it does not officially support broadcasting outside of its mobile app, and as such provides plenty of head scratching and hair pulling during the setup process.

Regardless of platform, pretty much every livestreaming service out there works using the Real-Time Messaging Protocol (RTMP), originally developed by Macromedia and now maintained by Adobe. The standard is (mostly) open and it works great, so it’s to be expected that everyone is using it. However, it does not specify a video standard per se, so you can send pretty much anything you want (this will be a problem later). RTMP works by using a streaming server address and a streaming key to connect and begin the transmission, which are different for each platform and are provided by them when you begin a livestream. Depending on the site, the stream key changes for each stream or after a set time, be mindful to keep them up to date.

For any livestream, there are four basic links in the chain that make it work. The chain is only as strong as its weakest link, so all of them must be reasonably balanced to get good results; these are Capture Hardware, Video Processing, Restreaming and Internet Connection.

II: Capture hardware

This is the first link of our broadcast chain, and involves everything needed to capture video and audio data that will go in your livestream. Integrated webcams are the default (and sometimes only) option for many people, but I decided against them mainly because of their poor quality; low framerates, issues with exposure, noisy output, etc. Modern external cameras like the ones offered by Logitech are a good alternative -ignoring the cheaper ones which often suffer from the same issues- you can easily get 1080p at 60fps with them, but since I don’t own one, I went with my preferred method, a video camera and a capture card.

For this method you can use whatever camera as long as it has a clean video output (avoid the ones that show all the controls and menus through the video output) and whatever capture card capable of processing the desired resolution. In my case I used a Panasonic HDC-TM700 portable video camcorder and an Elgato Game Capture HD USB capture card (a beaten old warhorse, and a story for another time.). Both are over five years old at this point, but I can still get a clean and reliable 1080p/30fps video into my broadcasting software with no issues. Both companies offer newer products that can be used instead, and as long as you have a compatible setup, you’ll be fine with whatever you can find.

For audio capture, you can use the audio straight from the camera’s microphone or, as I did, use an external audio interface to plug in dedicated microphones. I used a M-Audio Fast Track C600 audio interface (which I actually got for free, I’ll write about that adventure at some point) which works great, but requires a bit of a workaround, as probably most multichannel audio interfaces will. This gave me a clean sound and four mic channels for plugging whatever I want.

III: Video processing

Now that we have all the AV equipment set up its time to set up the software. I use good old OBS for it, because it’s light on system resources (a must for me running it on a laptop) and pretty much endlessly customizable. This is not a tutorial on how to use OBS, -and there are many of them out there who could explain it way better than I ever could- but it’s basically a video editor but live. you can have different scenes and switch between them, mix different audio sources, capture windows or screens, add text and graphics, and much much more. For me, I also had to install the Elgato Game Capture app which includes the drivers for my capture card, which work right out of the box with OBS as a video source. I also installed the OBS ASIO plugin to connect to my audio interface, as it provides low-latency and stable performance (drivers for de C600 are a bit janky, and ASIO gave me the least glitches.). For multichannel interfaces this is a must, because while OBS supports 2+ channel audio, it will not give independent control of each channel without it. I also added a window capture, which worked perfectly too (although beware if you have switchable graphics when capturing screens/windows, they are known to be a pain to set up).

Before we move on, we need to talk about video resolution aspect ratio. Because RTMP does not specify said parameters, each platform works in its own way, and has its own set of rules. Facebook is the most forgiving of all, allowing pretty much any resolution at whatever aspect ratio, vertical or horizontal. YouTube on the other hand, will only work with horizontal 16:9 video, and will complain about any resolution other than 1920×1080 (although it will still work), filling the screen by scaling up the video stream if it doesn’t match with the widescreen aspect ratio. Instagram will do the same, only this time it exclusively supports vertical video, and will scale up the video if you give it anything other than 9:16 video, losing everything but a sliver of video. For my setup, horizontal video made the most sense, so we were careful to frame the most important parts on that small sliver, but we still lost some important parts of the video. It might be possible to reprocess the video to remediate some of these issues, but not having the entire frame on Instagram was a reasonable compromise for me.

IV: Restreaming

As the title implies, we want to do multistreaming -also known as simulcasting- which means to transmit to multiple platforms at the same time, a task which OBS does not handle natively (you can run multiple instances of OBS with the -multi argument, but video capture devices and webcams will not allow you to use more than one stream at a time). A few comercial alternatives are available to solve this issue, such as Restream.io which is free for some platforms (but not for Instagram, which was a dealbreaker for me) and a limited number of streams. This left me with the predicament of having to set up my own restreaming server.

For this task I used NGINX, a ubiquitous, open source web server software which is -depending on who you ask- the most used web server on the Internet. Fortunately for me, someone had already made an RTMP module for NGINX which worked perfectly (all credit goes to this amazing post on the OBS forums detailing how to make it work). I ran the server on a Raspberry Pi 3B+ which was more than enough to make it work (the restreaming server doesn’t do any sort of processing, it just forwards the incoming stream to the desired servers). In theory you could run it on the same machine used for video processing, but I found NGINX for Windows to be very confusing and difficult to install, whereas the Linux (Raspbian Lite) install and configuration was very simple and straightforward.

Remember when I said that every streaming server used the same protocol? Well, that’s not entirely correct. While it’s true that all three platforms use RTMP for moving the stream around, only YouTube uses the standard protocol on port 1935 (the default port for RTMP), while Facebook and Instagram use RTMPS, which is just the standard RTMP protocol over an SSL tunnel on port 443. This complicated matters a bit because the RTMP NGINX module does not support RTMPS natively, so we now need to encapsulate the Instagram and Facebook video feeds on a secure tunnel.

This is where STunnel comes in. STunnel works as an SSL/TLS proxy, grabbing whatever data we throw at it and encrypting it before sending it back on its way to the target servers. This page helped me get it up and running with NGINX. Now that all the protocols are in order we can actually attempt a connection with the servers.

V: Internet connection

Now that everything is set up on our side, we need to connect to the streaming platforms. Before that though, make sure you have a stable internet connection (Ethernet is your best choice here, Wi-Fi can be very unstable and low speed in certain scenarios), and that your upload speed is greater than the OBS transmit bitrate (2500 kb/s by default) times the amount of streams you are going to simultaneously stream to.

For exact instructions, follow the tutorials listed above or check de OBS forums for help. For Facebook and YouTube is just a matter of copying and pasting the stream keys from their respective streaming menus and you’re on your way, but once again Instagram is going to put up a fight. For one, as we said earlier, Instagram does not officially support RTMP streaming, so we need to use software like YellowDuck that will trick Instagram into believing that it is receiving an RTMP transmission from a phone, the actual supported and official way of doing it. A quick note on any software or website designed to to this: logging in is very finicky. Test the stream beforehand with the actual account you want to use, to avoid screw-ups when the real time comes.

VI: Closing thoughts

After reading all of this, you might feel livestreaming to be a near impossible task but remember, most of the setup required has to be done only once, weeks in advance. after that is just a matter of keeping the stream keys up to date and making sure everything is working.

In dire times like this, streaming often brings a sense of community that not many other technologies can provide. It allows us to see a face, to feel like we’re part of something bigger. If you are in charge of anything that deals with people, please try to introduce it as a new way of reaching out to people, even after all of this is over. Good luck and happy streaming!