1

I want to scale the watermark size based on the given video resolution. but this cmd scales the watermark without respect to the original video.

I want to scale the watermark based on the resolution of the video. if the video is in high resolution then the watermark will adjust that accordingly. visa versa in lower resolution it will scale accordingly.

please suggest me FFmpeg cmd the dynamically cmd that helps to scale the watermark based on video's resolution

val cmd = arrayOf(
            "-y",
            "-i",
            sourcePath,
            "-i",
            watermarkImagePath,
            "-filter_complex",
            "[1][0]scale2ref=w=oh*mdar:h=ih*0.06[logo][video];[video][logo]overlay=${position}",
            "-map",
            "0:a",
            "-c:v",
            "libx264",
            "-crf",
            "$bitrate",
            "-preset",
            "ultrafast",
            outputLocation.path
        )

1 Answers1

0

This works

-filter_complex [0]scale=iw:ih[video];[1][video]scale2ref=w=oh*mdar:h=ih*0.06[logo][video];[video][logo]overlay${position}[comp]" -map "[comp]"
o_ren
  • 772
  • 1
  • 7
  • 14