FFmpeg的安装

一、FFmpeg的安装指令

brew install ffmpeg

执行结果:

ChenfydeMBP:~ Chenfy$ brew install ffmpeg
Warning: You are using a pre-release version of Xcode.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
==> Installing dependencies for ffmpeg: x264, lame, xvid
==> Installing ffmpeg dependency: x264
==> Downloading https://homebrew.bintray.com/bottles/x264-r2668.el_capitan.bottl
######################################################################## 100.0%
==> Pouring x264-r2668.el_capitan.bottle.tar.gz
��  /usr/local/Cellar/x264/r2668: 10 files, 3.3M
==> Installing ffmpeg dependency: lame
==> Downloading https://homebrew.bintray.com/bottles/lame-3.99.5.el_capitan.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring lame-3.99.5.el_capitan.bottle.1.tar.gz
��  /usr/local/Cellar/lame/3.99.5: 26 files, 2M
==> Installing ffmpeg dependency: xvid
==> Downloading https://homebrew.bintray.com/bottles/xvid-1.3.4.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring xvid-1.3.4.el_capitan.bottle.tar.gz
��  /usr/local/Cellar/xvid/1.3.4: 9 files, 1.3M
==> Installing ffmpeg
==> Downloading https://homebrew.bintray.com/bottles/ffmpeg-3.1.3.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring ffmpeg-3.1.3.el_capitan.bottle.tar.gz
==> Caveats
The native FFmpeg AAC encoder has been stable since FFmpeg 3.0. If you
were using libvo-aacenc or libaacplus, both of which have been dropped in
FFmpeg 3.0, please consider switching to the native encoder (-c:a aac),
fdk-aac (-c:a libfdk_aac, ffmpeg needs to be installed with the
--with-fdk-aac option), or faac (-c:a libfaac, ffmpeg needs to be
installed with the --with-faac option).

See the announcement
https://ffmpeg.org/index.html#removing_external_aac_encoders for details,
and https://trac.ffmpeg.org/wiki/Encode/AAC on best practices of encoding
AAC with FFmpeg.
==> Summary
��  /usr/local/Cellar/ffmpeg/3.1.3: 236 files, 50.1M
ChenfydeMBP:~ Chenfy$ 

二、安装是否成功的检测

找一个mp4文件,cd到该文件路径下,进行文件格式转换检测,指令如下

ffmpeg -i input.mp4 output.avi
//input :  文件原名字   output:输出文件名字

执行过程:

ChenfydeMBP:mm Chenfy$ ffmpeg -i bjca.mp4 output.avi
ffmpeg version 3.1.3 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 7.3.0 (clang-703.0.31)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.1.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libxvid --disable-lzma --enable-vda
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'bjca.mp4':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    creation_time   : 2017-02-16 03:01:11
    com.apple.quicktime.make: Apple
    com.apple.quicktime.model: MacBookPro12,1
    com.apple.quicktime.software: Mac OS X 10.11.6 (15G31)
    com.apple.quicktime.creationdate: 2017-02-16T11:00:36+0800
  Duration: 00:00:08.12, start: -0.766750, bitrate: 17455 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1080x1920, 15793 kb/s, 48.29 fps, 60 tbr, 60k tbn, 120k tbc (default)
    Metadata:
      creation_time   : 2017-02-16 03:01:11
      handler_name    : Core Media Data Handler
      encoder         : H.264
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 164 kb/s (default)
    Metadata:
      creation_time   : 2017-02-16 03:01:11
      handler_name    : Core Media Data Handler
[avi @ 0x7fd97a817e00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
Output #0, avi, to 'output.avi':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    com.apple.quicktime.creationdate: 2017-02-16T11:00:36+0800
    com.apple.quicktime.make: Apple
    com.apple.quicktime.model: MacBookPro12,1
    com.apple.quicktime.software: Mac OS X 10.11.6 (15G31)
    ISFT            : Lavf57.41.100
    Stream #0:0(und): Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1080x1920, q=2-31, 200 kb/s, 60 fps, 60 tbn, 60 tbc (default)
    Metadata:
      creation_time   : 2017-02-16 03:01:11
      handler_name    : Core Media Data Handler
      encoder         : Lavc57.48.101 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
    Stream #0:1(und): Audio: mp3 (libmp3lame) (U[0][0][0] / 0x0055), 44100 Hz, stereo, fltp (default)
    Metadata:
      creation_time   : 2017-02-16 03:01:11
      handler_name    : Core Media Data Handler
      encoder         : Lavc57.48.101 libmp3lame
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
  Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
frame=  429 fps=134 q=31.0 Lsize=    3628kB time=00:00:08.96 bitrate=3317.3kbits/s speed=2.81x    
video:3472kB audio:126kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.845662%
ChenfydeMBP:mm Chenfy$ 

如果没有异常,并且文件转换成功,该路径下多了avi文件,就表示安装成功。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值