Advanced Scene Switcher

Advanced Scene Switcher 1.35.1

This might be a bit out there, but I figured I'd ask here.

I use Youtube Music to play music during my live streams, and I use Amuse to display the current song being played at that time. It also displays the total song length and how far along the current song is as well. YT Music doesn't support crossfade and so I thought I could sort of simulate the fading in/out of music by just increasing/decreasing the volume of the actual music Source in OBS itself.

After attempting various ideas I determined that I could use OCR to "read" the total length of the song, store it as a variable, and then subtract say 10 or 10 seconds to determine when i want the fade out to start and then store that as a separate variable. Since say "4:17" isn't something that can't be subtracted, I'd remove the colon and then get an actual integer. It seemingly worked until I realized that anything that's say 3 minutes long or 3:00 would become 300 and then 290, which doesn't really work when it comes to length of time. I also realized I had no idea how I could reinsert the colon without it being on the far left or right of said number.

I kept chipping at it trying to figure out if i could split the length of time into separate minutes and seconds variables specifically and then try some kind of math to convert the seconds and then somehow combine the numbers back together but it was late and something like this is just a bit out of my expertise.

I'm basically just asking am I over complicating things or is what I'm trying to do even possible? Thanks.
 
This might be a bit out there, but I figured I'd ask here.

I use Youtube Music to play music during my live streams, and I use Amuse to display the current song being played at that time. It also displays the total song length and how far along the current song is as well. YT Music doesn't support crossfade and so I thought I could sort of simulate the fading in/out of music by just increasing/decreasing the volume of the actual music Source in OBS itself.

After attempting various ideas I determined that I could use OCR to "read" the total length of the song, store it as a variable, and then subtract say 10 or 10 seconds to determine when i want the fade out to start and then store that as a separate variable. Since say "4:17" isn't something that can't be subtracted, I'd remove the colon and then get an actual integer. It seemingly worked until I realized that anything that's say 3 minutes long or 3:00 would become 300 and then 290, which doesn't really work when it comes to length of time. I also realized I had no idea how I could reinsert the colon without it being on the far left or right of said number.

I kept chipping at it trying to figure out if i could split the length of time into separate minutes and seconds variables specifically and then try some kind of math to convert the seconds and then somehow combine the numbers back together but it was late and something like this is just a bit out of my expertise.

I'm basically just asking am I over complicating things or is what I'm trying to do even possible? Thanks.
That is indeed rather complicated, but if you have figured out the OCR part to work reliably I think you have already done the most difficult part.
Assuming you have two variables named current time and total time I would suggest to use a condition of type "Script" to do the further string processing and time evaluation.

Something like this should do the trick:

1782931746350.png


Python:
import obspython as obs

def time_to_seconds(time_str: str) -> int:
    """Convert 'M:SS', 'MM:SS', or 'H:MM:SS' into total seconds."""
    parts = [int(p) for p in time_str.strip().split(':')]
    
    if len(parts) == 2:
        minutes, seconds = parts
        return minutes * 60 + seconds
    elif len(parts) == 3:
        hours, minutes, seconds = parts
        return hours * 3600 + minutes * 60 + seconds
    else:
        raise ValueError(f"Unexpected time format: {time_str}")


def seconds_to_time(total_seconds: int) -> str:
    """Convert total seconds back into 'M:SS' format (for display/debugging)."""
    minutes, seconds = divmod(total_seconds, 60)
    return f"{minutes}:{seconds:02d}"


def is_near_end(current_time_str: str, total_time_str: str, threshold: int = 10) -> bool:
    """
    Returns True if 'threshold' seconds or fewer remain in the song.
    current_time_str / total_time_str: e.g. '2:47', '4:17'
    threshold: seconds before the end to trigger (default 10)
    """
    current_seconds = time_to_seconds(current_time_str)
    total_seconds = time_to_seconds(total_time_str)
    remaining = total_seconds - current_seconds
    return remaining <= threshold

def run():
    try:
        return is_near_end("""${current time}""", """${total time}""", threshold=10)
    except Exception:
        return False

I hope that helps!
Let me know if you have questions!
 
Screenshot 2026-07-05 075726.png

I have zero clue what any of this is about, but I felt like posting here in case this is something you can fix this started after I got the recent update 1.34.2 before this update the message had never appeared for me.
 
View attachment 120315
I have zero clue what any of this is about, but I felt like posting here in case this is something you can fix this started after I got the recent update 1.34.2 before this update the message had never appeared for me.
Thanks for reporting the issue.
I was not able to reproduce it on my side to investigate it further, unfortunately.

