0

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.

Dr.jacky
  • 3,341
  • 6
  • 53
  • 91
  • you can use it may be helpful for compress the size of image ffmpeg(imagePath).size('10%').save(compressPath) – Himanshu Goyal Apr 06 '16 at 05:02
  • Hello Hyde, I tried with above code but it is throwing below error. events.js:72 throw er; // Unhandled 'error' event ^ Error: ffmpeg exited with code 1: Error opening filters! This error is happening while uploading png images. – Prasanth Apr 19 '16 at 10:00

0 Answers0