https://github.com/krisnova/twinx
A twitch focused command line tool for producing, archiving and managing live stream content. Built for Linux.
https://github.com/krisnova/twinx
Last synced: 5 months ago
JSON representation
A twitch focused command line tool for producing, archiving and managing live stream content. Built for Linux.
- Host: GitHub
- URL: https://github.com/krisnova/twinx
- Owner: krisnova
- License: apache-2.0
- Created: 2021-09-21T12:31:46.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-26T00:39:06.000Z (over 4 years ago)
- Last Synced: 2026-01-14T15:48:09.513Z (6 months ago)
- Language: Go
- Size: 11.1 MB
- Stars: 24
- Watchers: 2
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# twinx
```
████████╗██╗ ██╗██╗███╗ ██╗██╗ ██╗
╚══██╔══╝██║ ██║██║████╗ ██║╚██╗██╔╝
██║ ██║ █╗ ██║██║██╔██╗ ██║ ╚███╔╝
██║ ██║███╗██║██║██║╚██╗██║ ██╔██╗
██║ ╚███╔███╔╝██║██║ ╚████║██╔╝ ██╗
╚═╝ ╚══╝╚══╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝
```
`twinx` is a live-streaming command line tool for Linux.
It connects streaming services (like Twitch, OBS and YouTube) together via a common `title` and `description`.
### Overview
Use `twinx` to manage your streams.
This should be the first and last tool you use while live-streaming.
This will kick off a persistent standalone linux process that runs as a temporary daemon for the duration of the stream.
The daemon can then be interfaced with using the `twinx` command line tool.
You can add integrations and functionality to your stream after it has been started.
## Example
Use `twinx` to start a new stream on a Linux filesystem.
This will register your `title` and `description` for your new stream, and start the background process.
The title and description will be used as we work with various backends.
```bash
$ # twinx stream start
$ twinx stream start \
"How to hack the planet" \
"This is a live stream about how to hack the kernel to burn down capitalism"
```
Start an RTMP server. If no `host:port` is defined, `twinx` will select a port and listen on `localhost:1935`.
```bash
$ twinx rtmp start
$ twinx rtmp start localhost:1719
```
Send the local stream to a remote backend such as [Twitch](https://stream.twitch.tv/ingests/) or [YouTube Live](https://youtube.com) via the proxy command.
You may proxy to multiple backends 🙂 at the same time.
```bash
# Example Twitch
$ twinx rtmp proxy rtmp://jfk.contribute.live-video.net/app/{stream_key}
# Example YouTube
$ twinx rtmp proxy rtmp://a.rtmp.youtube.com/live2/{stream_key}
```
## Configuration
Twitch Callback URL Port: 1717
Environmental Variables
```bash
# OBS
export TWINX_OBS_PORT="1718"
export TWINX_OBS_PASSWORD=""
export TWINX_OBS_HOST="localhost"
# YouTube
export TWINX_YOUTUBE_API_KEY=""
```
## Permissions
`twinx` will manage RTMP servers, unix sockets, and gRPC servers and clients for you.
`twinx` requires root privileges to do this.
## FAQ
This tool is a reflection of being asked the following questions
> What are you working on today?
> Where is that video you did on
> What is this stream even about?
## Installing
Build the binary.
Install the binary.
```
./configure
make
sudo make install
```
Arch Linux dependencies
Note: We use `nginx-rtmp` instead of the module based package combinations.
```
protoc-gen-go protoc-gen-go-grpc
nginx-rtmp
```
#### RTMP Protocol Reference
- [Wikipedia Page](https://en.wikipedia.org/wiki/Real-Time_Messaging_Protocol)
- [How RTMP Works](https://ottverse.com/rtmp-real-time-messaging-protocol-encoding-streaming/)
- [What is RTMP](https://blog.pogrebnyak.info/what-is-rtmp-and-how-its-used-in-live-streaming/)
- [RTMP Spec](https://wwwimages2.adobe.com/content/dam/acom/en/devnet/rtmp/pdf/rtmp_specification_1.0.pdf)
- [NGINX RTMP Module Handshake C Source](https://github.com/arut/nginx-rtmp-module/blob/master/ngx_rtmp_handshake.c)
- [LiveGo](https://github.com/gwuhaolin/livego/tree/master/protocol/rtmp)