简体   繁体   English

使用ffmpeg转换视频以创建带有多个文本的水印

[英]Convert video using ffmpeg for watermark creation with multiple text

I want to convert a video using FFMPEG and place a watermark with multiple texts on it. 我想使用FFMPEG转换视频,并在其上放置带有多个文本水印 Combining the commands for placing a text and a watermark is : 组合用于放置文本和水印的命令是:

ffmpeg -i input_1.mp4 -i watermark_small.png -filter_complex "[0]overlay=10:10; [1]drawtext=enable='between(t,0,12)':fontfile=font.ttf:text='Some text' : fontcolor=black: fontsize=18: box=1: boxcolor=yellow@0.5:boxborderw=5: x=(w-text_w)/1.15:y=30, drawtext=enable='between(t,14,22)':fontfile=font.ttf:text='Next text' : fontcolor=black: fontsize=18: box=1: boxcolor=yellow@0.5:boxborderw=5: x=(w-text_w)/1.15:y=30" -codec:v libx264 -preset ultrafast output1.mp4

Unfortunately this command puts the watermark and the first text but not the next text. 不幸的是,该命令放置了水印和第一个文本,但没有下一个文本。 I assume the problem is on -filter_complex setting. 我认为问题出在-filter_complex设置上。 Unfortunately I don't know how to set it in the right way in order to work. 不幸的是,我不知道如何以正确的方式设置它才能正常工作。 Could someone help me and say what needs to be changed in this command in order to convert it in the right way? 有人可以帮我说一下此命令中需要更改的内容,以便以正确的方式进行转换吗?

Change: 更改:

[0]overlay=10:10; [1]drawtext

To: 至:

[0:v][1:v]overlay=10:10,drawtext
  • Manually define input labels for filters instead of relying on defaults. 手动定义过滤器的输入标签,而不是依赖默认值。
  • Use , to linearly join filters that accept a single input and/or output. 使用,线性连接接受单个输入和/或输出的过滤器。 This creates a filterchain. 这将创建一个过滤链。 Use ; 使用; when you want to join filterchains. 当您想加入过滤链时。 See FFmpeg Filters Documentation for more info. 有关更多信息,请参见FFmpeg过滤器文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM