This is an example config for nginx-rtmp server it records every incoming stream on defined endpoints
also its possible to split recordings in lenght 15min i set in example so you get small pieces to edit
and for start recording without user input its possible to start OBS with commandline parameters
https://obsproject.com/wiki/Launch-Parameters
also its possible to split recordings in lenght 15min i set in example so you get small pieces to edit
and for start recording without user input its possible to start OBS with commandline parameters
https://obsproject.com/wiki/Launch-Parameters
Code:
worker_processes auto;
worker_priority -20;
worker_shutdown_timeout 5;
error_log logs/error.log;
events {
worker_connections 1024;
}
rtmp_auto_push on;
rtmp_auto_push_reconnect 1s;
rtmp {
server {
listen 1935;
#define application
application classroom1 {
#switch live on
live on;
#deny play on reciving endpoint
deny play all;
#push to localhost recorder (later aviable as rtmp://<server-ip>/view/stream1)
push rtmp://127.0.0.1/view/stream1 ;
}
application classroom2 {
live on;
deny play all;
push rtmp://127.0.0.1/view/stream2 ;
}
application classroom3 {
live on;
deny play all;
push rtmp://127.0.0.1/view/stream3 ;
}
application classroom4 {
live on;
deny play all;
push rtmp://127.0.0.1/view/stream4 ;
}
application view {
live on;
# limit publish on this recorder to local connection
allow publish 127.0.0.1;
deny publish all;
#enable hls for HTTP monitoring
hls on;
hls_path html/hls;
hls_fragment 10s;
hls_playlist_length 60s;
hls_fragment_naming timestamp;
hls_fragment_slicing aligned;
hls_type live;
hls_cleanup on;
#set recorder for rtmp stream as flv file
recorder all {
#record audio and video in an single file
record all;
#path to recordings
record_path html/record/stream;
record_lock on;
record_unique on;
#split files by time 15minutes each
record_interval 15m;
}
}
}
}
http {
include mime.types;
default_type application/octet-stream;
sendfile off;
server_tokens off;
server {
listen 8080;
location / {
root html;
}
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
#auth_basic "closed site";
#auth_basic_user_file htpasswd;
root html;
}
location /control {
#auth_basic "closed site";
#auth_basic_user_file conf/htpasswd;
rtmp_control all;
}
}
}