Android – Add Watermark to the bottom right

androidffmpegquerywatermark

I want to add a watermark at the bottom right with query given below, also shown in this image:

My command is:

String[] command121 = {
"-y",
"-i",inputPath_audio.mp3,
"-loop", "1",
"-i", inputPath_image.jpg,
"-preset", "ultrafast", "-filter_complex", 
[0:a]showwaves=s=1280x175:colors=Yellow:mode=line:draw=full,
format=yuv420p[v];[1:v][v]overlay=(main_w-overlay_w):(main_h-overlay_h) 
[outv]","-map", "[outv]","-map", "0:a", "-c:v",       
"libx264", "-c:a", "aac", "-shortest", output.mp4};

And this is my command for the watermark :
"[1] scale=70:70 [tmp]; [0][tmp] overlay=main_w-overlay_w-10:main_h-overlay_h-10"

But not able to implement in the above query.

Best Answer

Use scale, showwaves, vstack, overlay, setsar, and format filters:

ffmpeg \
    -loop 1 \
    -i background.jpg \
    -i logo.png \
    -i audio.mp3 \
    -filter_complex " \
        [0]scale=1280:-1[top];
        [2]showwaves=s=1280x174:colors=Yellow:mode=line:draw=full[bottom];
        [top][bottom]vstack=inputs=2:shortest=1[bg];
        [bg][1]overlay=W-w-10:H-h-10,format=yuv420p[v]
    " \
    -map "[v]" \
    -map 2:a \
    -c:a copy \
    -preset ultrafast \
    output.mp4
Related Question