关于ffmpeg

FFmpeg是一個自由軟體,可以執行音訊和視訊多種格式的錄影、轉檔、串流功能,包含了libavcodec——這是一個用於多個專案中音訊和視訊的解碼器函式庫,以及libavformat——一個音訊與視訊格式轉換函式庫。

--以上内容摘自 https://zh.wikipedia.org/wiki/FFmpeg

环境

Ubuntu Desktop 16.04 LTS

FFmpeg配置

1.关于yasm

在安装ffmpeg之前,还是先安装下yasm吧

(其实,也可以不装,在编译ffmpeg的时候加上 --disable-yasm 参数即可)

那么yasm是做什么用的呢?

Yasm is a complete rewrite of the NASM assembler under the “new” BSD License (some portions are under other licenses, see COPYING for details).

Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM and GAS assembler syntaxes, outputs binary, ELF32, ELF64, 32 and 64-bit Mach-O, RDOFF2, COFF, Win32, and Win64 object formats, and generates source debugging information in STABS, DWARF 2, and CodeView 8 formats.

Yasm can be easily integrated into Visual Studio 2005/2008 and 2010 for assembly of NASM or GAS syntax code into Win32 or Win64 object files.

以上是yasm官网的解释

其实就是英特尔X86架构下的汇编器和反汇编器,可以用来编写16位、32位(IA-32)和64位(x86-64)的程序。

2.安装yasm

wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar -zxf yasm-1.3..tar.gz
cd yasm-1.3./
./configure
make
sudo make install
sudo ldconfig

3.编译ffmpeg

tar -jxf ffmpeg-4.0..tar.bz2 #我这里已经下载好了
cd ffmpeg-4.0./
./configure --prefix=/usr/local/ffmpeg --enable-shared
make
sudo make install

--enable-shared 参数据说是允许其编译产生动态库,在以后的编程中要用到这个几个动态库。

4.给ffmpeg设置环境变量

sudo vi /etc/profile

加入以下内容:

FFMPEG=/usr/local/ffmpeg
export PATH="$FFMPEG/bin:$PATH"

使修改立即生效

source /etc/profile6

5.为了防止执行程序找不到库文件

可以将/usr/local/ffmpeg/lib目录设置到LD_LIBRARY_PATH环境变量

6.找不到库文件

环境变量设置完成后

ffmpeg -version

检查下安装是否有问题

正常情况是显示这个

ffmpeg -version
ffmpeg version 4.0. Copyright (c) - the FFmpeg developers
built with gcc (Ubuntu 7.3.-16ubuntu3)
configuration: --prefix=/usr/local/ffmpeg --enable-shared
libavutil . 14.100 / . 14.100
libavcodec . 18.100 / . 18.100
libavformat . 12.100 / . 12.100
libavdevice . 3.100 / . 3.100
libavfilter . 16.100 / . 16.100
libswscale . 1.100 / . 1.100
libswresample . 1.100 / . 1.100

若出现 ffmpeg: error while loading shared libraries: libavdevice.so.58: cannot open shared object file 错误

修改/etc/ld.so.conf 在最后一行加上

/usr/local/ffmpeg/lib

例如

include /etc/ld.so.conf.d/*.conf
/usr/local/ffmpeg/lib #在后面加上这段

再执行

sudo ldconfig 

并修改 /usr/local/ffmpeg/lib目录下的文件权限为777

检查下库是否加载到

ldd $(which ffmpeg)
ffmpeg -version

我是在Ubuntu的桌面版安装的,如果你是server版,可能会缺少很多库。请参考这里 在Ubuntu Server上编译FFmpeg

比较完整的编译安装,请参考官网文档 Compile FFmpeg for Ubuntu, Debian, or Mint

Ubuntu Desktop 编译 ffmpeg (简略的写写)的更多相关文章

  1. 在Ubuntu下编译FFmpeg

    第一步:准备编译环境 .tar.bz2 -2245/ ./configure --enable-static--enable-shared--prefix=/usr/localmakesudomake ...

  2. ubuntu 下 编译ffmpeg 3.1.1

    1,下载ggmpeg源码:http://ffmpeg.org/download.html 2.下载ndk ,百度 3.配置环境 3.1 编译FFMPEG时,出现了 ffmpeg yasm not fo ...

  3. ubuntu下编译ffmpeg+SDL+ffplay提取motion vector

    编译ffmpeg: 第一步: 从官网http://ffmpeg.org/下载最新版本. 解压tar -xjvf ffmpeg-3.3.1.tar.bz2 进入目录cd ffmpeg-3.3.1 第二步 ...

  4. [笔记] Ubuntu下编译ffmpeg+openh264+x264

    [下载代码]   - ffmpeg: git clone git://source.ffmpeg.org/ffmpeg.git - openh264: git clone https://github ...

  5. ubuntu下编译ffmpeg并用eclipse调试

    一.下载ffnpeg源码 下载地址:http://ffmpeg.org/download.html 二.解决版本问题 可能之前你编译过ffmpeg,或者装过相关的库,那都要先卸载掉,否则用的时候会报一 ...

  6. Linux下编译ffmpeg并用GDB调试

    1.在Ubuntu界面上调处命令行界面,最方便的方式是使用快捷键Ctrl+Alt+T. 2.安装SDL SDL是一个开源的多媒体开发库,可以设置图像和视频的绘制等操作.如果不安装SDL,FFMPEG将 ...

  7. 【FFMPEG】Ubuntu上安装FFMPEG

    在之前,我们成功地使用mingw+msys在Windows平台下编译FFmpeg(见 http://www.linuxidc.com/Linux/2014-11/109839.htm),并生成了ffp ...

  8. ubuntu下编译原生ffmpeg

    本文主要介绍Linux 系统下如何编译Ffmpeg,编译环境是Ubuntu 16.04,Ffmpeg版本是3.4.2.Windows环境 下如何编译ffmpeg前面有博文介绍,也录有视频,感兴趣的同学 ...

  9. Ubuntu下安装和编译ffmpeg

    参考:http://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu   1.安装依赖包 sudo apt-get update sudo apt-get -y ...

随机推荐

  1. JDK下载-安装-配置

    1.JDK的下载 jdk1.8版本   下载地址: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-213 ...

  2. js 字符串跟数组的相互转化

    一:字符串转化为数组 例子: var str = "3:2;2:1"; 要变成 arr= [{ a:"3", b:"2", bol:fals ...

  3. nginx ----> 官网about页面(翻译)

    Nginx about链接:https://nginx.org/en/ nginx 基本的HTTP服务器功能其他HTTP服务器功能邮件代理服务器功能TCP / UDP代理服务器功能架构和可扩展性经测试 ...

  4. Python自学:第二章 浮点数

    >>>0.1 + 0.1 0.2 >>>0.2 + 0.2 0.4 >>>2 * 0.1 0.2 >>>2 * 0.2 0.4

  5. three.js 第一篇:准备工作

    demo展示:https://www.hanjiafushi.com/three/index.html 1:复习向量知识 2:学习矩阵知识 3:推荐先看webGL入门指南,对一些基础性的概念有所了解 ...

  6. 另一道不知道哪里来的FFT题

    给定一个序列,求出这个序列的k阶前缀和,模998244353,n<=1e5. k阶前缀和可以看成一个一个n*k的平面上的二维行走问题. 第i项对第j项的贡献是从(i,0)走到(j,k)的NE L ...

  7. 随机森林RF、XGBoost、GBDT和LightGBM的原理和区别

    目录 1.基本知识点介绍 2.各个算法原理 2.1 随机森林 -- RandomForest 2.2 XGBoost算法 2.3 GBDT算法(Gradient Boosting Decision T ...

  8. 『PyTorch』第五弹_深入理解Tensor对象_中下:数学计算以及numpy比较_&_广播原理简介

    一.简单数学操作 1.逐元素操作 t.clamp(a,min=2,max=4)近似于tf.clip_by_value(A, min, max),修剪值域. a = t.arange(0,6).view ...

  9. 1、安装Angular-CLI脚手架工具

    依赖环境的安装 1.安装node.js(版本在6以上) 查看版本号:node -v 2.安装npm(npm会随着node的安装一起被安装) 3.安装Python(我安装的是2.7.14),要安装环境变 ...

  10. NopCommerce 更改发票字体

    NopCommerce 默认是用~/App_Data/Pdf/FreeSerif.ttf 这个字体的. 用这个字体,发票里的中文不能显示. 可以把c:\windows\font\simhei.ttf  ...