FFmpeg:Trim 视频然后添加带有多个文本的水印
FFmpeg: Trim video then add watermark with multiple text
我想 trim 一个视频,然后使用 FFMPEG 转换视频并在上面放置一个包含多个文本的水印。我有 trimming 的命令:
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
谁能帮我把它们组合在一起?
使用
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
我想 trim 一个视频,然后使用 FFMPEG 转换视频并在上面放置一个包含多个文本的水印。我有 trimming 的命令:
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
谁能帮我把它们组合在一起?
使用
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