ffmpeg功能强大,可以通过命令行来对音视频进行处理。为了使用其功能,我在Mac上对其进行了安装。
我的Mac OS X 系统版本:OS X Yosemite, 10.10.14
关于ffmpeg在Mac OS X上的编译,FFmpeg上有官方文档说明:https://trac.ffmpeg.org/wiki/CompilationGuide/MacOSX。该文档给出了3种方法:
- ffmpeg through Homebrew
- Compiling FFmpeg yourself
- Manual install of the dependencies without Homebrew
看了这三种方法的官方说明后,我选择了第一种,因为最简单。
首先,Mac上要安装Homebrew
在终端执行命令,ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
devtemobideMac-mini:~ sunminmin$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
Password:
==> Downloading and installing Homebrew...
remote: Counting objects: 225571, done.
remote: Compressing objects: 100% (59354/59354), done.
remote: Total 225571 (delta 165037), reused 225482 (delta 164969)
Receiving objects: 100% (225571/225571), 51.57 MiB | 1.19 MiB/s, done.
Resolving deltas: 100% (165037/165037), done.
From https://github.com/Homebrew/homebrew
* [new branch] master -> origin/master
HEAD is now at 82d7dc4 tomcat: update 8.0.17 bottle.
==> Installation successful!
==> Next steps
Run `brew doctor` before you install anything
Run `brew help` to get started
|
其次,安装ffmpeg
在终端执行命令,brew install ffmpeg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
devtemobideMac-mini:~ sunminmin$ brew install ffmpeg
==> Installing dependencies for ffmpeg: x264, lame, libvo-aacenc, xvid
==> Installing ffmpeg dependency: x264
==> Downloading https://homebrew.bintray.com/bottles/x264-r2533.yosemite.bottle.
######################################################################## 100.0%
==> Pouring x264-r2533.yosemite.bottle.tar.gz
以上是关于在Mac OSX上安装ffmpeg && ffmpeg命令行将h264封装为mp4的主要内容,如果未能解决你的问题,请参考以下文章 无法在 Mac OsX 上编辑 bash_profile [关闭] |