What is FFmpeg?
FFmpeg is a free tool that works with video and sound files. It can change a video from one format to another. It can also cut clips, shrink files and grab pictures from a video. Many video websites use it behind the scenes.
You need root access for this guide. Root is the main administrator login of the server. It works on VPS and dedicated servers.
Steps
- Connect to your server with SSH. SSH is a safe way to type commands on a remote server.
- Check if FFmpeg is already there.
This prints the version. If you see "command not found", go on.ffmpeg -version - On AlmaLinux, Rocky Linux or CentOS, FFmpeg is not in the main package list. First add the extra repository called EPEL, and the RPM Fusion repository. A repository is an online store of software your server can download from. The exact steps depend on your system version, so check the instructions for your version.
This adds the EPEL store.dnf install epel-release - Install FFmpeg.
This downloads and installs FFmpeg. On older systems, usednf install ffmpeg ffmpeg-develyuminstead ofdnf. - On Ubuntu or Debian, use this instead.
The first line refreshes the package list. The second installs FFmpeg.apt update apt install ffmpeg - Check the install again.
You should now see a version number.ffmpeg -version
Test it
Try to convert a small file. Replace the names with your own.
ffmpeg -i input.avi output.mp4
This reads input.avi and writes a new file called output.mp4.
If PHP needs it
Many PHP scripts just run the ffmpeg command. They need the path. Find it with:
which ffmpeg
This usually prints /usr/bin/ffmpeg.
Tip: Package names can change between system versions. If a command fails, read the message. It often names the missing piece. Ask Hostvento support if you are stuck.
Quick recap
- FFmpeg works with video and audio files.
- You need root access and SSH.
- Use
dnforyumwith extra repositories on Red Hat style systems, orapton Ubuntu and Debian. - Check with
ffmpeg -version.