Resource icon

Advanced Filename Formatter 1.1.1

Penwy

New Member
Penwy submitted a new resource:

Advanced Filename Formatter - Dynamically change recording filename based on what you're doing in OBS.

This substitutes the base OBS filename formatting with an extended one, allowing naming files based on current scene, currently captured programs, source state ...etc.

Documentation on the added tokens and the way they work can be found here.

For support, bug reports or feature requests you can most usually find me on the OBS support server, as @Penwywern.
Don't be afraid to ping me.

Read more about this resource...
 

Acey05

Member
Hello and sorry to bother.

After a running the script once (where it worked), after a restart it stopped working and is spitting out the following:
[adv-ff.py] Pyparsing not found
[adv-ff.py] Pyparsing requirements not satisfied, attempting pip install
[adv-ff.py] Traceback (most recent call last):
[adv-ff.py] File "D:\Stream & Video Software/OBS-Studio/data/obs-plugins/frontend-tools/scripts\adv-ff.py", line 68, in <module>
[adv-ff.py] subprocess.check_call([*py_executable, '-m', 'pip', 'install', '--upgrade', 'pyparsing', *options])
[adv-ff.py] File "subprocess.py", line 413, in check_call
[adv-ff.py] raise CalledProcessError(retcode, cmd)
[adv-ff.py] subprocess.CalledProcessError: Command '['C:/Users/A/AppData/Local/Programs/Python/Python311\\python', '-m', 'pip', 'install', '--upgrade', 'pyparsing']' returned non-zero exit status 1.

