Streaming on Linux using Elgato Game Capture HD and OBS Studio
(Some of these packages may already be installed on your system.)
Preparation — Part one: Downloading the driver from github
The second step is to download the driver from github. Do so by entering the following command in a terminal:
This should download the driver files to a folder named «elgato-gchd» within your «Home» folder.
Preparation — Part two: Obtaining the Elgato firmware
The next step is a bit tricky, as it involved extracting the propriatary Elgato firmware from the official Mac driver. But if you follow the instructions carefully, it will be a quick and easy exercise.
- Download the Mac version of the official Elgato Game Capture HD driver, version 2.0.3. (direct link to the driver). To download it to your home folder using the command line, enter the following in the terminal:
If this process completes without error the driver should be ready for use. If there is an error, that is likely because either (a) you did not install the dependencies and build tools or (b) you didn’t extract the firmware from the Mac driver correctly.
Starting (and stopping) the driver
Before starting the driver you will first need to plug in your Elgato Game Capture HD. Then open a terminal and navigate to the folder where the driver executable is located:
PS: It is important that you leave this terminal open when the driver is running. If not, the driver will be terminated.
The driver should autodetect the signal received. If it does not, or if the colors are off, you might need to tell the driver what resolution and color mode you want to capture. Read the driver’s README for more information about this (available on the driver’s GitHub page)
The Video Output and How to Use It
When the driver is running, it streams the video captured to a FIFO pipe (a virtual file) which is located here:
Since this is a virtual file it will not grow. You need to use another piece of software to actually view, record or stream the captured video. For just viewing the video you can use VLC. To record or stream you can use OBS Studio.
Please note that the driver does not properly «kick in» before you open the /tmp/elgato-gchd.ts with an application. It may therefore take a few seconds from opening it until you actually see video output.
When you are done using the driver, close the /tmp/elgato-gchd.ts file. Then stop the terminal where the driver is running by pressing «Ctrl + C» on your keyboard. Please wait for the driver to successfully terminate. The driver is resetting your device, it may take a while (30 seconds). If you interrupt this step, it will leave your device in an undefined state and you will need to manually reset your device by reconnecting it.
Adding the Elgato Game Capture HD to OBS Studio on Linux
This final part of the guide will describe how you can add the driver’s output to OBS Studio, so that you can stream and/or capture it.
- Install obs-studio (if you don’t already have it) by entering the following commands into a terminal:
www.makeuseof.com
Follow MakeUseOf.com
Getting Started With Video Game Live Streaming on Linux
Video game live streaming rose to prominence with the popularity of platforms like Twitch, but how can you stream your game play from a Linux computer?
Video game live streaming rose to prominence with the popularity of platforms like Twitch. Watching video games remained popular since the inception of games. However, the this eventually evolved into a spectator sport. Arcades once reigned supreme as an arena for game watching. Yet the rise of the internet launched game live streaming.
As we enter our month of gaming giveaways, it seems only appropriate that we look at the delicate art of live streaming PC and console games. Although it’s difficult to understand why anyone would want to watch strangers playing games, I have to be completely honest and say I found BanadanRob’s SimCity sessions quite compelling (at least until I bought the game myself). The first thing you’ll need to start streaming is an account over at Twitch.tv.
Esports became legitimized over time. Even ESPN covers esports. Video game live streaming offers a fun means of broadcasting your skill or lack thereof. Additionally, there’s potential to earn an income. Because of support from the likes of Steam, Linux is a thriving gaming landscape.
These Windows and console games are natively available for Linux now. Additionally, Wine allows further Windows game installs on Linux. Learn how to get started with video game live streaming on Linux!
Video Game Live Streaming Software
You’ll first need software to stream with. Open Broadcaster Software (OBS) is an excellent choice. It’s free, open source, and cross platform. OBS boasts Windows, Mac, and Linux compatibility. You can read more about OBS on other operating systems and set up.
Head over to the OBS Download page and select the Linux installer. Open Broadcaster Software for Linux is officially compatible with Ubuntu 14.04 and higher. Therefore, OBS should install properly on Ubuntu derivatives such as Lubuntu and Xubuntu.
Installing FFmpeg
Open Broadcaster Software requires FFmpeg to run. Ubuntu 15.04 includes the correct repositories for installing FFmpeg. However, Ubuntu 14.04 and below requires adding the correct PPA.
Installing FFmpeg on Ubuntu 14.04
If you’re using Ubuntu 14.04 LTS, you’ll need to add the specific PPA. Open a terminal (Ctrl + Alt + T) and enter the following command:
You’ll be prompted for your password. Next, enter your password when required. After adding the PPA run an update and install FFmpeg:
Installing FFmpeg on Ubuntu 15.04
FFmpeg is included in the official repositories on Ubuntu 15.04 and up. So if you’re using Ubuntu 15.04 or a following iteration, simply enter:
Proceed with installing OBS now that FFmpeg is loaded.
Installing Open Broadcaster Software
You’ll use the command line to install Open Broadcaster Software. Open a new terminal and add the PPA:
Enter your password when prompted to finish the adding the PPA. Install and update OBS with the following command after you’ve added the PPA:
Unofficial Open Broadcaster Installations
Open Broadcaster Software only offers official installations for Ubuntu and its derivatives. Additionally, you can unofficially install OBS on several Linux distros. These include Arch Linux, Fedora, and Manjaro.
Manjaro
You can install OBS on Manjaro by searching Octopi or the Pacmac Manager for «obs-studio.» Alternately, install using the command line:
Arch Linux
Open a terminal and enter:
Fedora
Fedora offers an unofficial installation. You’ll need to configure RPM Fusion first. To configure RPM Fusion, enter:
Proceed with installing OBS using this command:
If you’re using NVIDIA hardware accelerated encoding, there’s an additional step. Ensure that CUDA is installed:
Reliability will vary on unofficial distros. Probably Ubuntu lends itself best to OBS. Nevertheless, unofficial workarounds do exist.
Configuring Open Broadcaster Software
Now you need to configure Open Broadcaster Software for video game live streaming. We’ll explore adding scenes, screens, and sources like mics and webcams. Launch Open Broadcaster Software. Look in the lower left corner of the screen. You’ll see a box labeled Scenes. Click on the + symbol to add a new scene.
Adding a Screen
OBS issues a pop up that says Add Scene. There’s a box and a prompt to «Please enter the name of the scene.» I named my scene «Steam» as I’ll use this for video game live streaming from Steam.
Скачать OBS Studio
OBS Studio (Open Broadcaster Software) — это бесплатная программа на русском языке для записи видео и стримов на Twitch, YouTube, GoodGame, SC2TV, Hitbox.TV и любые другие RTMP-серверы трансляций.
Доступны версии для Windows, mac OS X, и Linux.
Также вы можете собрать OBS Studio вручную из открытого исходного кода.
Скачать OBS Studio для Windows
Файл | Размер | Время публикации | Загрузки |
---|---|---|---|
OBS-Studio-25.0.8-Full-Installer-x64.exe x64 установщик | 70.08 MB | 27.04.2020 02:27 UTC | 171 884 |
OBS-Studio-25.0.8-Full-x64.zip x64 zip (portable) | 93.31 MB | 27.04.2020 02:27 UTC | 40 089 |
OBS-Studio-25.0.8-Full-Installer-x86.exe x86 установщик | 66.78 MB | 27.04.2020 02:26 UTC | 84 205 |
OBS-Studio-25.0.8-Full-x86.zip x86 zip (portable) | 88.07 MB | 27.04.2020 02:27 UTC | 17 404 |
Поддерживаемые ОС Windows (32 bit и 64 bit):
- Windows 10
- Windows 8 and 8.1
- Windows 7
Скачать OBS Studio для mac OS X
Файл | Размер | Время публикации | Загрузки |
---|---|---|---|
obs-mac-25.0.8.dmg Установщик OBS Studio для mac OS X | 111.06 MB | 27.04.2020 02:54 UTC | 39 076 |
Скачать OBS Studio для Linux
Ubuntu Linux
Требования
На Ubuntu 14.04 требуется FFmpeg. Если он вас не установлен (если вы не уверены, то скорее всего у вас его нет), то вы можете установить FFmpeg его при помощи следующих команд:
Установка OBS (Ubuntu 14.04 или новее)
Вы можете установить OBS Studio при помощи следующих команд:
Удаленная установка операционной системы без KVM over IP
Бывало ли у вас так: вас нет на работе, операционная система у сотрудника слетела и средства удаленного администрирования, которые так вас выручали, становятся бесполезными. Или вы пытаетесь объяснить по телефону, какой пункт меню BIOS отвечает за приоритет загрузки, а собеседник совсем не владеет английским, и разговор превращается для обоих в пытку.
Есть много способов решения проблемы: тот же KVM over IP (относительно дорого), разделение разделов с системой и данными с последующим стиранием раздела системы в случае сбоя, загрузочные носители с Live дистрибутивом для временной работы, PXE-сервер и т.д.
Я предлагаю еще один способ — собрать устройство, наподобие KVM over IP (передающее нажатия клавиш и изображение по сети) своими руками.
Закупка
- Плата видеозахвата. В моем случае AVerTV Game Broadcaster HD. Она поддерживает D-SUB, HDMI, DVI (через переходник на HDMI)
- Arduino совместимая плата с возможностью эмуляции клавиатуры. Я использую клон Arduino Leonardo, но это не единственная плата с такой возможностью.
Плата видеозахвата оказалась low profile и мне удалось уместить ее в соответствующий корпус Exegate MI-213. Тут я продешевил. После пары месяцев работы в блоке питания сломался вентилятор, который оказался нестандартным (8х8, но узкий), и его заказ из Китая сопоставим с ценой всего корпуса. С другой стороны корпус мне понравился тем, что в него влезла ATX-материнка (с 4-слотами). В общем решайте сами. Для моих целей корпус вполне подошел. И после небольшой работы болгаркой, мне удалось впихнуть стандартный вентилятор 8×8 с небольшими потерями товарного вида корпуса.
Программная часть
Всё достаточно просто: подключаем «агрегат» вместо монитора и контролируем компьютер с помощью Arduino Leonardo, притворяющегося клавиатурой.
Реализация пока сыровата, но вполне работоспособна.
Есть желание написать программу, которая будет взаимодействовать с WDM-драйвером, но пока захват выполняется стандартной утилитой AVerTV. Она может настраивать разрешение захвата, в отличии от VLC и других плееров, которые тоже получают картинку, но на минимальном разрешении.
К сожалению кроссплатформенность упирается в отсутствие драйверов под Linux. Есть какие-то драйвера, но после отправки письма выяснилось, что они продаются только для корпоративных клиентов.
Код для отправки нажатий клавиш написан на Java, использует кросплатформенную библиотеку JSSC и представляет из себя почти прозрачную форму, которая открывается поверх утилиты, получающей видеопоток.
Код для Arduino пока достаточно прост. Надо что-то придумать насчет обработки клавиши Shift, но пока, нижнего регистра мне хватает, хотя может возникнуть ситуация, когда понадобится ввести пароль и без верхнего регистра не обойтись.
Железячная часть
Я использовал USB ->Serial переходник, т.к. писал код для Arduino на ноутбуке (именно поэтому в коде открыватеся COM4). Ни что не мешает в финальной версии подключиться к порту, распаянному на материнской плате или к пинам на ней же.
Очень интересный эффект наблюдается, если подключить RX и TX контакты без «земли». Видимо наводки на USB превращаются в ложные пакеты и получается что-то в стиле Halt and catch fire (кстати, очень классный сериал). Компьютер обрабатывает лавинообразный поток нажатий клавиатуры, и вывести его из этого состояния можно только перезагрузкой. Само собой эффект не наблюдается, когда USB и последовательный порт (переходник) являются частью одного компьютера, т.к. «земля» у них общая.
Я припаял USB ->Serial переходник прямо к Arduino. Не обращайте внимания на цвет проводов, они нарощены. Мне повезло, китайцы не перепутали цвета, и в моем переходнике «земля» была желтой. TX-красным, RX-коричневым. Не забудьте, что к плате RX и TX соединяются наоборот. В современных материнках последовательный порт распаивают редко, хотя выводы на самой плате обычно есть. Пока экспериментируете лучше использовать переходник.