【问题标题】:Add a Text and a images to the video using ffmpeg使用 ffmpeg 将文本和图像添加到视频中
【发布时间】:2019-02-27 02:36:11
【问题描述】:

我在主题中阅读了这个问题: FFMPEG overlay two video and add text

ffmpeg -i raw_video.mp4 -i watermark.png -i watermark2.png -filter_complex [0:v]drawtext=fontfile=font.ttf:text='text1':fontcolor=black@1.0:fontsize=24:x=20:y=259, drawtext=fontfile=font.ttf:text='text2':fontcolor=black@1.0:fontsize=24:x=500:y=500[text]; [text][1:v]overlay=215:0[ol1];[ol1][2:v]overlay=400:300[filtered]"-map "[filtered]" -codec:v libx264 -codec:a copy output.mp4  "

我尝试使用这个 ffmpeg 但它出错了。

请帮帮我

【问题讨论】:

  • 您需要提供错误信息。显示命令的完整日志。
  • 嗨 llogan,我尝试使用下面的命令添加图像和文本,但我在视频中看到图像并且文本不显示:ffmpeg -i output.mp4 -i images.png - filter_complex "[0:v] 覆盖=25:25:enable='between(t,0,20)';[v]drawtext=text='abccccc':fontfile=/usr/share/fonts/truetype/ubuntu- font-family/Ubuntu-R.ttf:x=(w-text_w):y=(h-text_h):fontsize=30:fontcolor=white" -pix_fmt yuv420p -c:a copy output123.mp4

标签: ffmpeg


【解决方案1】:

你的第一个命令

问题1:该命令有一个尾随"导致错误:

[AVFilterGraph @ 0x55f096873c40] No such filter: ''
Error initializing complex filters.
Invalid argument

删除结尾的"

问题 2:缺少空格

[filtered]"-map 更改为[filtered]" -map

问题 3:Filtergraph 未引用

用引号将过滤图括起来:"[0:v]drawtext...overlay=400:300[filtered]"


你的第二个命令

问题:未标记的过滤器链被忽略

enable='between(t,0,20)';[v]drawtext 更改为enable='between(t,0,20)',drawtext 并读取Filtering IntroductionFiltergraph description

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-06-14
    • 1970-01-01
    • 1970-01-01
    • 2012-01-01
    • 1970-01-01
    • 2019-03-11
    • 2021-03-16
    • 1970-01-01
    相关资源
    最近更新 更多