scaledteam / obs-image-reaction

OBS Plugin with image that reacts to sound source.
GNU General Public License v2.0
77 stars 11 forks source link

Missed frames when gifs are used #4

Open Coosec opened 2 years ago

Coosec commented 2 years ago

Hi. When I use gif instead of static image 'Frames missed due to rendering lag' stat starts to increase for no reason. With no significant impact on CPU nor GPU. When I switch to static image back - there are no missed frames.

OBS 27.2.4 64-bit on Windows 10 with Image Reaction 1.2

mschmitt commented 1 week ago

Same issue here in 2024. Unfortunately the plugin doesn't seem to be maintained anymore.

scaledteam commented 1 week ago

I just copied GIF implementation from OBS itself. If OBS has GIF problem, my plugin also has. I don't have plans to fix it.

mschmitt commented 1 week ago

I have moved to discrete GIFs in the scene, whose visibility Advanced Scene Switcher toggles back and forth by mic level. No stuttering there. Could it be that OBS have fixed their upstream GIF implementation in the years since?

scaledteam commented 2 days ago

@mschmitt Sorry for late response, i just compared 2021 version of OBS implementation with current one, and GIF implementation not changed much since then. They just moved code around. (https://github.com/obsproject/obs-studio/commits/master/plugins/image-source/image-source.c)

Skipping frames with GIFs is ancient problem, and to solve it, cache mechanism should be implemented, which will drastically increase complexity and introduce new problems. Only thing i can recommend is to optimise GIFs.

For example, many people use pixelart in gifs, rendered in high resolution, because it looks blurry in native resolution. Solution is to just set scaling filter to nearest neighbor scaling for GIF source. Sometimes GIF might contain duplicate frames, which wastes performance too. Check your GIF in GIF editor to see if it's the case.

I don't have good solution to this problem at this moment, and with my business i don't know if i ever will. By the way, i don't remember to ever encounter that problem on my laptop, and my laptop is very weak, especially for 1080p streaming. So i don't even have a way to reproduce this issue.