calculon102 / xgifwallpaper

Use an animated GIF as wallpaper on X11 systems
GNU General Public License v3.0
36 stars 1 forks source link

[feature request] gif images and video files #8

Open ghost opened 1 year ago

ghost commented 1 year ago

Great project, I use it to make my desktop a little bit livelier.

But, I find it hard to find gif images that will look nice in 4k resolutions (ultra wide screen monitor).

Could you please:

1) add a section in the readme file, to point to popular desktop gif images that we can use? 2) add a command to convert video files (mp4, etc) to animated gif images?

For example, here is the ffmpeg command that I use:

ffmpeg -i input.mp4 -vf "fps=1,scale=3222:-1:flags=lanczos,split[s0][s1];[s0]palettegen=stats_mode=diff[p];[s1][p]paletteuse" -loop 0 output.gif

The result is ok-ish, the encoding leaves a lot of artefacts. Maybe someone could improve it.

PS: ffmpeg command is from: https://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality

calculon102 commented 1 year ago

Hi @LauraTaylorUK ,

thank you for your kind message!

Regarding your requests:

  1. Honestly I don't know a real great source of animated GIFs, usable as wallpapers. If l look up for "animated gif wallpaper" in a search engine it's a bit of a mess, I think. You will find good things with enough endurance, but I wouldn't know which site to recommend as trustworthy. But I would gladly add any good suggestions, that I may not know of!
  2. Do you mean, to integrate the functionality within xgifwallpaper? Or offer a Convenience function to call another dependency on the system? Or some knowledge-base in the README for converting video?
ghost commented 1 year ago
  1. Unfortunately I have no real suggestions either :)
  2. I think a mention in the readme file is enough.
ghost commented 1 year ago

btw, here are two gifs that I made by converting youtube videos:

https://imgur.com/a/VZErhY5 https://imgur.com/a/jmFBOTc

JammSpread commented 1 year ago

I personally use the script:

#!/bin/bash

output_name=$(echo $1 | cut -f 1 -d '.').gif

ffmpeg -i $1 -vf "fps=30,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop -1 $output_name

for converting videos to GIFs. I can then use it like so,

./converttogif recorded-short.mp4

I similarly find it useful for converting screen recordings to a GIF. The ffmpeg command used is based on the one found in the Arch Linux wiki. It is adjusted however for a framerate of 30 and the script shown above.

calculon102 commented 1 year ago

Hi @JammSpread and @LauraTaylorUK ,

sorry I'm short of time lately, so my responses take a while.

Thank you for your suggestions, nonetheless!

Would you like to prepare a pull request for the README?

I would suggest, adding a new heading at the bottom labeled "Sources for wallpapers". where you could also insert examples for converting videos.

Thank you!