How to use ffmpeg to add text watermark to video in php
This article shows you how to use ffmpeg to add text watermark to video in php, the content is concise and easy to understand, it can definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
In the corresponding version of the download server (the server is windows), set the path of ffmpeg environment variables, and then cmd executes the command
Ffmpeg-y-t 60-I target.mp4-vf drawtext=fontfile=simhei.ttf:text= "abcd watermark content": x=w/10:y=h/2:fontsize=24:fontcolor=white:shadowy=2 new.mp4
Explain the parameters.
Y confirm directly, no need to enter y
T 60 intercepts the first 60 seconds, which is a specific requirement of the project
I input the original video
Actually, I don't know about vf. It seems to add a filter, and the text watermark is also added with a filter.
Drawtext draws text, that is, text watermark. The first parameter related to this seems to be written as =, and the other parameters as follows:
Fontfile font file, windows seems to automatically navigate to C:\ Windows\ Fonts
Text text watermark content
X x coordinate, you can fill in the number directly, or you can use width calculation such as half width wbank 2
Y y coordinates, you can fill in the number directly, or you can use height calculation such as half the height hash 2
Fontsize watermark font size, directly fill in the number, other little research
Fontcolor watermark color, can fill the common white,yellow,rgb has not been tried, do not seem to have, but may also be black
Shadowy doesn't know.
The above content is how to use ffmpeg to add text watermark to video in php. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.