Tag Archives: convert

Convert stereo mp3 files in a folder to mono using ffmpeg


for f in *.mp3; do ffmpeg -i "$f" -c:a libmp3lame -q:a 2 -ac 1 mono-"$f"; done

Reducing the size of a scanned pdf using ImageMagick

Combining the brightness and contrast adjustments, quality and compression:

 convert -brightness-contrast 5x10 -set colorspace Gray -compress jpeg -quality 10 -density 150 inp.pdf out.pdf 

Creating an animated gif from images

In ffmpeg, for framerate=1:

 ffmpeg -i as%2d.jpg -pix_fmt rgb32 -r 1 out.gif 

This will reduce the 32-bit images to 24-bit ones.

Better results using ImageMagick:

convert -delay 100 -loop 0 as*.jpg out2.gif