Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swww-daemon using 1GiB of memory #232

Open
SampaioLeal opened this issue Mar 12, 2024 · 8 comments
Open

swww-daemon using 1GiB of memory #232

SampaioLeal opened this issue Mar 12, 2024 · 8 comments

Comments

@SampaioLeal
Copy link

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
Copy link
Owner

LGFae commented Mar 12, 2024

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
Copy link
Author

It's an animation (GIF) 33M

swww 0.8.2

@LGFae
Copy link
Owner

LGFae commented Mar 13, 2024

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
Copy link
Author

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
Copy link
Author

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

@LGFae
Copy link
Owner

LGFae commented Mar 13, 2024

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
Copy link
Author

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
Copy link
Owner

LGFae commented Mar 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants