FFMPEG Mac版本编译
Mac下FFMPEG使用
There are a few ways to get FFmpeg on OS X.
- One is to build it yourself. Compiling on Mac OS X is as easy as any other
*
nix machine, there are just a few caveats(警告). The general procedure is get the source, then./configure <flags>; make && sudo make install
, though specific configure flags are possible. - Another is to use some “build helper” tool, to install it for you. For example, homebrew or macports, see the homebrew section in this document.
- Alternatively, if you are unable to compile, or do not want to install homebrew, you can simply download a static build for OS X, but it may not contain the features you want. Typically this involves unzipping an FFmpeg distribution file
[like .zip file]
, then running it from within the newly extracted files/directories.
手动编译FFMPEG
1.下载FFMPEG源码
使用git clone https://github.com/FFmpeg/FFmpeg
从github下载ffmpeg源码,切换到要使用的目标分支(这里使用release/3.3):git checkout -b r3.3 origin/release/3.3
,或者直接从github下载分支release/3.3
的压缩包,解压.
2.准备Xcode
Starting with Lion 10.7, Xcode is available for free from the Mac App Store and is required to compile anything on your Mac. Make sure you install the Command Line Tools from Preferences > Downloads > Components. Older versions are still available with an AppleID and free Developer account at developer.apple.com.
3.准备HomeBrew工具
To get ffmpeg for OS X, you first have to install Homebrew. If you don’t want to use Homebrew, see the section below.
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then:
brew install automake fdk-aac git lame libass libtool libvorbis libvpx \
opus sdl shtool texi2html theora wget x264 x265 xvid yasm
Mac OS X Lion comes with Freetype already installed (older versions may need ‘X11’ selected during installation), but in an atypical location: /usr/X11. Running freetype-config in Terminal can give the locations of the individual folders, like headers, and libraries, so be prepared to add lines like CFLAGS=freetype-config --cflags
LDFLAGS=freetype-config --libs
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/X11/lib/pkgconfig before ./configure or add them to your $HOME/.profile file.
4.编译
Once you have compiled all of the codecs/libraries you want, you can now download the FFmpeg source either with Git or the from release tarball links on the website. Study the output of ./configure --help and make sure you’ve enabled all the features you want, remembering that --enable-nonfree and --enable-gpl will be necessary for some of the dependencies above. A sample command is:
git clone http://source.ffmpeg.org/git/ffmpeg.git ffmpeg
cd ffmpeg
./configure --prefix=/usr/local/ffmpeg --enable-gpl --enable-nonfree --enable-libass \
--enable-libfdk-aac --enable-libfreetype --enable-libmp3lame \
--enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libopus --enable-libxvid
make && sudo make install
--prefix
指定编译完成后安装路径,这里指定到/usr/local/ffmpeg
,安装完成会在/usr/local/ffmpeg
下生成:bin,include,lib,share四个目录
安装环境介绍
A package consists of several related files which are installed in several directories. The configure step usually allows the user to specify the so-called install prefix, and is usually specified through the configure option configure --prefix=PREFIX, where PREFIX usually is by default /usr/local. The prefix specifies the common directory where all the components are installed.
The following directories are usually involved in the installation:
PREFIX/bin
: contains the generated binaries (e.g. ffmpeg, ffplay, ffprobe etc. in the case of FFmpeg)PREFIX/include
: contains the library headers (e.g. libavutil/avstring.h, libavcodec/avcodec.h, libavformat/avformat.h etc. in case of FFmpeg) required to compile applications linked against the package librariesPREFIX/lib
: contains the generated libraries (e.g. libavutil, libavcodec, libavformat etc. in the case of FFmpeg)PREFIX/share
: contains various system-independent components; especially documentation files and examples
By specifying the prefix it is possible to define the installation layout.
By using a shared prefix like /usr/local/, different packages will be installed in the same directory, so in general it will be more difficult to revert the installation.
Using a prefix like /opt/PROJECT/, the project will be installed in a dedicated directory, and to remove from the system you can simply remove the /opt/PREFIX path. On the other hand, such installation will require to edit all the environment variables to point to the custom path.
Environment variables
Several variables defined in the environment affect your package install. In particular, depending on your installation prefix, you may need to update some of these variables in order to make sure that the installed components can be found by the system tools.
The list of environment variables can be shown through the command env.
A list of the affected variables follows:
- PATH: defines the list of :-separated paths where the system looks for binaries. For example if you install your package in /usr/local/, you should update the PATH so that it will contain /usr/local/bin. This can be done for example through the command export PATH=/usr/local/bin:$PATH.
- LD_LIBRARY_PATH: contains the :-separated paths where the system looks for libraries. For example if you install your package in /usr/local/, you should update the LD_LIBRARY_PATH so that it will contain /usr/local/lib. This can be done for example through the command export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH. This variable is sometimes deprecated in favor of the use of ldconfig.
- CFLAGS: contains flags used by the C compiler, and usually includes preprocessing directives like -IPREFIX/include or compilation flags. Custom CFLAGS are usually prefixed to the source package compiler flags by the source package build system. Alternatively many build systems allow to specify the configure option -extra-cflags.
- LDFLAGS: these are directives used by the linker, and usually include linking directives like -LPREFIX/lib needed to find libraries installed in custom paths. Custom LDFLAGS are usually prefixed to the source package linker flags by the source package build system. Alternatively, many build systems allow to specify the configure option -extra-ldflags.
- PKG_CONFIG_PATH: contains the :-separated paths used by pkg-config to detect the pkg-config files used by many build systems to detect the custom CFLAGS/LDFLAGS used by a specific library.
In case you installed a package in a non standard path, you need to update these environment libraries so that system tools will be able to detect the package components. This is especially required when running a configure script for a package relying on other installed libraries/headers/tools.
Environment variables are usually defined in the profile file, for example .profile defined in the user directory for sh/bash users, and in /etc/profile. This file can be edited to permanently set the custom environment. Alternatively, the variables can be set in a script or in a particular shell session.
Remember to export the variables to the child process, e.g. using the export command. Read the fine documentation of your shell for more detailed information.
MAC下的动态链接库
扩展名
Windows下.DLL,Linux下.so,Mac OS X下的扩展名是.dylib。
.dylib是Mach-O格式,也就是Mac OS X下的二进制文件格式。Mac OS X提供了一系列
工具,用于创建和访问动态链接库。
- 编译器/usr/bin/cc,也就是gcc了,Apple改过的。这个主要还是一个壳,去调用其他
的一些部件。当然同时还有/usr/bin/c++,等等。 - 汇编器/usr/bin/as
- 链接器/usr/bin/ld
MAC下创建动态链接库步骤:
- 首先是生成module文件,也就是.o文件。这跟一般的unix没什么区别。例如
cc -c a.c b.c
,就得到a.o和b.o - 可以用ld来合并.o文件,比如
ld -r -o c.o a.o b.o
- 然后可以用libtool来创建动态链接库:
libtool -dynamic -o c.dylib a.o b.o
.( 这里也可以用libtool -static -o c.a a.o b.o
就创建静态库)
如果用gcc直接编译,我记得linux下一般是可以:
gcc -shared -o c.so a.c b.c
而在Mac OS X下需要:
gcc -dynamiclib -o c.dylib a.c b.c
动态链接库的工具
nm是最常用的,这个用法跟linux下差不多:nm c.dylib
,可以看到导出符号表,等等。
另一个常用的工具是otool,这个是Mac OS X独有的。比如想看看c.dylib的依赖关系otool -L c.dylib
官网方法
- CompilationGuide-Generic
- CompilationGuide-MacOSX
编译ffmpeg3.3结果没有ffplay
因为系统没有sdl环境或sdl版本不匹配,ffmpeg3.3需要sdl2
http://www.libsdl.org/download-2.0.php 下载Source Code SDL2-2.0.5.zip - GPG signed,解压缩,执行命令:
./configure
make
sudo make install
进行编译
相关文章:

