Skip to content
/ twinx Public

A twitch focused command line tool for producing, archiving and managing live stream content. Built for Linux.

License

Notifications You must be signed in to change notification settings

krisnova/twinx

Repository files navigation

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.

$ # twinx stream start <title> <description>
$ 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.

$ twinx rtmp start <optional host:port>
$ twinx rtmp start localhost:1719

Send the local stream to a remote backend such as Twitch or YouTube Live via the proxy command. You may proxy to multiple backends 🙂 at the same time.

# 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

# 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

About

A twitch focused command line tool for producing, archiving and managing live stream content. Built for Linux.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published