1

I currently have a line that makes my video have a watermark in the bottom right corner.

ffmpeg -i video.mp4 -vf drawtext=text=WATERMARKTEXT:x=w-tw-10:y=h-th-10:fontfile=\\Windows\\Fonts\\Montserrat-Regular.ttf:fontsize=32:fontcolor=white -vcodec libx264 -crf 20 -acodec copy output.mp4;

What I want to do is add an image file .png or .jpg doesn't really matter and display that before the video starts for 5 seconds.

Is this possible all I could find and understand did something with combining the video and the image but if I do like that I will have to encode it with watermark first then combind it with the other one.

1

Use the concat filter to join the image to the video:

ffmpeg -framerate 25 -loop 1 -t 5 -i image.png -t 5 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -i video.mp4 -filter_complex "[2:v]drawtext=text='foo'[main];[0][1][main][2:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" output.mp4
  • The image should be the same width and height of the video, so you may have to add the scale, scale2ref, crop, and/or pad filters before concatenation.

  • If the main video has audio then the image needs have audio as well. Generating silent audio with anullsrc as shown in the example can suffice. Make sure to match the channel layout and sample rate of the main input.

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.