Skip to content

Commit

Permalink
Update speed-preset
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskitt616 committed Jan 29, 2024
1 parent cc49cb1 commit 03da6a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`)
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.single-room.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 03da6a2

Please sign in to comment.