Resource icon

OBS Lua Count down time and Switch Scene Dont realy have a version string yet

Sigvald Refsum

New Member
Sigvald Refsum submitted a new resource:

Count down time and Switch Scene - Count down to a given time and switch scene

A modification of the original countdown.lua made by Jim
A couple of extra settings make it possible to:

1. Activate a given Scene at the end of the countdown
If this is not set the Final Text is activated

2. Count down to a given time in the form hh:mm:ss
If this is not set the Duration is used as time

3. Set a text on a line above the count down timer

Read more about this resource...
 

ThatGirlSlays

New Member
This causes my OBS to crash. Specifically, the function
Code:
obs.obs_frontend_set_current_scene()
on line 59 causes my OBS to crash. I have tried using the function in another script and get the same result. I am using OBS Studio version 22.0.2. I was wondering if anyone else had the same issue.
 

Sigvald Refsum

New Member
This causes my OBS to crash. Specifically, the function
Code:
obs.obs_frontend_set_current_scene()
on line 59 causes my OBS to crash. I have tried using the function in another script and get the same result. I am using OBS Studio version 22.0.2. I was wondering if anyone else had the same issue.

Sorry about the late reply.

I will need a bit more information about the setup to be able to help you.
I see that it fails if I start the script before I create the resources it use;
'Text source'
'Sceen'

I use the 64bit version and Windows 10.
 

Torath'Kal

New Member
Wont start on mine. I set the duration, text source and scene to switch to but when it runs it ignores the timer and just switches immediately.
Not that it should make any difference but im on W7.
 

Sigvald Refsum

New Member

Sigvald Refsum

New Member
Wont start on mine. I set the duration, text source and scene to switch to but when it runs it ignores the timer and just switches immediately.
Not that it should make any difference but im on W7.

I was able to reproduce the issue, but unable to find a solution. The workaround was to reload the script.
I will work for a solution, but that may take some time.
 

fenghuyu

New Member
Use the timer to switch scenes when the timer ends, but there are repeated delays in the intermediate transition animation. I read your source code, guessing that the program should still be refreshed every second during the transition, it takes about 2 seconds from the switch scene to the end of the program.
 

Adamyk

New Member
I couldn't get the drop down "Text Source" box to work in OBS 25.0.8. I compared your script with the countdown.lua included with OBS. In line 208? I changed the line
source_id = obs.obs_source_get_id(source)
to
source_id = obs.obs_source_get_unversioned_id(source)
and it is working now.
 

nekobaby

New Member
I really love that I can set a time I want to stream and that the code calculates and spits out a countdown based on what time it currently is for me. Much more intuitive than having to set for say an hour from now and doing a countdown. Now I can set it when I have time and go do something else before coming back for the actual stream. I do have bugs, though. But the main time feature works the way I want, so I won't be switching to another plugin for now.

Screenshot 2021-12-27 011727.jpg


The clock timer works 100% correctly, but the DURATION time is broken.
The duration timer is acting super strangely. Current time for me is 01:21:00 (or thereabouts).
5 min in duration shows 10:42:12, 30 min duration show 10:41:53. I'm not really sure what it is calculating off of. The minutes might be reading at seconds?

Screenshot 2021-12-27 011756.jpg
Screenshot 2021-12-27 011815.jpg


I should also mention that the Reset Timer and Start/Stop Timer buttons don't work.
When I click them, they are currently flickering between 19:03:00 (or close to that) and 19:11:28 (or close to it). It's hard to be exact cause the timer's going while I'm trying to catch scream grabs and stuff.

Screenshot 2021-12-27 012628.jpg


The time seems to be always active as well, but I use the Source Dock plugin, so I can at least toggle it to not show.

AdamYK's fix 100% works on getting the Text Source drop down to work.
I couldn't get the drop down "Text Source" box to work in OBS 25.0.8. I compared your script with the countdown.lua included with OBS. In line 208? I changed the line
source_id = obs.obs_source_get_id(source)
to
source_id = obs.obs_source_get_unversioned_id(source)
and it is working now.
 
Top