Resource icon

SimpleSlides: slide show avoiding the memory limit of Image Slide Show 0.2

John Hartman submitted a new resource:

SimpleSlides: slide show avoiding the memory limit of Image Slide Show - This script changes the file reference in an Image Source to show image files as a slide show

This script uses an Image Source whose names begin with "SimpleSlides:" to display sequential image files from a directory, creating a simple slide show without the memory limit OBS Image Slide Show

The trade off is that some frames may be dropped during image changes. If the scene contains only the slide, the drop is hard to see. If the scene also has a camera or other moving source, you may notice it.

The filespec in the Image Source is used to specify the directory...

Read more about this resource...
 
John Hartman updated SimpleSlides: slide show avoiding the memory limit of Image Slide Show with a new update entry:

SimpleSlides version 0.2

Changes
  • changed hotkey ids stored in your profile .ini from "slides_reset_button_thingy" to "simpleslides_reset_button" etc. ("thingy" was inherited from the script I used as a base)
  • "Reset" action from the script dialog or hotkey now causes the image directory to be rescanned, in case you add or delete files, and then moves to the first slide
  • Added code to on_load to initialize any active slideshow (usually has impact only if you reload the script)

Read the rest of this update entry...
 

Dick Dawson

Member
Instead of from a directory, any chance the images could be from a scene named SimpleSlides? Then we can crop and so on the images and have them go one at a time, embed that scene into my main one and off to the races. Would be really good for me!
 

rusty1

Member
Is there any reason this incredible script can't be tweaked to support Media sources instead of Image sources?
My goal is to create a playlist of looping videos controlled manually with a prev and next button.
This script for media sources would do the trick.

And also media sources can display images too, as long as you rename them to end with a video extension, like "image.mov". I know this works on Mac, at least. So that would allow me to combine looping videos and images into a single playlist.
 

rusty1

Member
Well, today is the day I used ChatGPT to solve my problems.

Here were the three alterations I made:
1) Appended a few video format types to the allowed_filetypes array at beginning of the code
2) Changed the one instance of "image_source" to "ffmpeg_source"
3) Changed all instances of "file" to "local_file".

This script works the exact same way as John Hartman's original, except you apply it to a Media Source instead of an image source. You can include images in the directory as well if you rename their file extension to a video extension, like image.mov.
 

Attachments

  • SimpleSlides-Media.lua.zip
    5.5 KB · Views: 31

rusty1

Member
I wish SimpleSlides didn't need the source to be active in the current scene. I wish it worked on any scene, so that I could go forward and backward through my slides in the background when they're not showing, because I can preview them using source docks. The original code is too complex for me to figure out how to change that feature.
 

cuongdoan

New Member
Hello John,
First thank you for script.
I am new user of OBS studio and see your script on this forum. I have tried figuring out how to setup the script on OBS, bsut I couldn't get it working yet.
1- image source is created. the image point to a file viber_image01.jpg.
2-In the script I specify the the directory of the image files and a name of Slide show.
Pleas help me on this?

Regards,
Doan Nguyen
 

MonsieurKaroshi

New Member
I wish SimpleSlides didn't need the source to be active in the current scene. I wish it worked on any scene, so that I could go forward and backward through my slides in the background when they're not showing, because I can preview them using source docks. The original code is too complex for me to figure out how to change that feature.
I also used ChatGPT to get it to work on any scene active.

2 functions had to be modified:

Lua:
-- Dans la fonction handle_frontend_event

function handle_frontend_event(event)
    if event == obs.OBS_FRONTEND_EVENT_SCENE_CHANGED or event == obs.OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED then
        select_slideshow("OBS_FRONTEND_EVENT_SCENE_CHANGED")
    elseif event == obs.OBS_FRONTEND_EVENT_SCENE_LIST_CHANGED then
       print("OBS_FRONTEND_EVENT_SCENE_LIST_CHANGED")
    elseif event == obs.OBS_FRONTEND_EVENT_EXIT then
       print("OBS_FRONTEND_EVENT_EXIT")
    elseif event == obs.OBS_FRONTEND_EVENT_FINISHED_LOADING then
       print("OBS_FRONTEND_FINISHED_LOADING")
    else
       print("Front end event " .. event)
    end
end

-- Modifiez la fonction select_slideshow comme suit

function select_slideshow(label)
    print('select_slideshow ' .. label)

    -- no show active unless we find one
    local desired_source_name = ''

    local sources = obs.obs_enum_sources()
    if sources ~= nil then
        for _, source in ipairs(sources) do
            local source_name = obs.obs_source_get_name(source)
            if string.sub(source_name, 1, string.len(source_key)) == source_key then
                desired_source_name = source_name
                break
            end
        end
    end
    obs.source_list_release(sources)

    if desired_source_name ~= '' then
        create_slideshow_if_needed(desired_source_name)
    end

    if active_source_name ~= desired_source_name then
        active_source_name = desired_source_name
        do_slide(label, 'SHOW_SLIDE')
    end
end

Thank you so much for your script John, exactly what I needed for my 200+ slides
 
Top