1

How to rescale input video then scale and overlay watermark with Ffmpeg?

I've tried both these commands and they don't work. Can someone help me with the process?

-vf \"movie={watermarkPath}[watermark]; [in] scale=720:-1 [scale]; [scale] [watermark] overlay=main_w-overlay_w-10:10 \"
-filter_complex \"[0:v]scale={wm.Item3}:{wm.Item4}[bg];[bg][1:v]movie='{watermarkPath}'[wm];[wm][0] scale2ref={wm.Item1}:{wm.Item2}[wm] [v];[wm] setsar=1[logo];[v] [logo] overlay=main_w-overlay_w-10:10\"
CurlyFro
  • 1,862
  • 4
  • 22
  • 39
  • Show the actual, unscripted command (the second one) and the complete console output. Showing actual errors is always more informative than just saying it "doesn't work". – llogan Jun 22 '17 at 16:50
  • ffmpeg -i Wildlife_1897.wmv -i videoendocrinology_watermark.png -filter_complex "[0:v]scale = 512:-1[bg];[1:0] scale2ref=213:42 ; [bg] [1:v] overlay=main_w-overlay_w-10:10" output.mp4 – CurlyFro Jun 22 '17 at 19:49
  • this command results in this error: – CurlyFro Jun 22 '17 at 19:52
  • Cannot find a matching stream for unlabeled input pad 1 on filter Parsed_scale2ref_1 – CurlyFro Jun 22 '17 at 19:52
  • got it: ffmpeg -i Wildlife_1897.wmv -i videoendocrinology_watermark.png -filter_complex "[1]scale=212:42[wm]; [0]scale = 720:404[scaledv];[scaledv][wm] overlay=main_w-overlay_w-10:10" output.mp4 – CurlyFro Jun 22 '17 at 20:25
  • 1
    You should always [edit] your question to add more info instead of trying to cram it into comments, and always show the **complete** console output, not just excerpts. – llogan Jun 22 '17 at 22:26

1 Answers1

2

Possible duplicate of this answer here, anyway for your refernce, you can use below command for scale and overlay

ffmpeg -i input.mp4 -i logo.png -filter_complex "[0:v]scale=512:-1[bg];[bg][1:v]overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" output
mdasari
  • 423
  • 4
  • 11