FFmpeg is an open-source collection of tools for processing video and audio files. It allows to convert video and audio files from one format into another, resize videos, stream audio and video, and perform various other actions with media files.
This tutorial shows how to install FFmpeg on Raspberry Pi.
Install FFmpeg
Connect to Raspberry Pi via SSH. Execute the following commands to update the package lists and install FFmpeg:
1
2
sudo apt update
sudo apt install -y ffmpeg
When installation is finished, we can check version of FFmpeg:
1
ffmpeg -version
We can also check what encoders and decoders are available:
1
2
ffmpeg -encoders
ffmpeg -decoders
Testing FFmpeg
For testing, download sample video file from the Internet:
1
wget -O test.mp4 https://raw.githubusercontent.com/mediaelement/mediaelement-files/master/big_buck_bunny.mp4
Now run the ffmpeg command to convert MP4 video file format to MKV:
1
ffmpeg -i test.mp4 out.mkv
Uninstall FFmpeg
If you wish to completely remove FFmpeg and related dependencies, execute the following command:
1
sudo apt purge --autoremove -y ffmpeg