Question / Help Stream crashing randomly every 3-50 minutes.

lycaon

New Member
Since the Friday before last, OBS has been crashing randomly every 3-50 minutes any time it's open, whether or not I'm streaming. I changed nothing between the stream before the crashing started and the stream where the crashing started. I reinstalled OBS, which seemed to fix it (OBS didn't crash for a couple of hours) but then it went back to crashing. I'd been using OBS for years before then with no issue, and had switched to OBS Studio a few months before.

Here is a link to the log file from the most recent crash. I googled this problem earlier and found another thread on here from someone with the same problem, but nobody ever replied to them.

I'm running Windows 7, by the way, with no external OBS plugins except the CLR browser plugin to show chat.

Any help would be much appreciated. The problem isn't the end of the world, but it is annoying to have to keep restarting the stream every so often, and then to stitch all the recordings back together to put up VODs.
 

Attachments

  • crash.txt
    47.2 KB · Views: 30

lycaon

New Member
I have several image sources in my scene, but the one that's the most likely culprit is this one i use as a gif slideshow since the image slideshow feature in obs is lacking for my needs. I wrote a short python script to automatically switch a gif OBS references in the image source out for various gifs in a folder to simulate the slideshow.

Upon disabling the script, it seems to be not crashing, which is weird, because I've been using the slideshow script for months before the crashes started. Oh well.
 

RytoEX

Forum Admin
Forum Moderator
Developer
Post your Python script?

How is the Image Slideshow feature lacking for you? Not asking to pick a fight, I'm asking because I'm curious (tone doesn't carry well over the Internet).
 

lycaon

New Member
Here's a link to the script. It's just a short little thing that takes all the gifs in /p4gss_gifs, shuffles them up, and then writes them one by one to display.gif, which is referenced by OBS in an image source. It doesn't interact with the OBS API in any way, but I suspect the problem is one with switching the gifs. I did my stream last night and disabled the script and just left it on one gif, and it didn't crash.

The slideshow feature is lacking for me b/c there are 215 gifs in that folder, and OBS's image slideshow works (I assume) by loading all the images into memory first, which causes OBS to crash or in the best case be absurdly slow. The script I wrote just loads the file names into a list.
 

RytoEX

Forum Admin
Forum Moderator
Developer
Hmm. I don't see anything odd about that script, though I'm not familiar with threading in Python, and I'm still not sure why that would crash OBS Studio. Have you tried running a similar Windows Batch script to see if you get the same crash?

Maybe this would fit your needs for testing purposes? It's based off of one that I used to test the issues in this thread. Keep in mind that this Batch script doesn't shuffle. If you want to shuffle files, you could probably use this.
Code:
@ECHO OFF
REM copy images onto display.gif in sequence

:BEGINLOOP
FOR %%F IN ("p4gss_gifs\*.gif") DO (
    ECHO %%F:
    ECHO  copying...
    COPY "%%F" display.gif
    ECHO  copied!
    ECHO  sleeping...
    TIMEOUT 10
)

GOTO BEGINLOOP

If it still crashes, then maybe one of the specific GIF files is causing an issue? This would make sense since you shuffle the list of GIFs, and your crash time is seemingly random.

Upon disabling the script, it seems to be not crashing, which is weird, because I've been using the slideshow script for months before the crashes started. Oh well.
Have you added new GIFs over the past few months? If so, then that would also point to the possibility of a specific GIF being the culprit.

If it doesn't crash, maybe Python threading is interfering somehow (though that still seems odd to me)?

I've only just glanced at the code for the OBS Studio Image Slideshow, so I'm not sure if it loads everything into memory.


As a side note...
I'm running Windows 7, by the way, with no external OBS plugins except the CLR browser plugin to show chat.
I hope you mean that you're using the OBS Studio Browser Source? CLR Browser is for OBS Classic only.


Lastly, if you have any regular OBS Studio log files, those may also help us in spotting any issues. I should have asked about these earlier.
 

lycaon

New Member
OK, so after beating my head against the wall for a while i solved the problem. I wrote a program to help me go through all the gifs and check which ones were causing it to crash. I identified two culprits that crashed the program and I think all is well now.

I'm pretty sure the problem was that the gifs I was trying to play were too large. They were both bigger than the largest one that didn't cause problems, clocking in at 60MB and 71MB respectively.
 
Last edited:

RytoEX

Forum Admin
Forum Moderator
Developer
I guess it's some kind of unintentional upper-limit on either file size or number of frames. The error was occurring in libobs/graphics/image-file.c in init_animated_gif at one of its two bzalloc calls (Line 120 or Line 122). I'm not well versed enough at reading crash logs to say exactly which one it is.

As another workaround, you could probably convert those animated GIFs to Webm files and save a bunch of space, but you'd have to switch to using Media Source instead of Image Source to play Webm files.
 

RytoEX

Forum Admin
Forum Moderator
Developer
@lycaon
If you don't mind, could you send me the GIF files that were causing the crashes? If they won't attach to the forums here, you can upload them somewhere else (imgur, mediafire, some cloud drive service, your own domain, etc.) and link them to me? You can either post the links here, or PM them to me. I'd like to dig into this a little more.
 
Top