Resource icon

WebcamReload: Fix webcam or other USB video device freezes

FlyingFathead

New Member
FlyingFathead submitted a new resource:

WebcamReload: Fix webcam or other USB video device freezes - Refreshes your webcam or other UVC video capture device every x minutes so that it doesn't freeze up

obs = obslua

-- The name of the video source is what the title of it is in your OBS video sources list.
-- For clarity, you can i.e. rename your video source in OBS to 'Cam1', 'Cam2' etc and then just add a variation of this script per each camera that you want to refresh as a source every x minutes.
-- Replace 'UVC Webcam' value below with the name of your video capture source
local source_name = 'UVC Webcam'

-- Replace the value underneath (default: 1) with the number of minutes between...

Read more about this resource...
 

Penwy

New Member
Hi.
Just as a head's up, this script causes a crash on OBS closing, as per this issue.
Removing timers (or any sort of callbacks) in script_unload is unnecessary (they get automatically removed on unload anyways) and currently causes a crash.
 

seano1

New Member
FlyingFathead submitted a new resource:

WebcamReload: Fix webcam or other USB video device freezes - Refreshes your webcam or other UVC video capture device every x minutes so that it doesn't freeze up



Read more about this resource...
Thanks for this amazing effort!

I am using OBS on Ubuntu to connect to a local IP camera using rtsp with tcp protocol and then streaming to a public rtmp address. It's working but every few hours or days the stream goes black which I presume is a network error where the connection to the camera is momentarily lost. The solution is to disable the little eye next to the source, wait a second, and then enable it again. So far I have tried the default media source and well as the gstreamer media source - with gstreamer being the most reliable. But ultimately this problem occurs with both sources.

I'm trying to use this Lua script to stop and then restart the gstreamer source but I'm not sure if this source is supported? and I can't tell if the script is running or not? Apart from just waiting a few days to see if the freezing issue happens again, is there some other way to make sure the script is functioning.

If this script is not designed to work with the gstreamer source, is there a way of altering this script to literally disable the visibility of the source, wait a second, and then re-enable it?

Thanks!
Sean.
 

REDDDDY

New Member
Will this script work for Atem Mini Pro as a Video Capture Device.

The problem I am having is that it always freeze and the only way to solve it is to open its properties and click deactivate and activate it again.

Will your script able to deactivate/activate every 3 hours for a "Video Capture Device" Source ?
 
Top