This question already has an answer here:
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.
try
this tells ffmpeg to use the same quality for video encoding.
you can also add
before the output to do the same with the audio encoding.