Question / Help [SOLVED] --scene argument does nothing

NukeNPave

New Member
I have been running into issues using command line arguments to select the scene OBS uses upon startup.
I am using OBS version 23.2.1 64 bit on Windows 10 Pro
I am going off of the github wiki page's reference which can be located here:
https://github.com/obsproject/obs-studio/wiki/Launch-Parameters

Some of the arguments seem to be working correctly, such as --startrecording however my intended argument, --scene <name>, does not appear to have any effect.
What's particularly frustrating is the log file indicates that my command line argument was received, but later in the log the application appears to ignore it.
First line in the log:
Code:
19:41:51.413: Command Line Arguments: --profile "Default" --collection "Capping" --scene "SC" --startrecording
And OBS apparently ignoring my argument:
Code:
19:41:54.325: Switched to scene 'CB'

I have confirmed that there is, in fact, a scene with the provided name "SC" and that there is no leading or trailing whitespace in the name of my scene.
I have checked all other names, including the profile and collection to ensure they also do not contain any similar issues.
I have attempted to wrap the name of my intended scene in no quotes, double quotes, and single quotes, with no change in behavior.
I have attempted shuffling around the arguments for scene, profile, and collection in case they were order specific.

Usually I call obs64.exe via Selenium with a current working directory of C:\Program Files\obs-studio\bin\64bit
I have also tried running directly from the same working directory via Command Prompt with no change in behavior.

And to confirm that OBS is seeing at least SOME of my arguments...
Code:
19:41:54.325: Starting recording due to command line parameter

All lines before that are just miscellaneous hardware information and module loading.

My end goal is to use Selenium via Python to automate the startup of OBS with the correct parameters and automatically begin recording.
Considering I need to pull from multiple platforms dependent upon the parameters fed into the Python script, being able to select my intended scene via command line parameters on startup is very important to my use case.

Other than OBS completely disregarding my arguments, everything else seems to be working smoothly.


Any ideas of further troubleshooting steps?
Any known issues regarding the use of command line parameters?
I've hit everything I can think of to be related and all other forum posts I can find on OBS disregarding command line arguments seem to have an answer like "You typed your arguments wrong"

Thanks in advance
 

NukeNPave

New Member
Attached is a full log from a subsequent attempt to launch OBS via Selenium.
--verbose was included in the args for extra detail.
 

Attachments

  • OBS-log.txt
    17.2 KB · Views: 45

koala

Active Member
Works for me.
My command line was this:
C:\Program Files\obs-studio\bin\64bit>obs64 --profile "2560x1440 nvenc" --collection "Standard 2560x1440" --scene "test" --startrecording

I notice that in my corresponding logfile, this command line is logged like this:
14:21:12.351: Command Line Arguments: --profile 2560x1440 nvenc --collection Standard 2560x1440 --scene test --startrecording

Notice the missing " in the log that was given in the command line. In your log, " around the parameters are visible. How did your command line actually look? I suspect you gave multiple quote characters. Give exactly one double quote character around the parameters, i. e. "Capping" on the command line. Not ""Capping"" and not '"Capping"'.
 

NukeNPave

New Member
I found the resolution to my issue. You pointed me in the right direction by mentioning the double quotes.

I fiddled with my code a bit and it dawned on me to try a different way to pass the arguments to OBS when creating the thread in Python.
Originally, my arg structure looked like this:
Python:
recorderArgs = ['C:/Program Files/obs-studio/bin/64bit/obs64.exe', '--startrecording', '--scene "SC"']
This was then passed into popen on a subsequent line:
Python:
recorder = subprocess.Popen(recorderArgs, 0, None, None, None, None, None, False, False, 'C:/Program Files/obs-studio/bin/64bit', None, False, None, 0)

Here is the arg structure in my now working code:
Python:
recorderArgs = ['C:/Program Files/obs-studio/bin/64bit/obs64.exe', '--verbose', '--profile', 'Default', '--collection', 'Capping', '--scene', 'SC', '--startrecording']

The difference seems to be using '--scene', 'SC' -- rather than '--scene SC'
Thanks for nudging me in the right direction!
 
Top