Ask Your Question
4

What is the correct method of adding a background image with ffmpeg?

asked 2021-09-20 11:00:00 +0000

david gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-02-24 19:00:00 +0000

lakamha gravatar image

The correct method of adding a background image with ffmpeg is using the "overlay" filter.

The command to add a background image can be written as follows:

ffmpeg -i input.mp4 -i bg.jpg -filter_complex "overlay=0:0" output.mp4

Explanation: - "input.mp4" is the input video file. - "bg.jpg" is the background image file. - "overlay=0:0" applies the "overlay" filter to place the background image at the top-left corner of the video. The coordinates can be adjusted based on the desired position. - "output.mp4" is the output video file.

Note: The resolution of the background image should match the resolution of the input video file. If not, the image can be resized using the "scale" filter.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-09-20 11:00:00 +0000

Seen: 1 times

Last updated: Feb 24 '22