Reputation: 37
I am overlaying a video on top of an image.
Using this command:
ffmpeg -i image.png -i input.mp4 -filter_complex "[0:v][1:v] overlay=10:10:enable='between(t,0,38)'" -pix_fmt yuv420p -c:a copy output.mp4
I understand the overlay=10:10
is the positioning but I can't seem to work out how to resize the overlay video (input.mp4
).
I think I need to use scale
but not sure how to.
Any help on scaling the overlay video would be appreciated!
Upvotes: 2
Views: 880
Reputation: 459
With filter_complex you can combine commands and make named outputs
Try something like this:
ffmpeg -i image.png -i input.mp4 -filter_complex "[1:v]scale=320x240[scaled_v];[0:v][scaled_v] overlay=10:10:enable='between(t,0,38)'" -pix_fmt yuv420p -c:a copy output.mp4
Just change resolution to what you need instead of 320x240
.
If you need image overlay on top of video, swap [1:v]
and [0:v]
Upvotes: 2