【FFMPEG】ffmpeg安装、简单使用汇总

2018-04-15  本文已影响403人  下里巴人也

1. 系统

2. 安装

[root@localhost root]# yum install -y epel-release rpm 
[root@localhost root]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7          //如果出现缺少Code提示,就执行此条命令
[root@localhost root]# yum repolist            //安装完成之后,可以查看是否安装成功
[root@localhost root]# rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro         //导入一个Code
[root@localhost root]# rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm         //安装nux-dextop 源
[root@localhost root]# yum repolist      #查看repo源是否安装成功
[root@localhost root]# yum install -y ffmpeg
[root@localhost root]# ffmpeg -version
ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfaac --enable-nonfree --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil      54. 20.100 / 54. 20.100
libavcodec     56. 26.100 / 56. 26.100
libavformat    56. 25.101 / 56. 25.101
libavdevice    56.  4.100 / 56.  4.100
libavfilter     5. 11.102 /  5. 11.102
libavresample   2.  1.  0 /  2.  1.  0
libswscale      3.  1.101 /  3.  1.101
libswresample   1.  1.100 /  1.  1.100
libpostproc    53.  3.100 / 53.  3.100

3. 应用

3.1 格式转换

[root@localhost root]# ffmpeg -i video0.avi video0.mp4

结果看到视频大小小了很多:


转换结果
ffmpeg -r 25 -loop 1 -i 1010.jpg -pix_fmt yuv420p -vcodec libx264 -b:v 600k -r:v 25 -preset medium -crf 30 -s 1080x1920 -vframes 250 -r 25 -t 10 ~/a.mp4
上一篇下一篇

猜你喜欢

热点阅读