Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compress Images Using FFMPEG [closed]

Tags:

ffmpeg

Kindly let me know if there is any method to compress image using FFMPEG

ffmpeg -i img.png imgOut.png

How to compress the output image or change the quality if it

like image 836
Alharith Aqra' Avatar asked Dec 11 '22 01:12

Alharith Aqra'


1 Answers

PNG

Just use the default settings. PNG is lossless so there is no way to control the quality, but you can control the compression. You can use -compression_level for PNG output if you want less compression. Range is 0-100. Default is 100 which is most compression meaning that the defaults provide the smallest output file size.

Output a series of PNG images from a video. Files will be named output_0001.png, output_0002.png, output_0003.png, etc.

ffmpeg -i input.mp4 output_%04d.png

Output a single PNG image from a video at around 00:02:00.

ffmpeg -ss 00:02:00 -i input.mp4 -frames:v 1 output.png

If you want additional processing refer to pngcrush, optipng, advpng, etc.

JPEG

For JPG output see How can I extract a good quality JPEG image with ffmpeg?

like image 123
llogan Avatar answered Dec 28 '22 10:12

llogan