From 03da6a2b3a374a86745c2d5fe3bee1c03c1bf792 Mon Sep 17 00:00:00 2001 From: jameskitt616 <52933658+jameskitt616@users.noreply.github.com> Date: Mon, 29 Jan 2024 19:59:52 +0100 Subject: [PATCH] Update speed-preset --- README.md | 5 +++-- docker-compose.single-room.yml | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 311e9f8..8558c13 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ So the general workflow would be: - Use HLS as streaming method to VRChat (despite it having higher latency ~7s -> which should not matter much when just streaming a video anyway). It also supports RTSP (and more), which has much lower latency, but apparently due Bugs in Android's media codec it might not work for e.g. Quest Users or other standalone VR-Headsets. - Use H.264 Codec for maximum compatibility, e.g. H.265 or VP9 might not work on some PC's or standalone VR-Headsets. - I'd recommend a fixed Bitrate of minimum 4000kbps for decent video quality, especially when watching dark/hectic video scenes to prevent the video to look mushy. (I will include an example for variable Bitrate, but commented out. In case video quality is less important, or you want to save on Bandwidth. (`NEKO_BROADCAST_PIPELINE` parameter in the docker-compose file)) +- Depending on your CPU's power you can play with the [encoding presets](https://gstreamer.freedesktop.org/documentation/x264/index.html?gi-language=c#GstX264EncPreset), currently it's set to `speed-preset=veryfast` - CHANGE THE PASSWORDS in the docker-compose file for normal users (`NEKO_PASSWORD`) and admins (`NEKO_PASSWORD_ADMIN`) who can operate n.eko. In general i recommend reading through the [n.eko docs](https://neko.m1k1o.net/#/getting-started/configuration) and configure n.eko to your liking. # Networking @@ -51,8 +52,8 @@ You will now find your n.eko at `https://neko.yourdomain.tld` \ Once in n.eko-rooms, you create a new room. Under Environment variables add: - `NEKO_BROADCAST_URL` => `rtmp://rtsp_server:1935/live` (stream key "live" can be changed to anything, use different stream keys for the different streams) -- (fixed bitrate) `NEKO_BROADCAST_PIPELINE` => fixed bitrate: `flvmux name=mux ! rtmpsink location={url} pulsesrc device={device} ! audio/x-raw,channels=2 ! audioconvert ! queue ! queue ! queue ! voaacenc bitrate=320000 ! audio/mpeg,rate=48000 ! mux. ximagesrc display-name={display} show-pointer=false use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! video/x-raw,framerate=30/1,format=I420 ! queue ! queue ! queue ! x264enc key-int-max=30 bitrate=4000 speed-preset=fast ! mux.` -- (variable bitrate) `NEKO_BROADCAST_PIPELINE` => `flvmux name=mux ! rtmpsink location={url} pulsesrc device={device} ! audio/x-raw,channels=2 ! audioconvert ! queue ! queue ! queue ! voaacenc bitrate=320000 ! audio/mpeg,rate=48000 ! mux. ximagesrc display-name={display} show-pointer=false use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! video/x-raw,framerate=30/1,format=I420 ! queue ! queue ! queue ! x264enc key-int-max=30 pass=qual quantizer=20 speed-preset=fast ! mux.` +- (fixed bitrate) `NEKO_BROADCAST_PIPELINE` => fixed bitrate: `flvmux name=mux ! rtmpsink location={url} pulsesrc device={device} ! audio/x-raw,channels=2 ! audioconvert ! queue ! queue ! queue ! voaacenc bitrate=320000 ! audio/mpeg,rate=48000 ! mux. ximagesrc display-name={display} show-pointer=false use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! video/x-raw,framerate=30/1,format=I420 ! queue ! queue ! queue ! x264enc key-int-max=30 bitrate=4000 speed-preset=veryfast ! mux.` +- (variable bitrate) `NEKO_BROADCAST_PIPELINE` => `flvmux name=mux ! rtmpsink location={url} pulsesrc device={device} ! audio/x-raw,channels=2 ! audioconvert ! queue ! queue ! queue ! voaacenc bitrate=320000 ! audio/mpeg,rate=48000 ! mux. ximagesrc display-name={display} show-pointer=false use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! video/x-raw,framerate=30/1,format=I420 ! queue ! queue ! queue ! x264enc key-int-max=30 pass=qual quantizer=20 speed-preset=veryfast ! mux.` You can now open the live stream in VRChat (or VLC) at `https://mtx.youdomain.tld/live/index.m3u8` \ (Optionally you can open the live stream in your local Browser as well at `https://mtx.youdomain.tld/live`) diff --git a/docker-compose.single-room.yml b/docker-compose.single-room.yml index 7618a3d..87a8551 100644 --- a/docker-compose.single-room.yml +++ b/docker-compose.single-room.yml @@ -20,8 +20,8 @@ services: NEKO_AUDIO_BITRATE: 320 NEKO_BROADCAST_URL: rtmp://rtsp_server:1935/live # stream key "live" can be changed to anything. NEKO_PROXY: true - #NEKO_BROADCAST_PIPELINE: "flvmux name=mux ! rtmpsink location={url} pulsesrc device={device} ! audio/x-raw,channels=2 ! audioconvert ! queue ! queue ! queue ! voaacenc bitrate=320000 ! audio/mpeg,rate=48000 ! mux. ximagesrc display-name={display} show-pointer=false use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! video/x-raw,framerate=30/1,format=I420 ! queue ! queue ! queue ! x264enc key-int-max=30 pass=qual quantizer=20 speed-preset=fast ! mux." # config for variable bitrate - NEKO_BROADCAST_PIPELINE: "flvmux name=mux ! rtmpsink location={url} pulsesrc device={device} ! audio/x-raw,channels=2 ! audioconvert ! queue ! queue ! queue ! voaacenc bitrate=320000 ! audio/mpeg,rate=48000 ! mux. ximagesrc display-name={display} show-pointer=false use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! video/x-raw,framerate=30/1,format=I420 ! queue ! queue ! queue ! x264enc key-int-max=30 bitrate=4000 speed-preset=fast ! mux." # config for fixed bitrate + #NEKO_BROADCAST_PIPELINE: "flvmux name=mux ! rtmpsink location={url} pulsesrc device={device} ! audio/x-raw,channels=2 ! audioconvert ! queue ! queue ! queue ! voaacenc bitrate=320000 ! audio/mpeg,rate=48000 ! mux. ximagesrc display-name={display} show-pointer=false use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! video/x-raw,framerate=30/1,format=I420 ! queue ! queue ! queue ! x264enc key-int-max=30 pass=qual quantizer=20 speed-preset=veryfast ! mux." # config for variable bitrate + NEKO_BROADCAST_PIPELINE: "flvmux name=mux ! rtmpsink location={url} pulsesrc device={device} ! audio/x-raw,channels=2 ! audioconvert ! queue ! queue ! queue ! voaacenc bitrate=320000 ! audio/mpeg,rate=48000 ! mux. ximagesrc display-name={display} show-pointer=false use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! video/x-raw,framerate=30/1,format=I420 ! queue ! queue ! queue ! x264enc key-int-max=30 bitrate=4000 speed-preset=veryfast ! mux." # config for fixed bitrate rtsp_server: image: bluenviron/mediamtx:latest-ffmpeg