Created
April 1, 2019 14:26
-
-
Save PhoenixIllusion/9f6a0df972423da4af49697a333c1cb6 to your computer and use it in GitHub Desktop.
Takes a source gif, an overlay image, and a transformed texture square to render under the overlay image. Position animated GIF inside image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FILTER=" | |
| [0:v] scale=512:512[src]; | |
| [2:v]format=rgba64,colorchannelmixer=rr=1/128:bb=1/128[map16]; | |
| [map16]extractplanes=r+b+a[x][y][a]; | |
| [src][x][y]remap[remap]; | |
| [remap][a]alphamerge[remapa]; | |
| [remapa][1:v]overlay" | |
| echo "====" | |
| echo $FILTER | |
| echo "====" | |
| GIF=$1 | |
| OVERLAY=$2 | |
| MASK=$3 | |
| OUT=$4 | |
| ffmpeg -i $GIF -i $OVERLAY -loop 1 -i $MASK \ | |
| -filter_complex "${FILTER}" \ | |
| -pix_fmt yuv420p \ | |
| $OUT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment