Coder Social home page Coder Social logo

Comments (3)

Montspy avatar Montspy commented on August 22, 2024

I tried layering GIFs with ffmpeg and was successful:

ffmpeg -y -i dancer.gif -ignore_loop 0 -i sunset.gif -filter_complex "[0][1]overlay=format=auto:shortest=1,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" output.gif

Overlay filter docs: https://ffmpeg.org/ffmpeg-filters.html#overlay-1
output

from loopygen.

Montspy avatar Montspy commented on August 22, 2024

For metadata generation of MP4s, we should generate a GIF out of it for image until explorer can handle non-images in image, or until we get marketplace

from loopygen.

Montspy avatar Montspy commented on August 22, 2024

Turns out MP4 (aka h.264) does not support alpha channels.
The recommended video format with alpha for web is WebM with VP9 codec. https://pixelbakery.co/recipes/list-of-video-image-formats-in-2021-supporting-alpha-channels
ffmpeg supports WebM with VP9. Example command for conversion with alpha channel:

ffmpeg -y -i sunset.gif  -c:v libvpx-vp9 -b:v 0 -crf 30 -row-mt 1 -pix_fmt yuva420p sunset.webm

-c:v libvpx-vp9 forces the libvpx VP9 codec
-b:v 0 -crf 30 forces variable bitrate with constant quality (good for final export) of 30 (0-63, lower is higher quality)
For intermediate steps, I'm thinking of using -lossless instead. Both for speed and to limit the quality loss with high layer counts
-row-mt 1 is using row multithreading. To be confirmed if this speeds conversions up or not
-pix_fmt yuva420p uses YUVA (YUV+Alpha) 4:2:0 pixel format. 4:2:0 is the most used on the web

from loopygen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.