shithub: rtmp


branches: hj

Clone

clone: git://shithub.us/sigrid/rtmp gits://shithub.us/sigrid/rtmp
push: hjgit://shithub.us/sigrid/rtmp
patches to: sigrid on 9gridchan or oftc/#cat-v

Last commit

5745445b – Sigrid Solveig Haflínudóttir <sigrid@ftrv.se> authored on 2023/07/15 22:53
get rid of crap; run audio/aacenc ourselves with a small raw pcm buffer

About

# 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 /dev/audio 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 /dev/audio rtmp://....

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 /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`.