Question / Help OBS record multiple pc's from a server

Tarumes

Member
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

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;
        }
    }
}
 

KEasterday

New Member
is it possible that OBS (per classroom) has a single source with cam and desktop and send all to your server or do you need cameras seperated?

Each OBS has a scene for the desktop (for visual aids such as Word, PowePoint, PDF's, etc.), one wide angle camera, one close-up camera, and one camera facing the class so that the participants are included in the production. Each OBS will auto-switch between two scenes: 1) to a scene with the wide angle, and a pnp of the class participants; and 2) to a scene with the close-up cam, desktop, and class cam, when the professor is using visual aids on the pc. The auto switch works pretty well and the video production enables distance students to experience everything that went on in the class. All of this is also presented to GoToMeeting for online students.

Thus, if I can record the OBS with video and audio sync'd, my post-production consists of cutting out before and after class footage, and a usual 10 minute break in the middle; adding a title video to the beginning and end, and; adding titles of the class subject, and the professor giving the lecture. The video would include all lecture, class participation, visual aids, screen annotations, and even an electronic whiteboard. All this without me having to do anything manually (except the post-production edits).

However, because of PC resources being pegged, I drop frames in the recording, making my audio lose sync.

I am almost there, I just need to have an automated recorder to bring it all home.

NDI monitor may prove to be a solution as I could make a monitor for each classroom, and use my recording software to capture an area of the screen. But I think the audio would have to be added after the fact. If I had someone clap at the beginning of class, maybe audio sync wouldn't be hard to accomplish.

Thanks everyone for bearing with me, and for your suggestions.
 

KEasterday

New Member
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

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;
        }
    }
}

I think this may be the solution. I could setup my server with nginx rtmp and just record all day long, separating the recordings into "bite-sized" chunks. Shutdown at night and do it all again the next day. This would save me from having to keep track of class schedules and all the config of TotalRecorder.

I can already add my wide-angle cameras to my Synology NAS. If there was a way for that to record OBS scenes, that would be nirvana.

I will let you all know how this turns out. Thanks, again.
 

KEasterday

New Member
I was able to get nginx installed on the server with part of the config Tarumes posted (I only wanted to get one classroom done for a test). I adjusted the record time to 60 minutes, instead of 15. I let it run and it separated the files. I think it is going to work well. The CPU utilization on my Windows Server was between 2 and 7%. There shouldn't be a problem running all four classrooms.

The next task will be copying off the .flv files to the place they can be edited.

Thanks again for all the help.
 
Top