MacOS Portable Mode Troubles

jrmos349

New Member
I'm pretty clueless about all this, but I managed to do the minimum command line-wrangling required to get Portable Mode running on MacOS (to anyone stuck on that, it took a sudo to get past the "Failed to create directory ../config/obs-studio/basic").

My issues are that:
1) I can't actually get the thing to run "portably." If I try to run OBS from a flash drive, I'm told that the file is damaged and needs to go in the trash. Is there a way around that?
2) The MacOS Portable Mode isn't actually saving the profiles/scenes to the same file as the app, it's shoving them into the Users folder, which...isn't super portable, as far as I know.

Basically, I want to be able to let someone else use my profiles/scenes with as little setup as possible—I'm in charge of streaming for my institution, and I hope I can train someone to be my backup without them having to know everything about setting OBS on their own computer. The ideal is that they can just open up a file on a flash drive and it (mostly) just works, and if there are any other or better ways to make that happen with MacOS, I'm all ears.
 
Last edited:

fastfourier

New Member
I haven't run into your first problem, but I run two instances of OBS - one to do a stream, one to handle a Zoom call - with shell scripts. It seems like OBS saves its data to "../config", so you need to be in the Contents/Resources/MacOS folder when you run it.
Here's what I use. I put it in the same folder as the .app:

Bash:
#!/bin/sh
CURRENT=$(cd)
cd ./OBS\ Zoom.app/Contents/MacOS/
./obs -p -m --studio-mode
cd $CURRENT
 

coolaj86

New Member
@salmiak He's running OBS in such a way that it creates some (most? all?) of its configuration files in the `.app` folder.

He's copied `OBS.app` as `OBS Zoom.app` so that `/Applications/OBS.app/Contents/MacOS/basic/profiles` and `/Applications/OBS Zoom.app/Contents/MacOS/basic/profiles` can be entirely separate.

Unfortunately on the latest versions of macOS, Gatekeeper gets confused and associates screen and accessibility capture with the Terminal rather than with OBS when run that way.

As far as I can tell there is no way to pass the config directory as an option to OBS so that multiple instances can be run as its own Application rather than as "Terminal".

The closest I've gotten is this:

#!/bin/sh set -e set -u # add --multi to allow multiple instances, but be warned: # they all write to the same config files, which may corrupt them # so backup ~/Library/Application\ Support/obs-studio first! open -n -a "OBS.app" --args \ --profile 'Dummy 1 Profile (1440p@30)' \ --collection Dummy 1 Scene Collection' \ --scene 'Dummy 1 Scene'

I can successfully run two instances at once with `--multi` (or just clicking Okay on the warning), but after that the config files become corrupted and neither load.

BACKUP `~/Library/Application Support/obs-studio` BEFORE ATTEMPTING THIS!

#!/bin/sh set -e set -u open -n -a "OBS.app" --args \ --multi \ --profile 'Dummy 2 Profile (1440p@30)' \ --collection Dummy 2 Scene Collection' \ --scene 'Dummy 2 Scene'
 

bitsky

New Member
Hey Guys maybe this can help somebody in my case I needed to run obs for example at least 15 parallel streams controlled over websocket and each one has its own unique content and ports.
For example:
- streaming to srt
- recording will be streaming with ffmpeg in advanced mode over multicast.
- websocket port has to be for each unique to be able to control each one remotly

I have here a script for Mac.
This script will use the defined variable for amount of parallel streams to run or can pass it to the script.
./run-streams.sh 10 # this will rung 10 streams parallel.
./run-streams.sh stop # will kill and stop all obs instances

In OBS simply create 10 profiles and 10 scenes and then the script will just add the number to it based on the request.
Don't forget to adjust the name of the scene + profile and collection in the bottom of the script.

Just leave the $i after to attach the number.

Like this if needed for portability simply do File -> Show Settings and copy from the folder all the content.

Bash:
#!/bin/bash

# Default number of streams
default_streams=1

# Function to stop all OBS instances
if [[ "$1" == "stop" ]]; then
    echo "Stopping all OBS instances..."
    pkill obs
    exit 0
fi

# Check if the number of streams is provided as a parameter, if not use the default value
if [[ -z "$1" ]]; then
    streams=$default_streams
else
    streams=$1
fi

# Check if the number of streams is within the valid range (1-20)
if [[ $streams -lt 1 || $streams -gt 30 ]]; then
    echo "Number of streams must be between 1 and 30."
    exit 1
fi

# Path to OBS executable
obs_path="/Applications/OBS.app/Contents/MacOS/obs"

# Check if the OBS executable exists and is executable
if [[ ! -x "$obs_path" ]]; then
    echo "OBS executable not found or not executable at \"$obs_path\""
    exit 1
fi

# Loop through the number of streams and start OBS instances
for i in $(seq 1 $streams); do
    profile="STREAM$i"
    scene="FULLHD"
    collection="STREAM$i"

    if [[ $i -le 9 ]]; then
        websocket_port="445$i"
    else
        websocket_port=$((4450 + $i))
    fi

    websocket_pass="your_obswb_password"

    echo "Starting OBS instance $i with Collection \"$collection\", profile \"$profile\", scene \"$scene\" and websocket profile \"$websocket_port\"..."

    "$obs_path" --disable-updater --disable-shutdown-check --portable --multi --minimize-to-tray --collection "$collection" --profile "$profile" --scene "$scene" --startstreaming --websocket_port "$websocket_port" --websocket_password "$websocket_pass" &

    # Give a short delay between starting instances
    sleep 2
done
 
Top