I am using fluent-ffmpeg for compressing the images. Using command prompt png images compression working fine.
I tried to use node script for compressing images. Compressing jpg images working fine, but it is not supporting for png images. When compressing the PNG images below code throwing error.
Is there any attributes missing?
var targetPath = image path;
ffmpeg()
.input(targetPath)
.complexFilter('scale=486:-1')
.save(targetPath);
Please help me to to resolve this issue.