Using ffmpeg to add text watermark settings fontfile invalid solutions

Release time:2024-02-23 22:04:37 Word count:463 Reading:944Times

Cause analysis:

colon: in font file full path.

If there is a path:

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

there is a colon after the drive letter C, which will be recognized as a separator by ffmpeg. You need to use \\to escape the colon.

Modify the above path as follows:

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 in total)

Suggestions and Feedback Contact us