一、安装docker
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum -y install docker-ce
systemctl daemon-reload && systemctl restart docker
二、安装ffmpeg
docker pull jrottenberg/ffmpeg:4.1-alpine
三、剪切视频
docker pull jrottenberg/ffmpeg:4.1-alpine --rm -v /root:/root \
-y \
-ss 00:00:00 \
-t 60 \
-accurate_seek \
-i babyshark-custom.mp4 \
-codec copy \
-avoid_negative_ts 1 \
html5.mp4
四、转换webm
docker run --rm -v /root:/root jrottenberg/ffmpeg:4.1-alpine \
-y \
-i /root/html5.mp4 \
-c:v libvpx-vp9 \
-crf 50 -b:v 0 \
/root/html5.webm
网友评论