OK so my new dedicated box should be here in a few days and I'm gonna try setting up Linux first and just see if I can do three sessions with Linux and keep them fairly separated so I never make a mistake regarding each stream. So with that said what is the easiest way and best way to open three sessions on Linux and for this let's just say, Profile - Cam 1, Cam 2 and Cam 3, and Collection can be Stream 1, Stream 2 and Stream 3.Like qhobbes said, you need to switch BOTH the profile AND and scene collection for each instance.obs --help
to see how to do that.
That section of my bash script is:
And you can see how some of the logic and status-reporting works as well.Bash:# # Start OBS Master with options # echo if [[ "$LOCAL_AUDIENCE" = "0" ]] # 0 for "success" or "yes" then echo "Start OBS Master (feed to meeting)" else echo "Start OBS" fi obs --verbose --unfiltered_log --disable-updater --multi --studio-mode --profile "$OBS_PROFILE" --collection "$OBS_PROFILE" --startvirtualcam > /dev/null & PID_MASTER=$! sleep 10 # # Local Audience? # PID_SLAVE="" if [[ "$LOCAL_AUDIENCE" = "0" ]] # 0 for "success" or "yes" then # # Start OBS Slave # echo echo "Start OBS Slave (local display and recording)" obs --verbose --unfiltered_log --disable-updater --multi --studio-mode --profile "Meeting_Slave" --collection "Meeting_Slave" > /dev/null & PID_SLAVE=$! sleep 10 fi
ThePID_x
variables are used later to clean up automatically:
Bash:else # # Wait for User OK # echo echo echo "Wait for Done..." echo zenity \ --info \ --width=350 \ --title="DO NOT CLOSE THIS ! ! !" \ --text="When done:\n1. Click OK here\n\nEverything will clean up automatically." echo echo "Done, cleaning up:" fi # # OBS Slave? # if [[ "$PID_SLAVE" != "" ]] then # # Close OBS Slave # echo echo "Close OBS Slave" kill -TERM "$PID_SLAVE" sleep 5 fi # # Close OBS Master # echo echo "Close OBS Master" kill -TERM "$PID_MASTER" sleep 5
The 3-line comments:
zenity
is a dialog box, that waits there until the user clicks OK. Lots of other options too, that are used in other parts of the script, but that's what it does here.- A backslash
\
allows a newline in the middle of a single command, without breaking that command.kill
is kind of a misnomer. It simply sends a signal out of a universally predefined list, to the Process ID (PID). The process then decides how to handle that signal. There are standard ones to save and exit, just exit without saving, print something to the terminal, and one that the operating system intercepts to force-kill it. What I'm using here is not the force-kill signal, but the close-gracefully one.
#
# Comment
#
correspond to a flowchart that makes it easier to see the entire startup and shutdown sequence, and understand all of what it's doing. That's attached here too. The sections of script above are the top and bottom of the center section of the flowchart.
And also how to start all 3 streams when Ubuntu starts.
John