You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Advantages are speed and maybe quality, we'd have to do some testing to see how the paletting related to PIL's paletting. Disadvantage is that it needs the ffmpeg exe, which is not available by default (though easy enough to install using one function call).
The pyAV plugin I am writing supports filters, so this should - in theory - be possible.
In practice, it depends on me figuring out how to send an EOF signal to palettegen, which is the FFmpeg filter that does all the magic here. See PyAV-Org/PyAV#886 for details.
Edit: Note that this only affects the global palette. Generating single palettes (using palettegen with stats_mode=single) works fine.
I submitted a PR to pyAV a few days back that allows sending EOF to a filter, so we will be able to use palettegen with the next pyAV release. From this point on it should be possible to generate GIF via ffmpeg, too.
pyAV released v9 recently which includes my changes to send EOF to filters (among other goodies). I've updated our pyAV plugin, and now we can indeed create GIF using ffmpeg (that use an optimized global palette):
(at the moment it's grayscale only until I work out how to handle frames with palette in pyav)
Activity
almarklein commentedon May 21, 2017
Also see #115
FirefoxMetzger commentedon Feb 14, 2022
The pyAV plugin I am writing supports filters, so this should - in theory - be possible.
In practice, it depends on me figuring out how to send an EOF signal to
palettegen, which is the FFmpeg filter that does all the magic here. See PyAV-Org/PyAV#886 for details.Edit: Note that this only affects the global palette. Generating single palettes (using palettegen with
stats_mode=single) works fine.FirefoxMetzger commentedon Mar 5, 2022
I submitted a PR to pyAV a few days back that allows sending EOF to a filter, so we will be able to use
palettegenwith the next pyAV release. From this point on it should be possible to generate GIF via ffmpeg, too.FirefoxMetzger commentedon Mar 10, 2022
pyAV released v9 recently which includes my changes to send EOF to filters (among other goodies). I've updated our pyAV plugin, and now we can indeed create GIF using ffmpeg (that use an optimized global palette):
(at the moment it's grayscale only until I work out how to handle frames with palette in pyav)
FirefoxMetzger commentedon Apr 5, 2022
And now we can do colored GIFs, too: