Add text watermark with ffmpeg, set fontfile to invalid solution.

Release time:2024-02-23 22:04:37 Number of words:493 Reading:8859Times

Cause Analysis:

The colon : is present in the full path of the font file.

If there is a path:

C:/ffmpeg/fonts/SourceHanSansCN-Regular.ttf

There is a colon after the C character, it will be recognized by ffmpeg as a separator, you need to use \\ to escape the colon.

Just change the above path to the following:

C\\\:/ffmpeg/fonts/SourceHanSansCN-Regular.ttf

The complete code is as follows:

-vf drawtext="fontfile=C\\\\:/ffmpeg/fonts/SourceHanSansCN-Regular.ttf:text='test'"

Comments (0 of)

Comments (0 of)

Suggestions and feedback Contact Us