ffmpegdrawtextfluent-ffmpeg

Next drawtext clears the previous one ffmpeg


ffmpeg.exe -i ffmpeg_inputs/zheltiy_chelik.mp4  -vf "[in]drawtext=fonts/Temporarium.otf:text='r':fontcolor=orange:fontsize=100:x=(w-text_w)/2+0:y=0:enable='between(t,0, 11)', drawtext =fonts/Temporarium.otf:text = 'r':fontcolor=orange:fontsize=100:x=(w-text_w)/2+20:y=0:enable='between(t,11, 22)', drawtext =fonts/Temporarium.otf:text = 'r':fontcolor=orange:fontsize=100:x=(w-text_w)/2+40:y=0:enable='between(t,22, 33)'[out]" ffmpeg_outputs/test2.mp4 -y 

There is such a ffmpeg line. Its meaning is to draw a letter 20 pixels to the right of the current position of the word every 11 seconds, and in this way "write the word". But here's the problem - when the second letter starts to render, it overwrites the first, and the third, respectively, overwrites the second. The string seems to have prescribed [in] and [out] but does not help, maybe someone has ideas


Solution

  • If I understand you correctly, you want the typewriter effect.

    Your three drawtext filters have non-overlapping enable time ranges. To get the effect, each should end at the same time instead.

    ffmpeg.exe -i ffmpeg_inputs/zheltiy_chelik.mp4 -vf "[in]drawtext=fonts/Temporarium.otf:text='r':fontcolor=orange:fontsize=100:x=(w-text_w)/2+0:y=0:enable='between(t,0, 33)', drawtext =fonts/Temporarium.otf:text = 'r':fontcolor=orange:fontsize=100:x=(w-text_w)/2+20:y=0:enable='between(t,11, 33)', drawtext =fonts/Temporarium.otf:text = 'r':fontcolor=orange:fontsize=100:x=(w-text_w)/2+40:y=0:enable='between(t,22, 33)'[out]" ffmpeg_outputs/test2.mp4 -y