[FFmpeg] Convert SVG to PNG

Created on November 30, 2026

Use -i to specify the input SVG and give the output a .png extension.

ffmpeg -i input.svg output.png

Resize during conversion

Use -vf scale=width:height to set the output dimensions. Set one dimension to -1 to calculate it from the original aspect ratio.

# Set the width to 800 px and preserve the aspect ratio
ffmpeg -i input.svg -vf scale=800:-1 output.png

# Set both the width and the height
ffmpeg -i input.svg -vf scale=800:600 output.png

Overwrite an existing output file

Use -y to overwrite the output without a prompt.

ffmpeg -y -i input.svg output.png

Install FFmpeg

On macOS with Homebrew, use this command.

brew install ffmpeg

On Ubuntu or Debian, use APT.

sudo apt install ffmpeg

SVG input requires a build of FFmpeg with an SVG decoder, such as librsvg.

Shell command