[FFmpeg-user] Add filter_complex overlay to existing command.

William C Bonner wbonner at wimsworld.com
Fri Apr 7 06:46:13 EEST 2023


On Thu, Apr 6, 2023 at 8:41 PM William C Bonner <wbonner at wimsworld.com>
wrote:

> I found an example and was able to get a complex filtergraph working. I'm
> replying to my original post in case it helps anyone else down the road.
>
> ffmpeg -report -start_number 275 -i 1218%04d.JPG -start_number 275 -i
> 1218%04d.png -filter_complex
> "[0]crop=in_w:9/16*in_w,drawtext=fontfile=C\\:/Windows/Fonts/consola.ttf:fontcolor=white:fontsize=main_h/16:y=main_h-text_h-50:x=main_w-text_w-50:text=WimsWorld,drawtext=fontfile=C\\:/Windows/Fonts/consola.ttf:fontcolor=white:fontsize=main_h/16:y=main_h-text_h-50:x=50:text=%{metadata\\:DateTimeOriginal}[1]overlay[out];"
> -map [out] -c:v libx265 -crf 23 -preset veryfast -movflags +faststart -bf 2
> -g 15 -pix_fmt yuv420p -y 1218-2160p30.mp4
>
>
> So sorry.. That last command was the wrong command stuck in my copy/paste
buffer.  This is the correct command. with the [bg];[bg] between the
processing on the first file and the second file, connecting them together.

ffmpeg -report -start_number 275 -i 1218%04d.JPG -start_number 275 -i
1218%04d.png -filter_complex
"[0]crop=in_w:9/16*in_w,drawtext=fontfile=C\\:/Windows/Fonts/consola.ttf:fontcolor=white:fontsize=main_h/16:y=main_h-text_h-50:x=main_w-text_w-50:text=WimsWorld,drawtext=fontfile=C\\:/Windows/Fonts/consola.ttf:fontcolor=white:fontsize=main_h/16:y=main_h-text_h-50:x=50:text=%{metadata\\:DateTimeOriginal}[bg];[bg][1]overlay=20:20[out];"
-map [out] -c:v libx265 -crf 23 -preset veryfast -movflags +faststart -bf 2
-g 15 -pix_fmt yuv420p -y 1218-2160p30.mp4


More information about the ffmpeg-user mailing list