'Convert format, discard audio, resize frames and apply watermark in ffmpeg at once

I'm trying to achieve what I asked in title, but FFMpeg produces a 0 byte size file.

Here is the code [not working]:

ffmpeg -i input.mkv -codec copy -i watermark.png -filter_complex '[0:v] scale=1920:-1,setsar=1:1; [1:v] overlay=0:0' output.mp4

if possible I want to do the whole thing in just 1 command.

Thanks



Solution 1:[1]

Try this:

ffmpeg -i input.mkv -i watermark.png \
  -filter_complex '[0:v] scale=1920:-1,setsar=1:1[v]; [v][1:v]overlay=0:0[out]' \
  -map [out] -an output.mp4
  • -codec copy - No can do if you want to apply filter
  • -an disables audio
  • Filtergraph: you were missing label [v] to connect to the chains.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kesh