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
Related
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
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.
I am developing an app in which I need to overlay text images gif on an image and want to add animation on each overlay item and then save it as an mp4 video. Till now I can create the video but how can I add animation to the overlay
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.
i use stream
ffmpeg -i smed.ts -filter_complex "scale=640:360, crop=1/3*in_w:1/3*in_h" smed3.ts
but it only in mid video ,but i want it in right corner video .please help me
Use
crop=iw/3:ih/3:iw*2/3:0
for top-right corner.
crop=iw/3:ih/3:iw*2/3:ih*2/3
for bottom-right corner.
crop=iw/3:ih/3:iw*2/3
for middle-right.