FFmpeg介绍

FFmpeg是一套可以用来记录、转换数字音频、视频,并能将其转化为流的开源计算机程序。

采用LGPL或GPL许可证。它提供了录制、转换以及流化音视频的完整解决方案。

它包含了非常先进的音频/视频编解码库libavcodec,为了保证高可移植性和编解码质量,libavcodec里很多code都是从头开发的。

测试环境说明:

[root@localhost ~]# cat /etc/redhat-release
CentOS release 6.9 (Final)
[root@localhost ~]# uname -a
Linux localhost.localdomain -.el6.x86_64 # SMP Tue May  :: UTC  x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# hostname -I
192.168.1.111
[root@localhost ~]# hostname
localhost.localdomain

1.升级系统

[root@localhost ~]# yum install epel-release -y
[root@localhost ~]# yum update -y

2.安装Nux Dextop Yum 源

由于CentOS没有官方FFmpeg rpm软件包。但是,我们可以使用第三方YUM源(Nux Dextop)完成此工作。

a) CentOS 7

[root@localhost ~]# rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro 
[root@localhost ~]# rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

b) CentOS 6

[root@localhost ~]# rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro 
[root@localhost ~]# rpm -Uvh http://li.nux.ro/download/nux/dextop/el6/x86_64/nux-dextop-release-0-2.el6.nux.noarch.rpm

3.安装FFmpeg 和 FFmpeg开发包

[root@localhost ~]# yum install ffmpeg ffmpeg-devel -y

4.测试是否安装成功

[root@localhost ~]# ffmpeg
ffmpeg version  Copyright (c) - the FFmpeg developers
  built with  (GCC)  (Red Hat -)
  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 --param=ssp-buffer-size=4 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libdc1394 --enable-libfaac --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      . . 20.100
  libavcodec     . . 26.100
  libavformat    . . 25.101
  libavdevice    .  .  4.100
  libavfilter     . . 11.102
  libavresample   .  .   /  .  .
  libswscale      .  .  1.101
  libswresample   .  .  1.100
  libpostproc    .  .  3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

5.如果你想了解更多关于FFmpeg使用方面的资料,可以输入:

[root@localhost ~]# ffmpeg -h
ffmpeg version  Copyright (c) - the FFmpeg developers
  built with  (GCC)  (Red Hat -)
  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 --param=ssp-buffer-size=4 -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libdc1394 --enable-libfaac --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      . . 20.100
  libavcodec     . . 26.100
  libavformat    . . 25.101
  libavdevice    .  .  4.100
  libavfilter     . . 11.102
  libavresample   .  .   /  .  .
  libswscale      .  .  1.101
  libswresample   .  .  1.100
  libpostproc    .  .  3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Getting help:
    -h      -- print basic options
    -h long -- print more options
    -h full -- print all options (including all format and codec specific options, very long)
    See man ffmpeg for detailed description of the options.

Print help / information / capabilities:
-L                  show license
-h topic            show help
-? topic            show help
-help topic         show help
--help topic        show help
-version            show version
-buildconf          show build configuration
-formats            show available formats
-devices            show available devices
-codecs             show available codecs
-decoders           show available decoders
-encoders           show available encoders
-bsfs               show available bit stream filters
-protocols          show available protocols
-filters            show available filters
-pix_fmts           show available pixel formats
-layouts            show standard channel layouts
-sample_fmts        show available audio sample formats
-colors             show available color names
-sources device     list sources of the input device
-sinks device       list sinks of the output device

