Linux Command Line Image Manipulation

Resize JPG Images

Describe the characteristics of image files (like resolution) with identify command that is part of ImageMagick suite of tools.

# width = 600, height calculate to retain aspect ratio
ffmpeg -i <INPUT> -vf scale=600:-1 <OUTPUT>
for file in *.jpg; do ffmpeg -i ${file} -vf scale=600:-1 small-${file}; done

Convert Video Formats

# from flv to mp4
for file in *.flv; do ffmpeg -nostdin -hide_banner -loglevel error -i ${file} -vcodec libx265 -acodec copy ${file%.flv}.mp4; done

# from avi to mp4
for file in *.avi; do ffmpeg -nostdin -hide_banner -loglevel error -i ${file} -vcodec libx265 -acodec aac ${file%.avi}.mp4; done

# from mov to mp4
for file in *.mov; do ffmpeg -nostdin -hide_banner -loglevel error -i ${file} -vcodec copy -acodec copy ${file%.mov}.mp4; done

Page Metadata

Source: imaging.md Created: 2025-01-05T20:28:33+02:00 Changed: 2025-04-28T10:32:54+03:00