Corion has asked for the wisdom of the Perl Monks concerning the following question:
In my latest side-project, I'm generating pretty animated pictures as a side effect. I want to show them off to a larger public, but publishing animated GIFs is somewhat disappointing as the GIFs are unreasonably large, weighing in at 10 MB or so.
I'm already using Prima and Imager or ScreenToGif to get the single frames for the animation, mostly as separate PNG images, and I'm looking for a good Perl API to combine the single frames into a .webm and .mp4 video to get vast gains of quality while vastly reducing file size at the same time. A quick test showed me a file size of 80kb for .webm with a file that was 7MB as a .gif.
Writing a script or module that runs ffmpeg over a set of frames is easy to do.
My main question is if there are known and used APIs for converting multiple still frames into an animation. Imager has the ->write_multi() API to write multiple frames to an animated .gif, and I could shim my "run-ffmpeg" module as another file type for Imager. But maybe there is a better API out there already?
What module do you use to combine multiple image frames into another file?
What module do you use to access single frames of a video?
Is somebody aware of ffmpeg as a statically linkable library so that instead of shelling out to ffmpeg, the black magic happens within Perl?
If there are no suggestions, I will likely try to implement the ffmpeg-writer as a filetype for Imager, much in the way that ImageMagick calls out to other modules.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Searching for an API for writing sequential images into a file ("Movie")
by BrowserUk (Patriarch) on Nov 07, 2016 at 16:23 UTC | |
|
Re: Searching for an API for writing sequential images into a file ("Movie")
by pryrt (Abbot) on Nov 07, 2016 at 15:45 UTC | |
|
Re: Searching for an API for writing sequential images into a file ("Movie")
by robby_dobby (Hermit) on Nov 07, 2016 at 13:10 UTC | |
by Corion (Patriarch) on Nov 07, 2016 at 13:23 UTC |