2

How to integrate these two commands so I only need to run one?

I want to add watermark, encode the quality and add a subtitle all with one command.

Encode and watermark:

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

Add subtitle:

ffmpeg -i video.mp4 -filter:v subtitles=text.srt videosub.mp4

How can I combine the two?

2
ffmpeg -i video.mp4 -i watermark.png -filter_complex "[0:v]scale=640:360[bg];[bg][1:v]overlay=10:10,subtitles=text.srt" -c:v libx265 -preset veryslow -crf 33 videofull.mp4

Filters in the same linear chain are separated by commas, and distinct linear chains of filters are separated by semicolons. See FFmpeg Filtering Introduction for more info.

I removed -tune psnr -refs 3 because psnr is detrimental for general encoding and refs should be covered by the preset.

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.