如何使用ffmpeg加速视频和添加水印

时间:2017-10-30 10:22:17

标签: video ffmpeg

我们如何使用ffmpeg加速视频和添加水印

加速视频我们有这个命令

ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mp4

我们用水印

"-y", "-i", j, "-i", image1, "-i", image2, "-i", image3, "-filter_complex",
               "[0:v][1:v] overlay=0:0:enable='between(t,1,2)'[tmp];" +
                       "[tmp][2:v] overlay=0:0:enable='between(t,5,7)'[tmp];"+
                       "[tmp][3:v] overlay=0:0:enable='between(t,9,11)'",
                "-c:v","libx264",  "-preset", "ultrafast", out;

我们如何合并机器人命令我有各种命令 像这样

    ""-y", "-i", j, "-i", image2, "-i", image2, "-i", image2, "-filter_complex",
     "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" +
             "[1:v] overlay=0:0:enable='between(t,1,2)'[tmp];" +
                  "[tmp][2:v] overlay=0:0:enable='between(t,5,7)'[tmp];"+
                    "[tmp][3:v] overlay=0:0:enable='between(t,9,11)'",
            "-map", "[v]", "-map", "[a]", "-b:v", "2097k", "-r", "60", "-vcodec", "mpeg4",
              "-preset", "ultrafast", out"

我们如何加速视频和添加水印

我得到的错误是

[AVFilterGraph @ 0xac59c530] No output pad can be associated to link label '1:v'.
Error initializing complex filters.

1 个答案:

答案 0 :(得分:2)

使用

"-y", "-i", j, "-i", image1, "-i", image2, "-i", image3, "-filter_complex",
               "[0:v]setpts=0.5*PTS[m];" +
               "[m][1:v] overlay=0:0:enable='between(t,1,2)'[tmp];" +
                       "[tmp][2:v] overlay=0:0:enable='between(t,5,7)'[tmp];"+
                       "[tmp][3:v] overlay=0:0:enable='between(t,9,11)';"  +
                       "[0:a]atempo=2.0",
                "-c:v","libx264",  "-preset", "ultrafast", out;