FFMPEG Mac版本编译
Mac下FFMPEG使用 There are a few ways to get FFmpeg on OS X. One is to build it yourself. Compiling on Mac OS X is as easy as any other *nix machine, there are just a few caveats(警告). The general procedure is get the source, then ./configure <flags&g…...

Reactive Programing与“响应式”
将Reactive Programing翻译为“响应式编程”,的确不好理解。什么是Reactive?Reactive被翻译为“反应”,其英文原意是“事物对变化信号的回应、反应”。我热了,空调自动开,这就是空调对我的Reaction,我和空调…...

Pinterest:从 Druid 到 StarRocks,实现 6 倍成本效益比提升
导读: 开源无国界,StarRocks 自开源以来,近3年的时间里已在全球数据技术领域崭露头角。我们欣喜地发现,越来越多的海外用户正在使用并积极推广着 StarRocks。为了促进知识共享,StarRocks中文社区将精选优秀文章与大家共…...

代码+视频,R语言VRPM绘制多种模型的彩色列线图
列线图,又称诺莫图(Nomogram),它是建立在回归分析的基础上,使用多个临床指标或者生物属性,然后采用带有分数高低的线段,从而达到设置的目的:基于多个变量的值预测一定的临床结局或者…...

Python 设计模式之工厂函数模式
文章目录 案例基本案例逐渐复杂的案例 问题回顾什么是工厂模式?为什么会用到工厂函数模式?工厂函数模式和抽象工厂模式有什么关系? 工厂函数模式是一种创建型设计模式,抛出问题: 什么是工厂函数模式?为什么…...