You should be able to work around the problem by installing the plugin directly into the OBS directory.
So, in the installer choose e.g. C:\Program Files\obs-studio instead of C:\ProgramData\obs-studio\plugins.

1783354649108.png


This is assuming you have installed OBS to that location.
 
Thanks!

If possible can you also share an export of your settings?
Or can you somehow narrow down which macro is causing the crash and share that?

Nothing too complicated.

AAAohHic7VpbT9tIFP4r0Txj5GsS56ESEKpFWgoiKftQRdXx+DgZ4djWzDjARvz3zvgeLu2yZbsU/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YL8ZbHAQ6nm8CwfsHg78p3CgiPl7RgAB8B4C9BDgrUAA16E2hhY1hqAhgAXUAHAdw/FC9PzQGke210OA174j3jME0AO5xwC/GAOooL9bEBCrIIoeA/QY4K1gAGvsDqNg5Bg4As9wfRoY48AfGuhh6EWeObaw/xng1e+Id4sBPuH1oBrKPQ74lTigDfx7xQKn7AY7Pwc84wMEq/sBQpOOZ4GKhuceaOhhRQ8rXgOs8CM6GjnO2DADyzFcd+grkgXGmI68EQBaPvo/Bysc22lhhXp+DqywfauHFfdXTsbTiMX4/3xwUBufkPk10x92/X4rG/KQpeQllpZWNEtzTvGxLU86e81TRZ8qJdVyELcJPYsigbJrs2sxgBgSuuuS12VQSdWjsDm2uoebNM7X+JRude3umWXeu20EYTvu9EsDB66BtSsHArVSdAdv8GNXQmVwGrSpLlyZHj4d3Camzj/d7YuOELH2HW/fJHffAG0/IuM=
 
Nothing too complicated.
Thanks again and sorry for the trouble!
I think I was able to track down the root cause of the issue. (Might have been introduced with the shutdown rework in 1.34.x)

In case you have GitHub account, a build with a fix will be available here in a few minutes:

I will make sure to release an official update shortly.
But might take a while to get approved on the forums.
 
Problems after Updating to 1.35.0

Hi there,

I've updates Advanced Scene Switcher from version 1.34.2 to version 1.35.0 and now nothing works anymore. When I go to tools -> Advanced Scene Switcher I get 2 error messages:


Screenshot 2026-07-07 203334.png

Screenshot 2026-07-07 203340.png


After that, the Advanced Scene Switcher Window opens:

Screenshot 2026-07-07 203446.png


Note that the window still says version 1.34.2 even though I copied the files of the windows zip into my obs folder. I use OBS Portable and did copy the files as the instruction said right into the main folder (data and obs-plugins). I overwrote the existing files.

What can I do to fix this issue?

Edit: Overwriting everything with the 1.34.2 files solves the issue. So I guess it's a problem with the update process and changes to the folder structure or so. I guess I need a way/instructions on how to completely remove the old files and then install the new version.
 
Last edited:
Thanks again and sorry for the trouble!
I think I was able to track down the root cause of the issue. (Might have been introduced with the shutdown rework in 1.34.x)

In case you have GitHub account, a build with a fix will be available here in a few minutes:

I will make sure to release an official update shortly.
But might take a while to get approved on the forums.
Can confirm, fixed!
Working as intended
 
Problems after Updating to 1.35.0

Hi there,

I've updates Advanced Scene Switcher from version 1.34.2 to version 1.35.0 and now nothing works anymore. When I go to tools -> Advanced Scene Switcher I get 2 error messages:


View attachment 120350
View attachment 120351

After that, the Advanced Scene Switcher Window opens:

View attachment 120352


Note that the window still says version 1.34.2 even though I copied the files of the windows zip into my obs folder. I use OBS Portable and did copy the files as the instruction said right into the main folder (data and obs-plugins). I overwrote the existing files.

What can I do to fix this issue?

Edit: Overwriting everything with the 1.34.2 files solves the issue. So I guess it's a problem with the update process and changes to the folder structure or so. I guess I need a way/instructions on how to completely remove the old files and then install the new version.
I think you might have accidentally copied the files to the wrong location or might have accidentally skipped some files.
Unfortunately, it is difficult to tell from the screenshots alone which ones exactly are missing / at the wrong place.

I would suggest to just try installing / replacing the existing advanced scene switcher files again in your portable OBS installation directory.
 
Last edited:
Back
Top