Skip to content

Instantly share code, notes, and snippets.

@LucasPlacentino
Created November 1, 2024 11:05
Show Gist options
  • Save LucasPlacentino/231ada4a22dfb28469b080b236da8574 to your computer and use it in GitHub Desktop.
Save LucasPlacentino/231ada4a22dfb28469b080b236da8574 to your computer and use it in GitHub Desktop.
multiple rtmp stream nginx-rtmp (youtube and twitch)
worker_processes auto;
rtmp_auto_push on;
events {}
error_log /dev/stdout info;
#daemon off;
rtmp {
server {
listen 1935; # 1935 is the rtmp port
listen [::]:1935; # ipv6
chunk_size 4096; # 4096 or 8192 ?
meta copy;
allow publish 127.0.0.1; # allow only localhost to stream to here (ipv4)
allow publish ::1; # allow only localhost to stream to here (ipv6)
deny publish all; # deny all other
application stream { # stream from OBS to rtmp://localhost/stream
live on;
record off;
# Youtube :
push rtmp://a.rtmp.youtube.com/live2/{YT_STREM_KEY};
# Twitch :
push rtmp://{TWITCH_RTMP_STREAM_URL}/{TWITCH_STREAM_KEY};
# live.twitch.tv/app/ or see https://help.twitch.tv/s/twitch-ingest-recommendation
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment