FFmpeg视频翻转及双水印添加脚本失效问题求助
Hey there, let's troubleshoot why your watermarks aren't showing up in the output! The core issue with your current command is that the hflip filter isn't integrated into the rest of your filter chain properly—right now, you're flipping the video but not passing that flipped version into the overlay steps, so the watermark logic is effectively being ignored.
Here's the corrected command that will both flip your video and apply both watermarks:
ffmpeg -i input.mp4 -i watermark.png -i watermark2.png -filter_complex "[0:v]hflip[flipped];[1:v]scale=iw*0.5:-1[top];[2:v]scale=iw*0.1:-1[top2];[flipped][top]overlay=x=(W-w)/40:y=(H-h)/40[tmp];[tmp][top2]overlay=5:H-h-5" -preset superfast output.mp4
Let me walk through what changed:
- We first label the flipped input video as
[flipped]with[0:v]hflip[flipped]. This creates a reference to the horizontally flipped version of your original video, which we can then use as the base for adding watermarks. - Instead of using the original
[0:v]for the first overlay, we now use[flipped]. This ensures the watermarks are applied directly to the flipped video, rather than the original (which was being discarded before since we never used it after the flip). - All your scaling and overlay position logic remains intact—we just fixed the connection between the flip and watermark steps.
A quick tip: If you want to verify the output looks right without waiting for superfast encoding, you can temporarily remove -preset superfast for a test run, then add it back once you're satisfied with the watermark placement and flip effect.
备注:内容来源于stack exchange,提问作者DIABOLI FERRE

