VideoHelp Forum
+ Reply to Thread
Results 1 to 3 of 3
Thread
  1. I have a video which is produced by ffmpeg concat images, like "ffmpeg -f concat -i concat.txt output.mp4"
    then I want add some text in the output video, so I use command
    Code:
    ffmpeg -y -i ./tmp/6ir0TW/concat.mp4 -vf "drawtext=text='hello':x=(w-text_w)/2:y=(h-100):fontsize=50:fontcolor=white:enable='between(t,0,1)',drawtext=text='world':x=(w-text_w)/2:y=(h-100):fontsize=50:fontcolor=white:enable='between(t,1,2)',drawtext=text='this is':x=(w-text_w)/2:y=(h-100):fontsize=50:fontcolor=white:enable='between(t,2,3)'" ./tmp/6ir0TW/draw_text.mp4
    my expectation is hello appear in the beginning, then hello disappear, world appear...
    but in the output I only see hello in the first 5 seconds. Does anyone know how can I fix this?
    In attachment is concated video file.
    Image Attached Files
    Quote Quote  
  2. The timestamps in your input video do not have enough "granularity" to specify between seconds. Individual frames displayed for a long time (ie. it's effectively a very low fps video)

    Code:
    # timecode format v2
    0
    8360
    17480
    26080
    33640
    41600
    Here is a "normal" video with 25fps , 40ms delta between frames, and your command line works ok on this

    Code:
    # timecode format v2
    0
    40
    80
    120
    160
    200
    240
    280
    To increase the fps and add frames to your video you can add -vf fps before drawtext

    Code:
    -vf "fps=25,drawtext=text..."
    There are some frames with overlapping text at 1,2 seconds because of drawtext "enable between" is inclusive
    Last edited by poisondeathray; 11th Apr 2024 at 11:11.
    Quote Quote  
  3. Originally Posted by poisondeathray View Post
    The timestamps in your input video do not have enough "granularity" to specify between seconds. Individual frames displayed for a long time (ie. it's effectively a very low fps video)

    Code:
    # timecode format v2
    0
    8360
    17480
    26080
    33640
    41600
    Here is a "normal" video with 25fps , 40ms delta between frames, and your command line works ok on this

    Code:
    # timecode format v2
    0
    40
    80
    120
    160
    200
    240
    280
    To increase the fps and add frames to your video you can add -vf fps before drawtext

    Code:
    -vf "fps=25,drawtext=text..."
    There are some frames with overlapping text at 1,2 seconds because of drawtext "enable between" is inclusive
    oh this is key point, I try this and solved, thanks.
    BTW, I find another way is, first re-encode concated video, then use re-encoded video to do the draw text, I think it's same reason.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!