obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

Image Slide Show does not show all pictures before looping

Open an0ndev opened this issue 6 years ago • 38 comments

Platform

Operating system and version: Debian Linux v10 OBS Studio version: 26.6.0-rc1 (latest from repo as of today)

Expected Behavior

More than 68 slides should be shown.

Current Behavior

When pressing the "next slide" button after showing the 68th slide, the slideshow loops back to the first slide. I checked the log file and no errors show up.

Steps to Reproduce

  1. Load at least 69 slides into an Image Slide Show source.
  2. Navigate to the 68th slide and attempt to navigate forwards (Slide 1 is shown), or navigate backwards with Loop enabled (Slide 68 is shown).

an0ndev avatar Aug 30 '20 15:08 an0ndev

This is not a cap on the number of slides, but the size of the images themselves. OBS currently decodes all images in a slideshow ahead of time for performance reasons and stores them in VRAM, which can end up taking a lot of VRAM. Thus, it limits the amount of VRAM a slideshow source can use. If your images were higher resolution, you would get fewer images. If they were lower resolution, you could get more images.

There is a proposal for an alternative implementation here, with more discussion about the issue: https://github.com/obsproject/rfcs/pull/17

dodgepong avatar Aug 30 '20 15:08 dodgepong

Sounds good, thanks. Should I leave the issue open until a solution is implemented to avoid duplicates?

an0ndev avatar Aug 30 '20 15:08 an0ndev

I don't think there is an issue open for this yet so I suppose we can leave it open.

dodgepong avatar Aug 30 '20 15:08 dodgepong

Removing the limit on the amount of VRAM is probably some sort of violation of OBS' design guidelines, but I wanted to do so anyway for personal use, and in case anyone else wanted to, I figured I'd make a quick guide here on what to do:

All you have to do is follow the normal build guide for your system, except before running make, edit plugins/image-source/obs-slideshow.c. If you want to remove the limit entirely, remove the lines starting with #DEFINE BYTES_TO_MBYTES and #DEFINE MAX_MEM_USAGE as well as the if and break statements that check the memory usage against the maximum (if (ss->mem_usage >= MAX_MEM_USAGE) break; in two places). Alternately, if you'd like to keep but raise the limit, you can leave everything in place but raise the number of megabytes in the MAX_MEM_USAGE definition.

To keep your change present while being able to update the source and rebuild, just add your change to Git (git add plugins/image-source/obs-slideshow.c from the obs-studio directory) and make a commit out of the change (git commit -m "obs-slideshow: removal of limit on VRAM usage"). Now, to update the source and rebuild, you can just run git pull and go through the build instructions again, skipping the beginning part where you run git clone.

an0ndev avatar Oct 05 '20 18:10 an0ndev

Hopefully the image slideshow will be updated in the future to dynamically handle more images and/or allow more GPU RAM usage by default or make it configurable. The new generation of GPUs are sporting 8/12/16/20/24GB of VRAM and games only use 6 or so GB of that for the most part. The majority of people have 8GB or less but that'll be changing before long. nvidia/AMD are marketing the high-RAM cards for content creators, which IMHO includes live streaming so having a built in option to runtime configurably take advantage of all the VRAM not used by other stuff would be great.

skeletonbow avatar Oct 10 '20 10:10 skeletonbow

Agreed @skeletonbow, at least a config option to toggle or modify the max would be nice. Maybe once I'm more experienced with the repo's coding style, I'll try for a PR, but in the meantime, hopefully my guide will do.

an0ndev avatar Oct 10 '20 18:10 an0ndev

My merged issue is kind of different to this, as the overload of VRAM is not a problem.

To summarize: An animated Gif within the image playlist will stop the slide show.

Fplusplus avatar Oct 16 '20 16:10 Fplusplus

Have any new developments been made in this regard, any news on implementation?

TheRenegadist avatar Nov 25 '20 10:11 TheRenegadist

I'll take a crack at adding a global config value for the memory limit rather than using a preprocessor constant, and will link the PR here when it's open. As was mentioned earlier, take a look at the RFC for more meta discussion, and you can also use my instructions to patch your own copy and raise or remove the limit.

an0ndev avatar Nov 26 '20 16:11 an0ndev

Couldn't someone do a plugin that has the same functionality as the current slideshow source but modified to increase, remove, or allow the user to set the limit?

TheRenegadist avatar Nov 27 '20 07:11 TheRenegadist

The solution to this problem isn't to increase the limit or allow users to increase the limit. The solution is to rewrite the slideshow source to load images dynamically instead of all images at once.

dodgepong avatar Nov 27 '20 13:11 dodgepong

The solution to this problem isn't to increase the limit or allow users to increase the limit. The solution is to rewrite the slideshow source to load images dynamically instead of all images at once.

Can that be done as I mentioned, it being a plugin that users can install and use instead of the normal slideshow? At least until it gets pushed to OBS officially?

TheRenegadist avatar Nov 28 '20 21:11 TheRenegadist

Someone could rewrite the image slideshow plugin, sure.

dodgepong avatar Nov 28 '20 22:11 dodgepong

How come no one has then, I figured by now people would have done so instead of waiting for it to be updated in OBS.

TheRenegadist avatar Dec 15 '20 22:12 TheRenegadist

Been radio silent for some time, any word?

TheRenegadist avatar Jan 08 '21 05:01 TheRenegadist

We had a feature freeze for 26.1, release, christmas, new years, and a 26.1.1 patch release. Nobody on the team has currently looked into the RFC linked above, so this bug has not been touched. Please remember that the OBS team is made up of volunteers and 1 full-time developer.

WizardCM avatar Jan 08 '21 05:01 WizardCM

There is a complete and working implementation of the RFC by me, for over half a year now. I just accidentally saw this issue here since I was going to make it compile with the current OBS version. But discussion on the RFC and whole topic starved, I thought nobody except me is interested in this.

If you want to give it a try, here's the implementation: https://github.com/DarkDust/obs-studio/tree/feature/slideshow2a

DarkDust avatar Jan 16 '21 14:01 DarkDust

@DarkDust Thank you so much for the effort. I'm looking forward having a limitless slideshow in 2021. Until then, how do I implement your code in OBS Mac version? Thx

danielmiletic avatar Jan 20 '21 10:01 danielmiletic

Check out the branch and follow the instructions for building OBS Studio from source. I developed on macOS, recently ran it on Windows. Works fine on both.

DarkDust avatar Jan 20 '21 10:01 DarkDust

Thanks a lot @DarkDust

danielmiletic avatar Jan 21 '21 10:01 danielmiletic