7

I want to extend basic usage of watermark and put it under the video. That means. I have input video 720x480 and image 720x20. On output i want to have video 720x500 where video aspect is preserved and positioned to top and image is added to bottom.

input video

|--------------------------|
|                          |
|                          |
|                          |
|          720*480         |
|                          |
|                          |
|                          |
|--------------------------|

input image

|--------------------------|
|          720x20          |
|--------------------------|

output video

|--------------------------|
|                          |
|                          |
|                          |
|          720*480         |
|                          |
|                          |
|                          |
|--------------------------|
|          720x20          |
|--------------------------|

Thanks

  • Can you upload an image to see what you need? – p2or Jan 9 '15 at 15:39
  • @poor - put another way, he is saying he wants to append the image to the bottom of the video. So the output should be the entire original video with the image below it. (The top edge of the image would be directly next to the bottom edge of the video.) – AJ Henderson Jan 9 '15 at 15:42
  • 1
    I added some visualization :) – Schovi Jan 9 '15 at 16:22
5

I think it's probably easier to combine (stack) a full dimension background image (720x500px) with your video in ffmpeg instead of adding the 20px footer to the video. You can simply use the overlay filter for this:

ffmpeg \
    -loop 1 -i 720x500.jpg \
    -i 720x480.mp4 \
    -filter_complex overlay=0:0 \
    -t 0:01.48 \ 
    out.m4v

Note: In this example you have to set the duration of your output video manually with -t parameter.


If you don't want to specify the duration you can use shortest flag within the filter if you use -loop 1 as @LordNeckbeard mentioned in the comments below:

ffmpeg \
    -loop 1 -i 720x500.jpg \
    -i 720x480.mp4 \
    -filter_complex "overlay=0:0:shortest=1" \
    out.m4v
  • 1
    If you use -loop 1 then you can set shortest=1 in your overlay filter, as in overlay=0:0:shortest=1. – llogan Jan 11 '15 at 19:43
  • @LordNeckbeard Thanks for your ideas! I've updated my answer. – p2or Jan 12 '15 at 6:36
5

Use the vstack filter:

hstack

ffmpeg -i video.mp4 -i image.png -filter_complex vstack output.mp4

If the image is not the same width as the video then resize it with the scale filter:

ffmpeg -i video.mp4 -i image.png -filter_complex "[1:v]scale=320:-1[bottom];[0:v][bottom]vstack" output.mp4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.