Media

Media

Commands for converting, processing, optimising and managing media files

Information

Show basic information about media file

file <media-file>

Show detailed information about image files (macOS only)

sips -g all <image-file>

Show detailed information about audio files (macOS only)

afinfo <audio-file>

Show information from multimedia streams and files (requires ffmpeg)

ffprobe <audio-file>

Images

Sips

Sips - Scriptable image processing system (macOS only)

  • Formats: jpeg, tiff, png, gif, jp2, pict, bmp, qtif, psd, sgi, tga

Convert image between file formats (Quality: 0 - 100 or low, normal, high, best)

Example converting PNG to JPG using high quality compression

Examples batch processing all JPG files

Scale width or height of image in pixels maintaining aspect ratio

Scale both width and height until either reach the max dimension (-Z flag)

Resize image to exact height and width regardless of aspect ratio

Rotate image by specified degrees clockwise

Flip image in specified direction (horizontal, vertical)

Crop image to specified height and width

Pad image by expanding size (with optional fill colour for added region)

WebP

Install Google WebP image processor

Decompress WebP image to PNG

Decompress all WebP images in current directory to PNG images (processing 8 in parallel)

Compress image to WebP format using specified quality from 0 to 100

Audio / Video

Audio File Utilities

Play audio file (macOS only)

Play audio file with volume (-v), playback rate (-r) and duration in seconds (-t)

Convert audio file format

Example converting audio file from wav to mp3 at 128kbps

FFmpeg

Install FFmpeg audio / video processor

Play audio file (-nodisp for direct CLI playback without GUI)

VLC

Open network stream

Demuxing raw PCM audio for playback

Example 2 channel PCM audio at 8kHz

youtube-dl

Install youtube-dl

List media format and quality options available

Download mp4 video file

Download mp3 audio file

Pipe output directly to VLC

Pipe output directly to Chromecast via VLC

Last updated