1

Trying to add a logo (same logo) to multiple input streams (videos) in ffmpeg.

ffmpeg -i INPUT.mp4 -i test_logo.png -filter_complex "overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2[v]; [v][v][v]hstack=inputs=3[top]; [v][v][v]hstack=inputs=3[bottom]; [top][bottom]vstack=inputs=2" OUTPUT.mp4

This results in only the first call of [v] (top left video) having the logo, the others are blank (video without the logo).

Any advice?

1 Answer 1

1

You have found a bug in FFmpeg...

Workaround:
Use split filter after overlay - split the video with the logo into 6 video streams, and stack the 6 streams:

ffmpeg -i INPUT.mp4 -i test_logo.png -filter_complex "overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2,split=outputs=6[v0][v1][v2][v3][v4][v5]; [v0][v1][v2]hstack=inputs=3[top]; [v3][v4][v5]hstack=inputs=3[bottom]; [top][bottom]vstack=inputs=2" OUTPUT.mp4

4
  • This worked like a charm, many thanks! Didn't expect to find a bug honestly (thought it was user error), is there anywhere I can report this?
    – janezkuhar
    Jul 12, 2022 at 8:37
  • There is a chance that this bug is already reported (or even fixed). You may use Google for finding how to open a new bug report (I never reported a bug for FFmpeg).
    – Rotem
    Jul 12, 2022 at 9:01
  • Ticket is trac.ffmpeg.org/ticket/9830. I've edited the title and provided a minimal command example.
    – Gyan
    Jul 12, 2022 at 11:04
  • Oh so it is a bug, my mistake. Also apologies since I'm new to ffmpeg and not familiar with the terms used for various variables and such, thank you for the edit.
    – janezkuhar
    Jul 12, 2022 at 11:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .