I've followed this guide on setting up RTMP to HLS streaming - https://web.archive.org/web/20221205201139/https://docs.peer5.com/guides/setting-up-hls-live-streaming-server-using-nginx/
RTMP streaming works just fine but for some reason I can't get HLS to link with the already existing RTMP server. I'm using OBS to stream to RTMP and it's set to be on x264 and as far as I know the default codec for audio is AAC so I'm not sure why it's not picking it up.
Current Nginx.conf
worker_processes auto;
events {
worker_connections 1024;
}
# RTMP configuration
rtmp {
server {
listen 1935; # Listen on standard RTMP port
chunk_size 4000;
# Define the Application
application show {
live on;
pull rtmp://localhost:1935/stream/test;
# Turn on HLS
hls on;
hls_path /mnt/hls/;
hls_fragment 3;
hls_playlist_length 60;
# disable consuming the stream from nginx as rtmp
deny play all;
}
# RTMP video on demand for mp4 files
application vod {
play /mnt/mp4s;
}
# RTMP stream using OBS
application stream {
live on;
}
}
}
http {
sendfile off;
tcp_nopush on;
aio on;
directio 512;
default_type application/octet-stream;
server {
listen 8080;
location / {
# Disable cache
add_header 'Cache-Control' 'no-cache';
# CORS setup
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length';
# allow CORS preflight requests
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
types {
application/dash+xml mpd;
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /mnt/;
}
}
}
I've tried changing the rtmp link I have in that config too to both internal and external IP's since it can be reached. I tested watching the rtmp from another computer on the network to confirm it was functional. I wanted to avoid transcoding with ffmpeg since the server doesn't have that kind of power.