FFmpeg
FFmpeg is a free and open source tool set for processing multimedia files. It contains a set of shared audio and video libraries, such as libavcodec, libavformat, and libavutil. Using FFmpeg, you can convert between various video and audio formats, set sample rate, capture streaming audio/video, and adjust video size
Install FFmpeg on CentOS 7
1. Install epel-release
$ sudo yum install epel-release
2. Use RPM Fusion
source
$ yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm
3. Install FFmpeg
$ yum install ffmpeg ffmpeg-devel
4. Check if the installation is successful
$ ffmpeg -version
FFmpeg usage example
Basic conversion
- Convert video files from mp4 to webm
$ ffmpeg -i input.mp4 output.webm
- Convert audio files from mp3 to ogg
$ ffmpeg -i input.mp3 output.ogg
Specify codec
You can specify the codec to be used with the -c option. The codec can be the name of any supported decoder/encoder, or copy can simply copy the special value of the input stream
- Use
libvpx
video codec andlibvorbis
audio codec to convert video files from mp4 to webm$ ffmpeg -i input.mp4 -c:v libvpx -c:a libvorbis output.webm
- Convert audio files from mp3 to ogg encoded with the
libopus
codec$ ffmpeg -i input.mp3 -c:a libopus output.ogg
More actions
You can refer to the official FFmpeg document
Post comment 取消回复