FFmpeg:修剪视频,然后添加多个文本的水印

时间:2016-11-20 21:52:22

标签: ffmpeg video-processing android-ffmpeg

我想修剪视频,然后使用FFMPEG转换视频,并在其上放置带有多个文本的水印。我有修剪命令:

ffmpeg -i 1.mp4 -ss 00:00:03 -t 00:03:08 -async 1 -c copy output1.mp4

和带文字放置的水印

ffmpeg -i 1.mp4 -i watermark_small.png -filter_complex "[0:v][1:v]overlay=10:10, 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

有人可以帮我把它们组合在一起吗?

1 个答案:

答案 0 :(得分:1)

使用

ffmpeg -ss 00:00:03 -t 00:00:08 -i 1.mp4 -i watermark_small.png -filter_complex 
  "[0:v][1:v]overlay=10:10, 
   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"
-c:v libx264 -preset ultrafast output1.mp4