FFmpeg is a set of free open source computer programs that provides a complete solution for recording, converting, and streaming audio and video. FFmpeg is developed under the Linux platform, but it can also be compiled and run in other operating system environments, including Windows and Mac OS X. This article describes how to install FFmpeg on CentOS 8.
1. Add RPMfusion warehouse
To install FFmpeg on CentOS 8, you need to add the RPMfusion repository:
$ sudo yum install https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm
2. Install FFmpeg
After adding the RPMfusion repository, run the following two commands to install FFmpeg:
$ sudo yum install http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm$ sudo yum install ffmpeg
If necessary, you can install the development library:
$ sudo yum -y install ffmpeg-devel
3. Check the installation of FFmpeg on CentOS8
$ rpm -qi ffmpeg$ ffmpeg -version
4. Use FFmpeg
Split video: The following command can start from time 00:00:15, and intercept 5 seconds of video.
ffmpeg -ss 00:00:15-t 00:00:05-i input.mp4 -codec copy output.mp4
Combining videos: The method of using the FFmpeg concat splitter to losslessly combine videos with the same specifications has a relatively high success rate.
First create a text file filelist.txt:
file 'input1.webm'file 'input2.webm'file 'input3.webm'
Then enter the following command to merge the video files in filelist.txt into one file in order:
ffmpeg -f concat -i filelist.txt -c copy output.webm
The above only briefly introduces the simple methods of FFmpeg cutting and merging videos. If you want to learn more about how FFmpeg processes videos, you can refer to the official document: www.ffmpeg.org/documentation.html.
Note: This article is original by Bitau and may not be reprinted on any platform without permission. If you need to reprint, contact the author~
Recommended Posts