sigrid/rtmp

Description
# 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 -b </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 (make sure you have latest 9front):

	audio/mixfs -s mixfs -m /n/mixfs
	# this already binds on top of /dev/audio in that window

	# in another window, provide silence so there are _always_ samples available for aacenc
	mount /srv/mixfs /n/mixfs
	dd -bs 8192 -if /dev/zero -of /n/mixfs/audio

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

You can also mix in audio from the microphone by mounting mixfs and
writing PCM data from your phone to `/n/mixfs/audio`.
Last 5 commits (shortlog)
Date Author Short message Commit hash
2021-08-22 Sigrid readme: update for mixfs a73d1bc55bf8d60f5cdd23c0f99080024a4c5f72
2021-08-22 Sigrid add -A option to specify audio offset (-200 for audio delayed by 200ms) c9a45262d2655e843fcc0ad7382f08efcc523926
2021-08-22 Sigrid readme: aacenc: use -b 7d4898f6656fd7c060bb27c0b10d6735a1f76337
2021-08-22 Sigrid adts: fix size parsing af0838b8929fb0168353e434eb2b21e8b1ccc9ad
2021-08-14 Sigrid audio: don't write random crap (GASpecificConfig that makes no sense) 1b64b3b2c2655063d8fb5aa2736316387a549d93
Files (browse)
LICENSE
README.md
adts.c
adts.h
amf0.c
amf0.h
ivf.c
ivf.h
main.c
mkfile
rtmp.c
rtmp.h
util.c
util.h