Just the Bros, Don’t Forget Your Crystal

Livestreaming

Description

The livestreaming service is intended to allow individuals to broadcast original content to a limited audience. Any abuse will result in a widespread ban. This service combines functionality from the NGINX RTMP module by arut, and ffmpeg.

Connection Details

Ingestion Endpoints

The relay endpoint makes no modifications your streams, while the transcode endpoint tries to make efficiency optimizations for viewers. Most streamers use the relay endpoint unless network conditions require transcoding, as the transcoding process adds additional latency and in some cases results in a lower-quality experience. See the Transcoding section for more details.

Relay Endpoint

rtmp://nginx.prenetic.com/relay

Transcode Endpoint

rtmp://nginx.prenetic.com/transcode

Stream Key

A unique string of alphanumeric characters is expected. Can be randomly-generated, or a specific name can be used. This string will be required for viewers to watch your stream via the Livestream page.

Examples:
GoatMonkey299
caratcakedeluxe
NGMd5m9gd24GV6Ubin

Transcoding

Parameters

If desired, we currently provide a single output stream when utilizing our transcoding service. In most cases this is not necessary as recommended settings for typical livestreaming platforms also apply here, but feel free to experiment if you think it could benefit your needs.

Transcoding will output a 1080p (downscaling only using Lanczos) H.264 stream targeting CRF 23 with a constraint of 20 Mbps which is evaluated every 40 Mbit. The input frame rate will be respected, though we recommend either 30 or 60 FPS for compatibility. The audio stream provided is simply copied without transcoding.

We have optimized this output to minimize additional viewer latency and bandwidth requirements, while maintaining an acceptable level of image quality via the “fast” preset and a keyframe interval of 2 seconds. B-frames are also leveraged, up to an allowed maximum of 2 between non-B-frames.

ffmpeg -i input -c:v libx264 -crf 23 -maxrate 20M -bufsize 40M -preset fast -force_key_frames expr:gte(t,n_forced*2) -bf 2 -vf scale=-2:min'(1080,ih)':flags=lanczos -c:a copy -f flv output