Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

smariot.com/animate

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smariot.com/animate

Go Modules
Version
v0.1.0
Version published
Created
Source

Golang FFMPEG Animation Package

This package creates an image that can be drawn on, and provides an EmitFrame() method to pipe the image to FFMPEG, and a Close() method to finish the animation.

The process of actually drawing frames of animation is left as an exercise for the reader.

The extension of the destination file determines the encoding format and parameters:

  • .gif: Creates a looping indexed GIF animation.

    Generating an optimal palette would require buffering the entire animation, so instead a fixed general purpose palette is used.

  • .png/.apng: Creates a looping animated PNG image. Lossless and supports transparency.

    This is the only supported format that is both completely lossless and supports transparency.

  • .mp4: Creates an MP4 video using the libx264rgb codec with the ultrafast preset. Should be lossless, but doesn't support transparency.

    The file will be quite large, and probably isn't something you'd want to distribute directly.

  • .mkv: Identical to MP4, except with a Matroska container.

  • .webp: Creates a looping WEBP animation. The RGB->YUV conversion is lossy, but is otherwise lossless and supports transparency.

  • .webm: Creates a WEBM video. The RGB->YUV conversion is lossy, but is otherwise lossless and supports transparency.

Installation

go get smariot.com/animate

Documentation

You can find the documentation at https://pkg.go.dev/smariot.com/animate.

Demo

The cmd/demo directory contains a simple program to demonstrate this package by generating the following image:

Munching Square

FAQs

Package last updated on 16 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts