I have heard about OBS several times before and I always wanted to try it. Recently I got asked by a developer to use OBS to provide remote access to an HDMI signal. I am a happy user of a cheap HDMI to USB capture card for a long time but so far I have only used it with Camera application running directly on Android or ChromeOS host where it was connected to. Fortunately OBS is supported by Raspberry Pi OS:
jordana@pi4g:~ $ apt search obs-studio
Sorting... Done
Full Text Search... Done
obs-studio/stable,now 29.0.2+dfsg-1+b1 arm64
recorder and streamer for live video content
Here came the first issue by launching OBS I bumped into this error message:
It did not take too long to find that we need an environmental variable to set on Raspberry Pi 4 and Raspberry Pi 5 so from command line it looks like this:
I have bought a new HDMI capture card for this excersize from Amazon. To make it work, I only had to add it as a v4l2 video capture device as source and restart OBS. As during first time install OBS asked for a stream key I created an account on Twitch to get a stream key. Streaming via Twitch was also working more or less - althought I had to reduce framerate and resolution and it remained barely watchable. I guess the Raspberry Pi 4 with software only encoding is struggling with Motion JPEG source from the HDMI capture card. The delay was also excessive for the use case I had hence ultimately I will not use OBS let alone streaming but it was definitely a nice encounter with OBS.
Another ask from the developer was how to extend IR remote control over the network. While I am still playing with the idea there was a nice workaround possible to extend USB keyboard over the network. After some research, it turned out that OTG functionality in Linux have a usb gadget mode that does exactly what I need here. After a couple of unsuccessful tries I found this DIY PiKVM v2 in this github repository. As I have a couple of spare pi02w that supports OTG functionality and I only needed keyboard functionality I flashed the corresponding image on an SD card and added wifi password to pikvm.txt in PIBOOT partition. Please note that I did not have to escape \ in my Wifi password as in the guide for whatever the reason is. The nice feature of a pi02w is that its power consumption during light use largely remains below 5V/500mA standard USB 2 specification hence it can be a direct substitution of a USB keyboard where pi02w is only powered via the USB port itself. I have also added remote Tailscale access for this Pi KVM project that is beautifully integrated on my Chromebook with an Android app as such can nicely co-exist with Zerotier installation in the Linux subsystem Crostini.
UPDATE
After a while I started to have instable wifi connection to my Pi Zero 2 W. I added the following one line pikvm.txt to PIBOOT:
ENABLE_OTG_SERIAL=1
This way I could connect from a Pi 4 as follows:
Adding one line to this config file resolved my connection issue:

No comments:
Post a Comment