FFMPEG Wipe transition one layer over another - ffmpeg

How to reveal one layer over another with a wipe transition using FFMPEG?
NOTE: this is not a slide transition. The top image stays in one position but is gradually revealed over time.
I'd like a technique that can work for top layers with or without transparency and for images, videos or dynamically created sources, like showwavespic.
I tried making a mask animation like so:
but alphamerge doesn't work as I expected it to and I can't find a blend mode that works with this type of mask.
EDIT: The xfade filter was suggested but it doesn't seem to work with when source has transparency. It renders transparent areas black. Example with transparent source:
But xfade renders this:

ffmpeg -loop 1 -t 5 -i flower.jpg -t 5 -loop 1 -i gear.png -filter_complex "[0]format=rgb24,drawbox=thickness=fill,split[black][black2];[black2]negate[white];[black][white]xfade=transition=wiperight:duration=1:offset=0[alf];[0][1]overlay=format=auto[ovr];[ovr][alf]alphamerge[fg];[0][fg]overlay=format=auto,format=yuv420p" output.mp4
format filter will allow drawbox to make true black color. Otherwise it may make a semi-transparent overlay as in the example GIF where you can barely see though the gear (I didn't notice when I initially made it). If you want YUV instead of RGB use yuv444p for example instead of rgb24.
drawbox covers flower.jpg with black. Alternatively you can use the color (and optionally scale2ref) filters. This is a lazy way to make a black image the same size as the input.
split filter makes a copy of the black image and negate filter makes the copy white.
xfade makes an animated alpha mask from the black and white images.
alphamerge adds the alpha mask to the output from overlay.
The resulting overlay with alpha is overlaid over flower.jpg.
Also see
FFmpeg Filter Documentation
FFmpeg Wiki: xfade for a gallery of transition effects.

Related

How to rotate only the text in ffmpeg and not the whole video

am using this command to put text on a video
/usr/bin/ffmpeg -i $urlVideo $startFlags 'drawtext=fontfile=$font:text=$text:fontcolor=$color:x=$x: y=$y: fontsize=$size$enable' $endFlags " . $resultFilePath
so i added the rotate argument to rotate a text (rotate=0.3). so the result was that the hole file was rotated. how to rotate only the text?
thank you.
PS:am so new to ffmpeg :3
Here is a -vf option expression example:
color=c=black#0,drawtext=text=Test Text:x=w/2:y=h/2,rotate=PI/6:fillcolor=black#0[L0];
[in][L0]overlay=shortest=true
For precise positioning, you can try:
size color source to match your text size.
let rotate to expand frame size.
remember rotate rotates the frame about its center
use overlay's x and y options to place the text in its final position

FFmpeg filters for shadow, opacity, stroke to input video

I would like to apply more filters like shadow, stoke, and opacity to input video(mp4 or vp9 format transparent video). I went through FFmpeg documentation but couldn't find the right way. I would like to know if there is any possibility of adding the above filter to the video. Thank you.

how I could do green screen effect in ffmpeg for put a image into video with whte background using ffmpeg?

how I could do a green effect but instead of green color change all white color for another background
like this video
https://www.youtube.com/watch?v=zgge8y9YUEs
please help me

How to add text with zoom out effection on video in FFMpeg?

I am developing android app with ffmpeg.
I`d like to add text on video and set the zoom out animation on it.
I can marquee the text from bottom to top and from left to right.
If someone has experiences on zoom out animation of text with FFMpeg, please give me the tip.
Here is my code.
ffmpeg -i input.mp4 -vf "drawtext=fontfile=/path/to/font.ttf: text ='Test Line':fontcolor=red:fontsize=65:x=100: y=if(lt(t\,8)\,30*t\,240)" output.mp4

Convert to animated gif, transparency does not re-emerge

I am making an animated gif.
This gif is 50 frames or so and it contains quite some transparency.
The problem is that when transparency is to reemerge in the gif, it doesn't and instead continues to display whatever color was at that given pixel before the transparency was to appear.
How can i make the animated gif showing transparency when the given pixel becomes transparent?
Below is the terminal command i use to create this flawed gif.
convert -delay 5 -loop 0 pics/1.gif pics/2.gif animation.gif'
You apply the 'dispose background' option.
see: http://www.imagemagick.org/Usage/anim_basics/

Resources