Preload a scene

willis_007

New Member
Hello everybody :),

For those who like to take up challenges, I offer you one :).

I have a whole OBS project that contains several scenes. Each of these scenes broadcasts different video streams from several cameras (via the 'Source video VLC' source and the RTSP protocol). For example :

Scene 1: mosaic of cameras 1, 2 and 3
Scene 2: mosaic of cameras 4, 5 and 6
Scene 3: mosaic of cameras 7, 8 and 9

And to avoid an explosion of cpu resource usage, of course I enable the option 'Stop when playback is not visible, restart when visible'. Otherwise, although my computer is powerful enough and I use the decoding of my very good graphic card, the cpu resources would increase to 95%, which of course is very problematic.

So.
Nothing very complicated so far you will tell me, and indeed everything works well.

However, I have a 'problem' that annoys me and that alters the quality of my stream. Indeed, when I go from one scene to another, there is always a lapse of time before the cameras are displayed. What is normal, it takes 2-3 seconds for OBS to listen to and broadcast the stream it receives from the camera. Nothing suprising.

But then... well, that's ugly :/.
I would like that when switching from one scene to another, the cameras of the freshly displayed scene can already be broadcasting.

So I tried with different little tweaks (scene transitions, cache...) but nothing that was very convincing and that didn't look a bit messy or amateurish.

So I was wondering if it was possible in the software, or via a Python script, to:
1) while I am broadcasting scene 1, to preload scene 2 at a specific moment (keyboard shortcut, command contained in a script...) thus activating the broadcasting of video streams from the cameras of scene 2
2) and only 3 or 4 seconds later, to go to scene 2 and thus immediately have the display of the cameras.

Having two scenes with 6 video sources playing video streams for 3-4 seconds remains bearable for my computer, provided of course to close the playback of video streams from the cameras of scene 1 once scene 2 is displayed.

Before asking for your help, I spent a lot of time testing some 'hack' solutions, searching on this forum... but nothing very conclusive :/.

So I come to you to ask for your help, to give me ideas of avenues to follow because there, apart from the application of this idea, I do not see any other.

Thank you in advance for reading my message and for your future help.
Kind regards,

Willis [using OBS Studio 28.1.2 - 64 bits]
 

khaver

Member
Create a video that is black for 3 seconds then turns and stays white for 1 second. If you want a straight cut between scenes, change directly from black to white. If you want to dissolve between scenes, fade up to white from black after 3 seconds. Use this video as a stinger. In the stinger settings, check the box "Use a Track Matte" and select "Mask only". By using a stinger, the upcoming scene will load and your sources turn on as soon as the stinger starts, but because the stinger is black for the first 3 seconds, the upcoming scene will not be shown until the stinger matte is white.
 

willis_007

New Member
Create a video that is black for 3 seconds then turns and stays white for 1 second. If you want a straight cut between scenes, change directly from black to white. If you want to dissolve between scenes, fade up to white from black after 3 seconds. Use this video as a stinger. In the stinger settings, check the box "Use a Track Matte" and select "Mask only". By using a stinger, the upcoming scene will load and your sources turn on as soon as the stinger starts, but because the stinger is black for the first 3 seconds, the upcoming scene will not be shown until the stinger matte is white.

Hi Khaver,

So first of all, thank you for your quick response, it's very much appreciated :).

Secondly, and above all, thank you for your solution which works perfectly :). I thought of everything but then absolutely not transitions. I underestimate the power of these transitions. It's a very very good idea.

Well done and a huge thank you Khaver. Your help is very valuable to me. I'm so happy :).

Have a great holiday season :)
 

willis_007

New Member
Hello dear forum administrators,

I don't know if we should close a topic when it is resolved but if so, can you explain to me how to do it (or do it for me perhaps) because I did not find .

Thanks in advance :).
 

willis_007

New Member
Hi Khaver,

One more additionnal question please.
Is there the possibility to configure a stinger transition but without the audio fade effect please ?

For example.
We will the same scene frome my example. So scene 1 and scene 2.
The stinger transition lasts 4 seconds.
During the first 3 seconds, we always see scene 3.
At the 4th frame, scene 2 is displayed without any transition effect. Just a cut. What I manage to do thanks to you ^^.

And I would like that when this scene 2 is displayed, the sound switches to that of the scene but also without any transition effect. Just a cut. However, in the configuration of the stinger, I have no choice, there is necessarily a transition.

Do you alos have another great idea to help me please.
Thank you in advance :).

Kind regards,
 

bcoyle

Member
In Your previous hack fest, I wondered if just changing the puase/unpause setting to always run 3 seconds before you switch would work?
 

willis_007

New Member
In Your previous hack fest, I wondered if just changing the puase/unpause setting to always run 3 seconds before you switch would work?

Hi Bcoyle,

Thank you for your reply :).
However, I don't see where I should make this adjustment please. Is it in the configuration of 'Stinger' or elsewhere please ?

Thanks in advance :).
 

bcoyle

Member
Hi Bcoyle,

Thank you for your reply :).
However, I don't see where I should make this adjustment please. Is it in the configuration of 'Stinger' or elsewhere please ?

Thanks in advance :).
Hi willis. I don't really know.You said you wanted to activate the second scene 3 seconds before switching. I thought that maybe a hot key could be used to change a scene to 'RUN ALWAYS" then you wait 3 seconds and change the scene and another hot key to change it back to 'PAUSE/UNPAUSE". You might do an experiment to see if switching to run always without it being visible would actually load the cameras. I don't have cameras so don't know if that would even work.It sounds like the previous suggustion about transisions works. Anyway good luck.
 

willis_007

New Member
Hi Bcoyle,

The idea is very interesting but I couldn't find the keyboard shortcut to change a scene to 'Run Always'. Moreover, the change of scene, the activation of such or such source etc... is controlled via a python script, and I admit that controlling keyboard shortcuts via a script does not seem to me to be the best idea :/.

I requested it at 'ideas.obsproject'. I would see ^^.

Anyway, thank you for your suggestion 'Bcoyle' :).

Cheers,

Willis
 

bcoyle

Member
Hi Bcoyle,

The idea is very interesting but I couldn't find the keyboard shortcut to change a scene to 'Run Always'. Moreover, the change of scene, the activation of such or such source etc... is controlled via a python script, and I admit that controlling keyboard shortcuts via a script does not seem to me to be the best idea :/.

I requested it at 'ideas.obsproject'. I would see ^^.

Anyway, thank you for your suggestion 'Bcoyle' :).

Cheers,

Willis
you're welcome
 
Top