...

How to Convert Media Files with FFmpeg

gorilla-chimp

In this article:

  • Supported File Types
  • Convert Audio Files
  • Convert Video Files
  • Extract Audio from Videos

There are many free audio editors and video editors that can convert between multiple formats, add metadata, and add effects to improve sound quality – e.g. Audacity noise cancellation. But sometimes all you need is a different file format. Many audiophiles prefer Free Lossless Audio Codec (FLAC) and Ogg Vorbis (OGG), but many music platforms prefer an uncompressed 16-32 bit Windows audio (Wav) file or different levels of compressed MP3. This is can be quickly achieved in a terminal with FFmpeg.

VPS / Dedicated server administrators, and Linux desktop users can install FFmpeg for in-depth recording, streaming, and conversion functions for Flac, Mp3, Ogg, Raw, Wav, Mkv, Mov, Mp4, Webm, and more.

If you don’t have FFmpeg installed on your VPS or Dedicated server, email our 24/7 Live Support to request a free installation.

Below we’ll cover supported file types and converting a file in FFmpeg.

Supported File Types

Before getting started, you should know how to check for file types and codecs you may need to convert.

  1. Log in to SSH or cPanel Terminal
  2. List FFmpeg-supported file types with the command ffmpeg -formats
  3. (Optional) Filter the results for a specific format for faster results: ffmpeg -formats | grep mp3
  4. List supported codecs with the command ffmpeg -codecs
  5. Navigate to your media files directory with cd command

Audio Files

Convert audio files with the command ffmpeg -i input.ogg output.mp3

Video Files

Convert video files with the command ffmpeg -i input.mp4 output.webm

Convert Multiple Files

Convert a file to multiple files by adding more filenames with a different extension to the end of the command:
ffmpeg -i input.mp3 output.wav output.ogg output.mp4

Extract Audio from Video

Extract the audio from a recorded video with the command ffmpeg -i input.mp4 -vn audio-only.ogg

This is helpful for sharing broadcasts live streams and screencasts on podcast platforms.

Want to self-host your podcasts? Check out the PowerPress Podcasting plugin with our NGINX-powered WordPress Hosting.

You can use the ffmpeg -version and ffmpeg -help commands for troubleshooting information. Learn more from our Live Broadcasting channel and FFmpeg.org.

Discover more from WIREDGORILLA

Subscribe now to keep reading and get access to the full archive.

Continue reading