1

i want to encode video with watermark at once. but I am confused how to unify the video command and its watermark

command encode video:

ffmpeg -i video.mp4 -tune psnr -refs 3 -c: v libx265 -preset veryslow -crf 33 -vf scale = 640x360 videoencode.mp4
pause

and this is the watermark command

ffmpeg -i videoencode.mp4 -i watermark.png -filter_complex "overlay = 10: 10" videofull.mp4

so how to unify in 1 command only? I am confused. i do not want to do 2 times encode video

4

Try applying the scaling to the input, like this:

ffmpeg -i video.mp4 -i watermark.png -filter_complex "[0:v]scale=640:360[bg];[bg][1:v]overlay=10:10" -tune psnr -refs 3 -c:v libx265 -preset veryslow -crf 33 videofull.mp4

Check videofull.mp4 details using:

ffprobe -v quiet -print_format json -show_format -show_streams videofull.mp4
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.