This subject was discussed here before but my problem is a little different. I have a transparent tiff sequence with sequential numbers that I wish to overlay on top of another tiff sequence in order to create a video file.

In addition, I'd like to add a text overlay from a text file using the drawtext filter.

Seperatly, I've managed to do both of these actions but when I try to combine them to a single command line, the code either doesn't work or it produces only one of the video filters.

This is the code I've used for the sequential numbers overlay:

ffmpeg -i sc060_sh0050_v02.%4d.tif -i %d.tif -vcodec v210 -filter_complex overlay -shortest 00output.mov

And this is the code I've used for the title overlay:

ffmpeg -f image2 -i sc060_sh0050_v02.%4d.tif -vcodec v210 -vf "[in]drawtext=fontfile=Arial.ttf: fontsize=50: textfile=filename.txt: r=25: x=100: y=(lh): fontcolor=0x76FF08: box=1: boxcolor=0x00000099[out]" -y 00output.mov

Does anyone know of a way I can make both effects work in a single command line?

  • 1
    what's the failing command line?
    – rogerdpack
    Jun 18, 2013 at 0:11

1 Answer 1

ffmpeg \
-i sc060_sh0050_v02.%4d.tif \
-i %d.tif \
-vcodec v210 \
-filter_complex "[0:v][1:v]overlay,drawtext=fontfile=Arial.ttf:fontsize=50:textfile=filename.txt: r=25: x=100: y=(lh): fontcolor=0x76FF08: box=1: boxcolor=0x00000099" \
-shortest \
-y \
  1. You must use filter_complex because an overlay has two inputs.
  2. First overlay sequence %d.tiff over sc060_sh0050_v02.%4d.tif
  3. Add the drawtext filter. Note the comma between overlay and drawtext chains the filters.

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.