Global options (affect whole program instead of just one file:
-loglevel loglevel  set logging level
-v loglevel         set logging level
-report             generate a report
-max_alloc bytes    set maximum size of a single allocated block
-y                  overwrite output files
-n                  never overwrite output files
-stats              print progress report during encoding
-max_error_rate ratio of errors (% error  maximum error rate
-bits_per_raw_sample number  set the number of bits per raw sample
-vol volume         change audio volume (=normal)

Per-file main options:
-f fmt              force format
-c codec            codec name
-codec codec        codec name
-pre preset         preset name
-map_metadata outfile[,metadata]:infile[,metadata]  set metadata information of outfile from infile
-t duration         record or transcode "duration" seconds of audio/video
-to time_stop       record or transcode stop time
-fs limit_size      set the limit file size in bytes
-ss time_off        set the start time offset
-timestamp time     set the recording timestamp ('now' to set the current time)
-metadata string=string  add metadata
-target type        specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd", ...)
-apad               audio pad
-frames number      set the number of frames to output
-filter filter_graph  set stream filtergraph
-filter_script filename  read stream filtergraph description from a file
-reinit_filter      reinit filtergraph on input parameter changes
-discard            discard
-disposition        disposition

Video options:
-vframes number     set the number of video frames to output
-r rate             set frame rate (Hz value, fraction or abbreviation)
-s size             set frame size (WxH or abbreviation)
-aspect aspect      set aspect ratio (:, : or 1.3333, 1.7777)
-bits_per_raw_sample number  set the number of bits per raw sample
-vn                 disable video
-vcodec codec       force video codec ('copy' to copy stream)
-timecode hh:mm:ss[:;.]ff  set initial TimeCode value.
-pass n              to )
-vf filter_graph    set video filters
-ab bitrate         audio bitrate (please use -b:a)
-b bitrate          video bitrate (please use -b:v)
-dn                 disable data

Audio options:
-aframes number     set the number of audio frames to output
-aq quality         set audio quality (codec-specific)
-ar rate            set audio sampling rate (in Hz)
-ac channels        set number of audio channels
-an                 disable audio
-acodec codec       force audio codec ('copy' to copy stream)
-vol volume         change audio volume (=normal)
-af filter_graph    set audio filters

Subtitle options:
-s size             set frame size (WxH or abbreviation)
-sn                 disable subtitle
-scodec codec       force subtitle codec ('copy' to copy stream)
-stag fourcc/tag    force subtitle tag/fourcc
-fix_sub_duration   fix subtitles duration
-canvas_size size   set canvas size (WxH or abbreviation)
-spre preset        set the subtitle options to the indicated preset

视频服务之ffmpeg部署的更多相关文章

  1. iNeuOS工业互联平台,.NETCore开发的视频服务组件iNeuVideo,RTSP转WebSocket

    目       录 1.      概述... 2 2.      将来集成到iNeuOS平台演示... 3 3.      iNeuVideo结构... 3 4.      iNeuVideo部署及 ...

  2. ZEGO音视频服务的高可用架构设计与运营

    前言: ZEGO 即构科技作为一家实时音视频的提供商,系统稳定性直接影响用户的主观体验,如何保障服务高可用且用户体验最优是行业面临的挑战,本文结合实际业务场景进行思考,介绍 ZEGO 即构在高可用架构 ...

  3. Node服务一键离线部署

    背景说明 项目测试通过,到了上线部署阶段.部署的机器安全限制比较严格,不允许访问外网.此外,没有对外网开放ssh服务,无法通过ssh远程操作. 针对上面提到的两条限制条件,通过下面方式解决: 无法访问 ...

  4. 短视频服务大PK,阿里云、腾讯云、又拍云、七牛云、金山云5强横向对比

    继直播后,短视频又再次爆发,在这个风口,国内的各大云厂商也都相继推出了自己的一站式短视频解决方案.上周由于公司短视频功能开发的需要,对比了阿里云.腾讯云.又拍云.七牛云.金山云5家的短视频服务. 先介 ...

  5. Burrow 服务的安装部署

    Burrow 服务的安装部署 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 最近协助开发的同时帮忙把10个topic的数据使用5个topic的来工作.结果发现数据flume在手机数 ...

  6. .NET Core 微服务架构-Docker部署

    本文主要介绍通过Docker来部署通过.NET Core开发的微服务架构,部署的微服务主要包括统一网关(使用Ocelot开发).统一认证(IdentityServer4).应用服务(ASP.NET C ...

  7. 开发的服务集群部署方案,以etcd为基础(java)

    当前有很多服务集群部署,但是对于我们自己开发的服务系统怎么样能够解决部署问题,对大家很麻烦和笨重. 首先,我想说对于我们国内,小公司小系统比较多.大型系统毕竟少数,向阿里云看齐的不多.其实所谓的需要集 ...

  8. 音视频】5.ffmpeg命令分类与使用

    GT其实平时也有一些处理音视频的个人或者亲人需求,熟练使用ffmpeg之后也不要借助图示化软件,一个命令基本可以搞定 G: 熟练使用ffmpeg命令!T :不要死记硬背,看一遍,自己找下规律,敲一遍, ...

  9. EasySwoole+ElasticSearch打造 高性能 小视频服务系统

    EasySwoole+ElasticSearch打造高性能小视频服务 第1章 课程概述 第2章 EasySwoole框架快速上手 第3章 性能测试 第4章 玩转高性能消息队列服务 第5章 小视频服务平 ...

随机推荐

  1. LeetCode OJ-- Combination Sum II **

    https://oj.leetcode.com/problems/combination-sum-ii/ 一列数,每个数只能用一次或者不用,给出和为target的组合. 递归写的深搜,使用了编程技巧, ...

  2. 洛谷 P1579 哥德巴赫猜想(升级版)【筛素数/技巧性枚举/易错】

    [链接]:https://www.luogu.org/problemnew/show/P1579 题目背景 1742年6月7日哥德巴赫写信给当时的大数学家欧拉,正式提出了以下的猜想:任何一个大于9的奇 ...

  3. HDFS写文件过程分析

    转自http://shiyanjun.cn/archives/942.html HDFS是一个分布式文件系统,在HDFS上写文件的过程与我们平时使用的单机文件系统非常不同,从宏观上来看,在HDFS文件 ...

  4. 洛谷——P1186 玛丽卡

    P1186 玛丽卡 题目描述 麦克找了个新女朋友,玛丽卡对他非常恼火并伺机报复. 因为她和他们不住在同一个城市,因此她开始准备她的长途旅行. 在这个国家中每两个城市之间最多只有一条路相通,并且我们知道 ...

  5. Ansible进阶之企业级应用

    1.环境 cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 ...

  6. 转:浅析Collections.sort

    浅析Collections.sort 问题引入   在之前的一次Java上机实习中,老师布置了一道很简单的题: 从控制台输入10个整数,对它们进行升序排序并输出.   考虑到只有10个数,需要比较的次 ...

  7. centos7.3 开放端口 防火墙端口

    1. 查看已打开的端口 # netstat -anp 2. 查看想开的端口是否已开 # firewall-cmd --query-port=666/tcp 若此提示 FirewallD is not ...

  8. unsupported Scan, storing driver.Value type []uint8 into type *time.Time 解决方案

    数据库取数据的字段为created_at,数据库中类型是TIMESTAMP,允许NULL,此时在取数据的时候就会出现这种报错. 解决方案:在数据库连接的字符串中添加:&parseTime=Tr ...

  9. oracle小知识点16-诊断事件diagnostic events

    http://blog.itpub.net/28539951/viewspace-1983919/

  10. BUG_ON&&WARN_ON&BUILD_BUG_ON

    转载:http://wenx05124561.blog.163.com/blog/static/124000805201223112811490/ 一.BUG_ON Linux中BUG_ON,WARN ...