shithub: rtmp

ref: 139fd1d0439e7fc8e8672a371e4c53f7d609e431
dir: /README.md/

View raw version
# rtmp

RTMP streaming for Plan 9.  Tested with Twitch and PeerTube.  Can
stream to several RTMP urls at the same time.

## Usage (until I write a manpage)

	video/hj264 -f 25 /dev/screen | video/rtmp -a ... rtmp://.... rtmp://...

For how to use `rtmp` with Twitch, refer to the documentation they
provide.  All you need is the correct RTMP URL.  Preferably of a
server that is close to you, for lower latency, see [the list of
ingest endpoints](https://stream.twitch.tv/ingests).

To stream with audio from the microphone, make sure it works, you can
test it with [pitch](https://git.sr.ht/~ft/pitch).  Make sure
[audio/aacenc](https://git.sr.ht/~ft/aacenc) is installed.  Then run
this (change according to your preferences):

	video/hj264 -f 25 /dev/screen | video/rtmp -a <{audio/aacenc </dev/audio} rtmp://....

Twitch does not require an audio stream to be present. PeerTube seems to require it, so in case you don't want to stream audio to PeerTube, it's possible to use silence by passing `/dev/zero` instead of `/dev/audio`.

For audio loopback you can do the following:

Install kvik's `mq` and use it for audio:

	# in the window that produces the audio (a game or something)
	mq -s audio -m /n/audio
	touch /n/audio/audio
	bind /n/audio/audio /dev/audio

	# in another window, to be able to hear yourself
	mount /srv/audio /n/audio
	dd -if /n/audio/audio -of /dev/audio

	# streaming, third window
	mount /srv/audio /n/audio
	video/hj264 -f 30 /dev/screen | video/rtmp -a <{audio/aacenc < /n/audio/audio} $url