is your logic on vacantion?
your line
ffmpeg -analyzeduration 1M -probesize 1M -i pipe:0 -bitrate 3000k -bufsize 3000k -c:v libx264 -b:v 3000k -vf "yadif=1:-1:1, scale=1280:720 input.mkv" -map 0 -map -0:a:1 -c:v copy -c:a copy "output.mkv" -profile:v baseline -preset:v faster pipe:1
need to be
ffmpeg -analyzeduration 1M -probesize 1M -i pipe:0 -bitrate 3000k -bufsize 3000k -c:v libx264 -b:v 3000k -vf "yadif=1:-1:1, scale=1280:720 input.mkv" -map 0 -map 0:a:1 -c:v copy -c:a copy "output.mkv" -profile:v baseline -preset:v faster pipe:1