Search code examples
ffmpegdrawtext

Applying two filters (Showwaves and Drawtext) at once with FFMPEG


I use this command for my video:

ffmpeg -i input.mp3 -i input.mp4 -y -ss 00:00:00 -t 00:00:10 -filter_complex "[0:a]showwaves=s=1920x175:colors=Yellow:mode=cline,colorkey=0x000000:0.01:0.1,format=yuva420p[v];[1:v][v]overlay=0:800[outv]" -map "[outv]" -pix_fmt yuv420p -map 0:a -c:v libx264 -c:a copy -shortest output.mp4

and this command to the video:

ffmpeg -i input.mp4 -y -ss 00:00:00 -t 00:00:10 -vf drawtext="fontfile=/path/to/font.ttf: text='My Text': fontcolor=white: fontsize=74: box=1: [email protected]: boxborderw=5: x=(w-text_w)/2: y=(h-text_h)/2" -c:v libx264 -c:a copy -shortest output.mp4

I want to combine these two command in one command. I see this question and try several times without success.


Solution

  • Just add it after the overlay :

    [1:v][v]overlay=0:800,
           drawtext="fontfile=/path/to/font.ttf: text='My Text': fontcolor=white: fontsize=74: box=1: 
           [email protected]: boxborderw=5: x=(w-text_w)/2: y=(h-text_h)/2"[outv]"