The code below adds the watermark but ignores the scaling. How do you include multiple video filters in fluent-ffmpeg?
ffmpeg(inputFileName)
.inputOptions(['-safe 0', '-f concat'])
.outputOptions([
'-filter:v scale=w=1280:h=720',
"-filter:v drawtext=text='watermarkText':x=W-150:y=H-th-10:fontsize=32:fontcolor=white",
'-crf 10'
])
.save('output.mp4');
I tried these formats as well inside .outputOptions([])
to no avail:
'-filter:v <param1>, <param2>'
'-filter:v <param1>; <param2>'
'-filter:v', '<param1>', '<param2>'
I suppose you can just separate the two filters using a comma:
ffmpeg(inputFileName)
.inputOptions(['-safe 0', '-f concat'])
.outputOptions(["-filter:v scale=w=1280:h=720,drawtext=text='watermarkText':x=W-150:y=H-th-10:fontsize=32:fontcolor=white",
'-crf 10'
])
.save('output.mp4');
I can't test it with fluent-ffmpeg
, but this is the ffmpeg
command line syntax.
Testing using command line:
Generate synthetic input video file:
ffmpeg -y -f lavfi -i testsrc=duration=10:size=192x108:rate=1 -c:v rawvideo -pix_fmt bgr24 input.avi
Scale to 1280x720 and draw text (using large green text):
ffmpeg -y -i input.avi -filter:v scale=w=1280:h=720,drawtext=text='watermarkText':x=W/2:y=H-th-10:fontsize=72:fontcolor=green -vcodec libx264 -crf 10 output.mp4
I am not sure about the correctness of '-f concat'
argument, and you also missed the video codec specification.