数据赋能(171)——开发:数据挖掘——概述、关注焦点
概述 数据挖掘是从大量的数据中,提取隐藏在其中的、事先不知道的、但潜在有用的信息的过程。 数据挖掘是数据分析过程中的一个核心环节。 数据挖掘的主要目的是从大量数据中自动发现隐藏的模式、关联和趋势,以揭示数据的潜在价值。数据挖掘技术可以帮…...

L1 - OpenCompass 评测 InternLM-1.8B 实践
基础任务(完成此任务即完成闯关) 使用 OpenCompass 评测 internlm2-chat-1.8b 模型在 ceval 数据集上的性能,记录复现过程并截图。 按照教程中的顺序安装包有问题,网上找了解决方案,按一下顺序能正常执行 使用OpenCo…...

JS【详解】数据类型检测(含获取任意数据的数据类型的函数封装、typeof、检测是否为 null、检测是否为数组、检测是否为非数组/函数的对象)
【函数封装】获取任意数据的数据类型 /*** 获取任意数据的数据类型** param x 变量* returns 返回变量的类型名称(小写字母)*/ function getType(x) {// 获取目标数据的私有属性 [[Class]] 的值const originType Object.prototype.toString.call(x); //…...

OpenCV图像滤波(10)Laplacian函数的使用
操作系统:ubuntu22.04 OpenCV版本:OpenCV4.9 IDE:Visual Studio Code 编程语言:C11 功能描述 计算图像的拉普拉斯值。 该函数通过使用 Sobel 运算符计算出的 x 和 y 的二阶导数之和来计算源图像的拉普拉斯值: dst Δ src ∂…...

docker系列11:Dockerfile入门
传送门 docker系列1:docker安装 docker系列2:阿里云镜像加速器 docker系列3:docker镜像基本命令 docker系列4:docker容器基本命令 docker系列5:docker安装nginx docker系列6:docker安装redis docker系…...

LVS(Linux virual server)详解
目录 一、LVS(Linux virual server)是什么? 二、集群和分布式简介 2.1、集群Cluster 2.2、分布式 2.3、集群和分布式 三、LVS运行原理 3.1、LVS基本概念 3.2、LVS集群的类型 3.2.1 nat模式 3.2.2 DR模式 3.2.3、LVS工作模式总结 …...

Session共享方法
在Web开发中,会话(Session)管理是跟踪用户与服务器之间交互的一种常见方法。Session 共享通常指的是在一个应用集群或多个应用服务之间保持用户的会话状态一致。这在负载均衡、微服务架构或者分布式系统中尤为重要 一、基于SQL的session管理…...

Ubuntu 22.04 Docker安装笔记
1、准备一台虚机 可以根据《VMware Workstation安装Ubuntu 22.04笔记》来准备虚拟机。完成后,根据需求安装必要的软件,并设置root权限进行登录。 sudo apt update sudo apt install iputils-ping -y sudo apt install vim -y允许root ssh登录࿱…...

编程-设计模式 6:适配器模式
设计模式 6:适配器模式 定义与目的 定义:适配器模式将一个类的接口转换成客户希望的另一个接口。适配器模式使得原本由于接口不兼容而不能一起工作的那些类可以一起工作。目的:该模式的主要目的是解决接口不匹配的问题,使得一个…...

ERC721 概念解释
目录 FeaturesVotesAccess ControlUpgradeabilityFeatures Mintable: 允许创建新的代币(minting)。合约的所有者或有权限的账户可以调用 mint 函数来生成新的代币,并将其分配给指定的地址。 Auto Increment Ids:自动递增 ID。每次创建新的代币时,代币的 ID 会自动递增,确保…...

数据结构(其五)--串
目录 12.串 12.1 基本操作 12.2 串的存储结构 12.3 字符串的模式匹配算法 (1).朴素模式匹配算法 (2).KMP算法 i.next[]数组的求解 ii.next[]数组的优化——nextval数组 iii.手算nextval数组 iiii.机算nextval数组 + KMP函数 12.串 串,即字符串(string),由零个或多…...

LeetCode Hot100 LRU缓存
请你设计并实现一个满足 LRU (最近最少使用) 缓存 约束的数据结构。 实现 LRUCache 类: LRUCache(int capacity) 以 正整数 作为容量 capacity 初始化 LRU 缓存int get(int key) 如果关键字 key 存在于缓存中,则返回关键字的值,否则返回 -…...

GESP C++ 2024年06月一级真题卷
一、单选题(每题 2 分,共 30 分) 第 1 题 在 C 中,下列不可做变量的是 ( ) 。 A. five-Star B. five_star C. fiveStar D. _fiveStar 答案:A 解析:标识符命名规则,标识符由字母、数…...

在 Ubuntu Server 上配置静态 IP 地址
在 Ubuntu Server 上配置静态 IP 地址 测试时使用的Ubuntu server版本是22.04 一、Ubuntu 17.10之前版本 使用 ifupdown 配置文件来设置静态 IP。配置文件通常位于 /etc/network/interfaces。 1.1 编辑 /etc/network/interfaces 文件: sudo vim /etc/network/in…...

数据结构——栈的讲解(超详细)
前言: 小编已经在前面讲完了链表和顺序表的内容,下面我们继续乘胜追击,开始另一个数据结构:栈的详解,下面跟上小编的脚步,开启今天的学习之路! 目录 1.栈的概念和结构 1.1.栈的概念 1.2.栈的结构…...

三防平板助力MES系统,实现工厂移动式生产报工
在当今竞争激烈的制造业环境中,提高生产效率、优化生产流程以及实现精准的生产管理已经成为企业生存和发展的关键。 MES系统作为连接企业计划层和控制层的桥梁,在实现生产过程的信息化、数字化和智能化方面发挥着重要作用。与此同时,三防平板…...

WEB渗透Bypass篇-常规函数绕过
常规函数绕过 <?php echo exec(whoami);?> ------------------------------------------------------ <?php echo shell_exec(whoami);?> ------------------------------------------------------ <?php system(whoami);?> ------------------------…...

C++从入门到起飞之——string类的模拟实现 全方位剖析!
🌈个人主页:秋风起,再归来~🔥系列专栏:C从入门到起飞 🔖克心守己,律己则安 目录 1、多文件之间的关系 2、模拟实现常用的构造函数 2.1 无参构造函数 2.2 有参的构造函数 2.3 析构函…...

数据库国产化大趋势下,还需要学习Oracle吗?
由于众所周知的原因,近两年各行各业都开始了数据库国产化替代的进程,从国外商业数据库替换到国产或者开源数据库,相信很多的数据库从业人员会把部分精力转移到其他数据库产品的学习中,也有一些人在大肆的宣扬Oracle已经过时了&…...

WebLogic
二、WebLogic 2.1 后台弱口令GetShell 漏洞描述 通过弱口令进入后台界面,上传部署war包,getshell 影响范围 全版本(前提后台存在弱口令) 漏洞复现 默认账号密码:weblogic/Oracle123weblogic常用弱口令: Default Passwords | CIRT.net这里注意&am…...

Aspose.Words.dll 插入模板表格,使用的是邮件合并MailMerge功能,数据源是DataTable或list对象,实例
本实例中的实例功能有: 1、 Aspose.Words.dll 插入模板指定域替换为文字或html标签,见1 2、Aspose.Words.dll 插入模板表格,使用的是邮件合并MailMerge功能,数据源是DataTable或List对象(将list转换成DataTable),见1和2 3、word转换Pdf文件,见1 4、将多个word输出文…...

同时打开多个微信
注: 以下方法用到的 D:\微信\WeChat\WeChat.exe是我的电脑微信路径,可右击桌面微信快捷方式 > 属性 > 目标查看 以下方法都需要先关掉已登录的微信后操作 <一> 找到微信路径 新建一个txt文件输入以下内容 start D:\微信\WeChat\WeChat.exe …...

MPU6050的STM32数据读取
目录 1. 概述2. STM32G030对MPU6050的读取3. STM32F1xx对MPU6050的读取 1. 概述 项目中,往往需要根据不同的环境使用不同的芯片处理某些数据,当使用不同的芯片对六轴陀螺仪芯片MPU6050进行数据处理中,硬件的连接、I/O口的设置往往需要根据相…...

【微信小程序开发】——奶茶点餐小程序的制作(二)
👨💻个人主页:开发者-曼亿点 👨💻 hallo 欢迎 点赞👍 收藏⭐ 留言📝 加关注✅! 👨💻 本文由 曼亿点 原创 👨💻 收录于专栏:…...

Java 文件上传七牛云
Java系列文章目录 文章目录 Java系列文章目录一、前言二、学习内容:三、问题描述四、解决方案:4.1 新建空间4.2 查找密钥4.3 进入开发者中心查找JavaSDK文档4.4 查找文件上传方法4.5 运行测试 五、总结:5.1 学习总结: 一、前言 学…...