0

Apologies for being a ffmpeg noob, but I'm having trouble with modifying the answer to

Add image under the video with ffmepg

to place the image above instead of below the video...

My questions is in regard to modifying the command

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

I tried many different variations of this command to no avail and I think its my misunderstand of filter_complex and the meaning of "[1:v]" "[bottom]" and "[0:v]"

Thanks in advance for your help!

0

The basic form will be

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

A label of the form 1:v, equivalent to 1:v:0 within filters, is a stream specifier - it means use the first video stream of the 2nd input. 0:v refers to the first video stream of the first input.

The bottom in your command and top in mine are arbitrary labels assigned to the result of the scale filter.

Then that resulting stream is fed first to the vstack so that it gets stacked on top.

  • Thank you for the quick response! Now looking at it it seems so clear but you have no idea how many different orderings of the first command that I tried to no avail! – Stephen Johnston Sep 15 '18 at 15:53

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.