1234567
1234567

Reputation: 2485

how to speed up video and add watermark using ffmpeg

How can we speed up video and add watermark using ffmpeg

for speed up video we have this command

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

for water mark we use

"-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;

how can we merge bot commands I have various commands like this

    ""-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"

how can we speed video and add watermark

the error that i get is

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

Upvotes: 0

Views: 1167

Answers (1)

Gyan
Gyan

Reputation: 93271

Use

"-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;

Upvotes: 3

Related Questions