Not sure if this matters, but I was only able to get it run once after "manually" installing Python (using the installer didn't work).

Cheers in advance.
 

Penwy

New Member
Yeah, the autoinstall of pyparsing can be a bit shoddy.
The easy solution would be to manually install pyparsing, but if you don't mind I'd like to try and understand why it doesn't work here.
- Is C:/Users/A/AppData/Local/Programs/Python/Python311 the folder you manually installed python to?
- If yes, in that folder, do you have a subfolder named "scripts" with pip.exe in it?
- Would you mind uploading a full log with that error happening (make the error happen, then click on help > log files > upload current log file, and paste the URL in here).
 

Acey05

Member
Sorry for the late reply.

I installed Python as is from the 3.11 Installer as Admin, at the default location it asks (I didn't change anything else about it) and when it had issues, I downloaded the Manual (Embedded) files and overwrote the previous install. That's when it worked once, but then it started showing the error.

Also yes, there is a Scripts folder with a Pip.exe (as well Pip311.exe, etc) in the Python311 folder.

In all cases, I always restarted just in case

Log is here: https://obsproject.com/logs/OtJk0GyLecg3Agk9

Could it be I need to change the Python Version or I need something else? I had 3.9 but didn't try it on that version, since the Requirements showed 3.9 or higher, I figured to update the latest stable release would be the best option. Is there a specific update I might be looking for?

Cheers in advance.
 

Penwy

New Member
3.11 isn't the issue, I tested on my end, the pyparsing install works on python 3.11, with the exact same install location.
- If you have any antivirus apart microsoft defender, try disabling/uninstalling them, then restarting obs and seeing if it does the same.
- Otherwise, wipe the python install and reinstall cleanly.
- If that still doesn't work, open a terminal in the python install folder, and run ./python -m pip install pyparsing
 

Acey05

Member
Hello again.

I disabled some background stuff and it seems to have worked in installing Python correctly (something was blocking it and I honestly don't know why).

Sadly, I'm getting this warning now:
[adv-ff.py] Found pyparsing 3.1.1
[adv-ff.py] Traceback (most recent call last):
[adv-ff.py] File "D:\Stream & Video Software/OBS-Studio/data/obs-plugins/frontend-tools/scripts\adv-ff.py", line 753, in script_defaults
[adv-ff.py] rec_parser.oldformat = obs.config_get_string(config, "Output",
[adv-ff.py] ^^^^^^^^^^^^^^^^^^^^^

[adv-ff.py] AttributeError: module 'obspython' has no attribute 'config_get_string'
[adv-ff.py] Traceback (most recent call last):
[adv-ff.py] File "D:\Stream & Video Software/OBS-Studio/data/obs-plugins/frontend-tools/scripts\adv-ff.py", line 845, in script_update
[adv-ff.py] buf_parser_tree_from_string(data["buf_format"])
[adv-ff.py] ~~~~^^^^^^^^^^^^^^

[adv-ff.py] KeyError: 'buf_format'
[adv-ff.py] Traceback (most recent call last):
[adv-ff.py] File "D:\Stream & Video Software/OBS-Studio/data/obs-plugins/frontend-tools/scripts\adv-ff.py", line 550, in rec_parser_apply_cb
[adv-ff.py] rec_parser.oldformat = obs.config_get_string(config, "Output",
[adv-ff.py] ^^^^^^^^^^^^^^^^^^^^^

[adv-ff.py] AttributeError: module 'obspython' has no attribute 'config_get_string'
[adv-ff.py] Traceback (most recent call last):
[adv-ff.py] File "D:\Stream & Video Software/OBS-Studio/data/obs-plugins/frontend-tools/scripts\adv-ff.py", line 558, in rec_parser_apply_cb
[adv-ff.py] obs.config_set_string(config, "Output",
[adv-ff.py] ^^^^^^^^^^^^^^^^^^^^^

[adv-ff.py] AttributeError: module 'obspython' has no attribute 'config_set_string'
I'm guessing I did something wrong in the OBS settings?

Cheers in advance.
 

Penwy

New Member
that's because you're on obs 29, and it technically requires obs 30 (still in beta).
If you want it to work in obs 29, uncomment lines 183-227 (as in delete the ''' at the start of those lines)
 

Acey05

Member
Oh, sorry, didn't notice it works in 30 and not 29 (have 2 portable versions of OBS), my bad.

Cheers in that case, everything is fine now.
 

Penwy

New Member

Penwy

New Member
Script Error, pls help
Latest OBS version
Python 3.6.8


[adv-ff.py] File "C:/Users/StreamDisk/Videos/Stream_Resourses/OBS Plugins\adv-ff.py", line 483
[adv-ff.py] match node[0]:
[adv-ff.py] ^
[adv-ff.py] SyntaxError: invalid syntax
The script won't work with python versions lower than 3.10.
 

pkoerner81929

New Member
Thanks for the script, looking for similar for quite a while.

I am using OBS 30.0.0, Linux Flatpak. Fedora 38. Python 3.11.6. Getting an error:

[adv-ff.py] Running under Flatpak, pyparsing import might have issues, report on Github if so.
[adv-ff.py] Pyparsing not found
[adv-ff.py] Pyparsing requirements not satisfied, attempting pip install
[adv-ff.py] Traceback (most recent call last):
[adv-ff.py] File "/home/pkoerner/adv-ff.py", line 68, in <module>
[adv-ff.py] subprocess.check_call([*py_executable, '-m', 'pip', 'install', '--upgrade', 'pyparsing', *options])
[adv-ff.py] File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
[adv-ff.py] raise CalledProcessError(retcode, cmd)
[adv-ff.py] subprocess.CalledProcessError: Command '['flatpak-spawn', '--host', 'python3.10', '-m', 'pip', 'install', '--upgrade', 'pyparsing', '--user', '--force-reinstall']' returned non-zero exit status 1.

Am I missing something? Any ideas?
 

Penwy

New Member
Thanks for the script, looking for similar for quite a while.

I am using OBS 30.0.0, Linux Flatpak. Fedora 38. Python 3.11.6. Getting an error:

[adv-ff.py] Running under Flatpak, pyparsing import might have issues, report on Github if so.
[adv-ff.py] Pyparsing not found
[adv-ff.py] Pyparsing requirements not satisfied, attempting pip install
[adv-ff.py] Traceback (most recent call last):
[adv-ff.py] File "/home/pkoerner/adv-ff.py", line 68, in <module>
[adv-ff.py] subprocess.check_call([*py_executable, '-m', 'pip', 'install', '--upgrade', 'pyparsing', *options])
[adv-ff.py] File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
[adv-ff.py] raise CalledProcessError(retcode, cmd)
[adv-ff.py] subprocess.CalledProcessError: Command '['flatpak-spawn', '--host', 'python3.10', '-m', 'pip', 'install', '--upgrade', 'pyparsing', '--user', '--force-reinstall']' returned non-zero exit status 1.

Am I missing something? Any ideas?
Yeah so, that's my attempt at having pyparsing autoinstall failing. It's far from perfect, especially on flatpak.
The issue is that basically I have to rely on the host system (non-flatpak) python to install packages because you can't afaik install packages within the flatpak sandbox.
And flatpak is using python 3.10, which you system likely doesn't have installed.
Normally, installing python 3.10 (you can install it alongside 3.11 it won't override) should solve this. If it doesn't report back here or on the discord.
 

flschurch

New Member
Could there be a feature where renaming is based on other parameters other than source name?

a. User Defined Prefix with an automatic counter suffix. e.g. User prefix "Podcast Ep" suffix 1,2,3... etc
thus successive recording are automatically renamed: "Podcast Ep 1", "Podcast Ep 2", "Podcast Ep 3".... etc..


b. User defined Renaming Based on the Day of the Week. e.g.
i. Recordings on Monday are automatically renamed to "PodMonday Ep 1", "PodMonday Ep 2", "PodMonday Ep 3", .... etc

ii. Recordings on Thursday are automatically renamed to "ThursPod Ep 1", "ThursPod Ep 2", "ThursPod Ep 3", .... etc
 

Penwy

New Member
Could there be a feature where renaming is based on other parameters other than source name?

a. User Defined Prefix with an automatic counter suffix. e.g. User prefix "Podcast Ep" suffix 1,2,3... etc
thus successive recording are automatically renamed: "Podcast Ep 1", "Podcast Ep 2", "Podcast Ep 3".... etc..


b. User defined Renaming Based on the Day of the Week. e.g.
i. Recordings on Monday are automatically renamed to "PodMonday Ep 1", "PodMonday Ep 2", "PodMonday Ep 3", .... etc

ii. Recordings on Thursday are automatically renamed to "ThursPod Ep 1", "ThursPod Ep 2", "ThursPod Ep 3", .... etc
For the prefix, you can just type it. It works exactly like the base filename formatting, if you type something that isn't a token, that'll be part of the filename.
For the day of the week, that's a good idea, you can probably do it right now by editing the execute locals, but that's not easy if you don't know python, I'll probably add it for next version, ty for the idea.
For the counter, that's a good idea, but actually a bit complex to implement right. I'll try to think of a correct way to do it.
 

Penwy

New Member
Could there be a feature where renaming is based on other parameters other than source name?

a. User Defined Prefix with an automatic counter suffix. e.g. User prefix "Podcast Ep" suffix 1,2,3... etc
thus successive recording are automatically renamed: "Podcast Ep 1", "Podcast Ep 2", "Podcast Ep 3".... etc..


b. User defined Renaming Based on the Day of the Week. e.g.
i. Recordings on Monday are automatically renamed to "PodMonday Ep 1", "PodMonday Ep 2", "PodMonday Ep 3", .... etc

ii. Recordings on Thursday are automatically renamed to "ThursPod Ep 1", "ThursPod Ep 2", "ThursPod Ep 3", .... etc
There, version 1.1.0 should have everything you need for that.
Don't hesitate to ask if you have issues with it, or more suggestions.
 
Top