LGFae / swww

A Solution to your Wayland Wallpaper Woes
GNU General Public License v3.0
2.35k stars 70 forks source link

swww-daemon using 1GiB of memory #232

Open SampaioLeal opened 7 months ago

SampaioLeal commented 7 months ago

image

Is this normal? Which info should i include here so that you guys can tell if i'm doing something wrong

I'm using Fedora (sway spin) and Hyprland btw

LGFae commented 7 months ago

Is this normal?

No, it shouldn't be.

Could you please post the swww version you are using? Also, is that for a static image or an animation?

SampaioLeal commented 7 months ago

It's an animation (GIF) 33M

swww 0.8.2

LGFae commented 7 months ago

Mmm... Does your gif have a lot of frames that change a lot? Right now we've optimized compression for animation frames for the case where they remain mostly the same from one frame to the other.

SampaioLeal commented 7 months ago

https://moewalls.com/anime/totoro-satsuki-live-wallpaper/

this is the exact animation this site provides only a mp4 file and i do some conversion to GIF using an online tool

SampaioLeal commented 7 months ago

right now i started swww and it seems way faster than yesterday, but for my surprise its using the same amount of memory

LGFae commented 7 months ago

this site provides only a mp4 file and i do some conversion to GIF using an online tool

Ah, this is most certainly the problem. Mp4 to GIF conversions will sometimes add many artifacts throughout the frames. This fucks up our compression scheme because it means most of the frame will be different from the next, just in a way that humans find it hard to perceive.

From a different issue, a user reported some success using the ffmpeg:

ffmpeg -i input.gif -filter_complex "mpdecimate,setpts=N/FRAME_RATE/TB,fps=30,scale=1920:1080,split[a][b]; [a]palettegen=stats_mode=full [palette]; [b][palette]paletteuse=dither=sierra2_4a" -an output.gif

I've tried with the gif you've linked. It is generating a gif that moves far too fast, so you may have to play around with some arguments a bit (lowering fps does not seem to make it slower, for some reason). Also, unfortunately, it seems that memory usage only went down to 700MB. Overall, this is pretty strange. I might have to investigate this particular gif. It may be that there's just a lot of hidden variation in the pixels, in which case it is simply a bad fit for us currently.

SampaioLeal commented 7 months ago

So, i'll try other animations and maybe use this ffmpeg script Do you have any recommendations about where i can find some GIF wallpapers? Not only mp4

LGFae commented 7 months ago

I am a big fan of pixel art, and one of my favorite artists for wallpaper material is Waneella. She has both animated and static artwork, both of which are great.