My Streaming Setup
In April and May I did some streaming on twitch of hardware hacking projects . I started this as a way to work through the material for my cancelled BSDCan hardware hacking tutorial. With the tutorial cancelled I have been left with quite a few NanoPi Neo LTS and I was thinking about doing the tutorial as a series of videos with the idea of selling intro kits with the boards.
So far I have done four streams aiming for about an hour for each. I will say now that I haven't streamed again in June, I am not saying it is the end, but I (and I bet you too) need to control my commitments or I just never get anything done.
- An Introduction to hardware hacking with FreeBSD
- Crime against computers 3
- Bitbanging from shell scripts part 1
- Driving APA102 LEDs from FreeBSD
I have also been asked to write up my streaming set up so other people can use it. This vanity pic I tooted seems to include most of it.
Equipment
I have a bunch of equipment because I want to stream stuff in the real world. If you just wanted to share some windows and your webcam as Kristof Provost does then you can get by just with your laptop.
- Canon 600D
- Nikon J1
- MacBook Pro 13,1 for streaming
- Zoom H3 microphone
- Aputure AL-M9 Mini LED Light
- Tripods for the cameras
- An arm for the microphone
- LKV373 HDMI as a capture device for a camera
This is quite a lot of stuff, but other than the Aputure light I had all of it already from other projects. I would like to be able to capture the display of my work oscilloscope, thankfully the scope has VGA out so it is just a matter of figuring out a way to capture.
Software
I am using Open Broadcast Studio (OBS) on macOS to mix video and feed it to twitch.
OBS supports a rich variety of input sources that can mixed to make a scene. I have been using three scenes to make it easy to setup what is streamed in advance:
- Everything
- Just the camera
- Just the presentation
Everything is the mixed view of my terminal, the camera output and the slides in a web browser. My tutorial slides are derived from my EuroBSDCan Tutorial and render in a web browser natively. Having a browser in the video mix quickly turned out to be really helpful.
OBS has been rock solid and I have had no problems with stability while streaming. The interface is a bit of a maze, but I suspect that is a natural result of the power it offers.
Canon Camera
For most of the top down shots I used a canon 600D with a 18-55mm kit lens. The battery in this thing is quite old and only manages about an hour and a half of video output. I have since gotten a USB powered battery insert that should allow me to run forever, but am yet to try streaming with it.
My canon camera does not support acting as a webcam, but
gphoto2
does support
grabbing live video from it. This should have been easy to feed into OBS, but I
couldn't get it working and ended up instead using
ffplay
to render the video
and grabbed that with a video capture. To get video from
gphoto2
into
ffplay
I ran:
gphoto2 --stdout --capture-movie | ffplay -
This turned out to be very stable and easy to set up. There is quite high
latency between the capture output and the
gphoto2
capture, but it worked
fine if I didn't have to move the camera much.
Nikon Camera
I also have a Nikon J1 and while the camera is awful to use I do have a 10mm lens for it with a macro extender. This allows me to take very high detail pictures of PCBs. I wanted to add this to the streaming set up too.
The Nikon firmware is garbage and while
gphoto2
does support the camera I
found I could only get a single image from the camera before having to reset it
and was completely unable to get video from it. Never mind, my
2018 EuroBSDCon
Talk
used a HDMI network extender as a capture device. In the stream
Crimes Against Computers3
I did something awful with a BeagleBone
Black and got video from the Nikon through the HDMI extender into OBS.
This was a lot of faff to setup (though I since did get a USB-C Ethernet for the MacBook) and I am still kind of dubious of the stability of the LKV373 so I have only used this in the stream where I figured it out. I might try this again later.
Since doing that stream cheap USB2 and USB3 HDMI capture devices have appeared. These are supposed to appear as UVC webcams to the system. I suspect these will be a better method than the LKV373, but I want to try before recommending them.
Audio
For audio I am using a Zoom H3 dictaphone thing. I really like the audio from the Zoom, but I seem to be in the minority. In the end it is the microphone I have.
It is stereo which should be mixed down or you will drift across the channels when you move your head. OBS supports this so it wasn't a problem, but I did have to be told about it.
The firmware for this thing isn't so great either, it cannot record to the Micro SD card while acting as a USB interface and Annoyingly there is a bug where it defaults to 44KHz for the audio. The USB driver doesn't seem to advertise this to the properly and if you continue with the default you get weird audio. I dealt with this before in FreeeBSD , but was surprised to see it appear in macOS. You should always double check your audio before starting a stream.
Why not stream from FreeBSD?
I wanted a pain free approach where I could set up and go for my first streams so while OBS is ported to FreeBSD I expected it to be a lot more work than the much more common macOS/OBS combination. I expect FreeBSD/OBS support to get better if people continue streaming FreeBSD stuff.
The MacBook is similar specs to my Thinkpad, but the wireless card in the Thinkpad doesn't have great support and only manages 80211g rates. That might just be enough to stream out the video, but it seems very risky to me.
I will look at streaming with OBS from FreeBSD in the future.
The streams have done okay so far, there is a big social media boost network of FreeBSD users and developers and that has helped people find the content. I am sure the next stream will have fewer viewers as there has been a gap in my streaming.
You can support this
Finally, I set up a ko-fi page to support me writing and streaming. I plan to write more this year and if there is interest I will do more streams too. The streams so far have mostly been using equipment and parts I already had. Doing more is going to require me spending money.
If you have enjoyed my streams, or if you just want me to do more a very solid signal of your support would be tipping me a cup of coffee or something through ko-fi. You can support my hardware habbit here .