Discussion:
[FFmpeg-user] How to add own, subtitles (resp. pure text) into existing MP4 video?
Ben
2018-12-09 12:45:52 UTC
Permalink
Assume I have an existing well-encoded MP4 video WITHOUT subtitles.

Now I want to add the text "foobar testtext" with fontsize=18 and fontfamily Verdana into video beginning at 1min23sec and ending at 3min44sec centralized 30 pixels above lower border.

How can I most easily achieve this with ffmpeg?

I possible/necessary the text could be put fix encoded into video and not only as traditional subtitle.

_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org
Micael Silva
2018-12-09 13:30:23 UTC
Permalink
Post by Ben
Assume I have an existing well-encoded MP4 video WITHOUT subtitles.
Now I want to add the text "foobar testtext" with fontsize=18 and
fontfamily Verdana into video beginning at 1min23sec and ending at
3min44sec centralized 30 pixels above lower border.
How can I most easily achieve this with ffmpeg?
I possible/necessary the text could be put fix encoded into video and not
only as traditional subtitle.
Reeconde using drawtext filter like:

- vf
"drawtext=enable='between(t,83,224)':fontfile=/path/to/Verdana.ttf:text='foobar
testtext':fontcolor=white:fontsize=18:x=(w/2)-(tw/2):y='(0-max_glyph_a)+(h-30)'"

'enable' is a timeline editor, activating the filter only when the time is
between 83 seconds (1min23s) and 224 seconds (3min44s). X coordinate is
calculated with the middle of the text and the middle of the input video
and Y coordinate with the heigth total of the text and the height of input
video minus 30 pixels
_______________________________________________
ffmpeg-user mailing list
ffmpeg-***@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-***@ffmpeg.org with

Loading...