我想在右下角添加一个水印,并给出下面的查询,如下图所示:
我的命令是:
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};
这是我的水印命令:“[1] scale=70:70 [tmp]; [0][tmp] overlay=main_w-overlay_w-10:main_h-overlay_h-10”
但无法在上面的查询中实现。
答案1
使用 scale、showwaves、vstack、overlay、setsar 和 format 过滤器:
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