FFMPEG - Watermark video with same quality and fil

2019-02-20 03:03发布

问题:

This question already has an answer here:

  • ffmpeg - how to apply filters without losing quality 1 answer

I have some videos, and I'd like to watermark them with a transparent PNG. Here's what I've tried:

ffmpeg -i 9.flv -vf "movie=logo.png [watermark];[in][watermark] overlay=10:10 [out]" 9_w.flv

However, bitrate or quality is not preserved. Preferably I'd like ffmpeg to re-encode the file with exactly the same settings as the original file (same codecs, bitrate). If thats not easily possible, I'd like to encode with a specific codec, but preserving 'quality', however that is measured.

回答1:

try

ffmpeg -i 9.flv -vf "movie=logo.png [watermark];[in][watermark] overlay=10:10 [out]" -vcodec flv -sameq 9_w.flv

this tells ffmpeg to use the same quality for video encoding.

you can also add

-acodec libmp3lame copy

before the output to do the same with the audio encoding.



标签: video ffmpeg