nginx-rtmp-docker
nginx-rtmp-docker copied to clipboard
Error: already publishing
Hi
I am getting below error with 4G cameras streaming on rtmp
2023/09/28 14:48:46 [error] 13#13: *849 live: already publishing, client: xx.xx.xx.xx, server: 0.0.0.0:1935
Note: There are about twenty 4G cameras streaming to this rtmp server at the same time, I am not sure if this is due to the 4G network or something wrong in my nginx config. I am using the latest tiangolo/nginx-rtmp
image
My docker file
FROM tiangolo/nginx-rtmp
COPY nginx.conf /etc/nginx/nginx.conf
My Nginx File
user www-data;
worker_processes auto;
rtmp_auto_push on;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 4096;
accept_mutex on;
}
rtmp {
log_format new '[$time_local-$remote_addr]: $command:$app:$name, Args=$args, Recv=$bytes_received, Sent=$bytes_sent, url=$pageurl, flashver=$flashver, session_readable_time=$session_readable_time, Connection=$connection';
server {
listen 1935;
listen [::]:1935 ipv6only=on;
chunk_size 4096;
timeout 60s;
ping 3m;
ping_timeout 30s;
access_log /var/log/nginx/rtmp_access.log new;
access_log /var/log/nginx/rtmp_access.log;
# HLS
hls on;
hls_path /tmp/hls;
hls_fragment 10s; # default is 5s
hls_playlist_length 10m; # default is 30s
# once playlist length is reached it deletes the oldest fragments
# hls_continuous on;
application live {
live on;
record off;
# wait_key on;
# wait_video on;
# drop_idle_publisher 15s;
# idle_streams off;
# Auth
on_publish http://myserver.com/api/v1/auth;
}
}
}
Any help will be greatly appreciated :)