Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques ffmeg write text on a video

  • ffmeg write text on a video

    Posted by Jefferson Goven on May 3, 2011 at 2:35 pm

    Hello i installed ffmeg with the drawtext option, I do:

    ffmpeg -i file.mov -vf drawtext=”fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf:text=’Text to write’:fontsize=20:fontcolor=black:x=100:y=100″ final.mov

    it works but i would like to make the text appear at a specific time around 3 or 5 sec after the video start

    Thanks

    Ashish Tondak replied 10 years, 8 months ago 4 Members · 5 Replies
  • 5 Replies
  • Michael Rampe

    May 5, 2011 at 12:27 am

    [jefferson Goven] “Hello i installed ffmeg with the drawtext option, I do:

    ffmpeg -i file.mov -vf drawtext=”fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf:text=’Text to write’:fontsize=20:fontcolor=black:x=100:y=100″ final.mov”

    I recompiled and tried this and it works well. Last time I tried it had several issues. One feature I am looking for is “centre justified” text which seems not to be an option. Any ideas?

    [jefferson Goven] “it works but i would like to make the text appear at a specific time around 3 or 5 sec after the video start

    No ideas specifically using libavfilter….. I will have a look into it. A workaround would be to generate an overlay “movie” first with alpha with text that doesn’t start until this time. Of course, this would not be using the drawtext filter but the overlay filter…….. I will keep thinking.

    Michael

  • Basavaraju Gandla

    December 17, 2013 at 8:12 am

    Hi Michael,

    I have been working on the same issue.
    I was trying to add text while capturing.
    Do I have to do it before encoding or after encoding ?
    Can you please suggest me the right way to overlay text on video file through program rather than pipelines.

    Thank you,

    Regards,
    Baz

  • Jefferson Goven

    December 17, 2013 at 6:51 pm

    I did it before encoding for me because i had to merge multiple sounds and videos after.

  • Basavaraju Gandla

    December 18, 2013 at 7:16 am

    Hi jefferson Goven,

    I am really glad for your reply.
    Can you please send me the example code, How you have done it.

    Thanking you,
    Regards,
    Basavaraju Gandla

  • Ashish Tondak

    October 20, 2015 at 7:05 am

    ffmpeg -y -i backdrop.mp4 -vf drawtext=”text=’Test sdafsdafasdfadsfdsf’:enable=’between(t,3,8)’:fontfile=’/usr/share/fonts/truetype/freefont/FreeSerif.ttf’:fontsize=20:fontcolor=red:x=100:y=100″ -t 10 -acodec copy hmmm9999999.mp4

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy