热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

ffmpeglinux下配置安装

仅测试安装了一部分,暂未成功安装使用。首先要安装各种解码器1、lamelame-3.99.5.tar.gzUrl:http:

仅测试安装了一部分,暂未成功安装使用。

首先要安装各种解码器 

1、lame

lame-3.99.5.tar.gz

Urlhttp://sourceforge.net/project/showfiles.php?group_id=290&package_id=309

安装方法如下:

1     tar -zxvf lame-3.99.5.tar.gz 
2     cd lame-3.99.5 
3     ./configure --enable-shared

4     make 
5     make install 

2、libogg

libogg-1.3.1.tar.gz

Urlhttp://www.xiph.org/downloads/

安装方法如下:

1     ./configure

2     make 
3     make install 

3、libvorbis

libvorbis-1.3.3.tar.gz

Urlhttp://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz

(libvorbis依赖于libogg, 所以libogg必须先于libvorbis安装)

安装方法如下:

1     ./configure 2     make 
3     make install 

4、xvid

xvidcore-1.3.2.tar.gz

Urlhttp://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz

安装方法如下:

1     tar zvxf xvidcore-1.3.2.tar.gz 
2     cd xvidcore-1.3.2/build/generic 
3     ./configure4     make 
5     make install 

5、x264

latest_x264.tar.bz2 (其中包含的目录是 x264-snapshot-20131023-2245)

Urlhttp://www.videolan.org/developers/x264.html

ftp://ftp.videolan.org/pub/videolan/x264/snapshots/

安装方法如下:

?

1

2

3

4

1    tar -jxvf latest_x264.tar.bz2

2     ./configure 

3     make 

4     make install 

 

出现错误:

Found no assembler

Minimum version is nasm-2.13

If you really want to compile without asm, configure with--disable-asm.

 

没安装nasm,去安装,官网

http://www.nasm.us/

 

 

6、libdts

libdca-0.0.5.tar.bz2

Url: http://www.videolan.org/developers/libdca.html

安装方法:

1     tar -jxvf libdca-0.0.5.tar.bz2
2     cd libdca-0.0.5 
3     ./configure 4     make 
5     make install 

7、a52

a52dec-0.7.4.tar.gz          (这个库从2002年就没有更新过了)

http://liba52.sourceforge.net/downloads.html      

安装方法:

1     ./configure 2     make 
3     make install 

错误:

/usr/bin/ld:imdct.lo: relocation R_X86_64_32 against `.bss' can not be used when making ashared object; recompile with -fPIC

imdct.lo:could not read symbols: Bad value

collect2:ld returned 1 exit status

make[1]:*** [liba52.la] 错误 1

make[1]:正在离开目录 `/home/zhang-lsh/ffmpeg/a52dec-0.7.4/liba52'

make:*** [all-recursive] 错误 1

编译器提示:recompilewith -fPIC

两种方式:

1)在makefile文件里的CFLAGS里加上 -fPIC选项,这样可以一劳永逸

2)如果你的makefile很大,CFLAGS也不明确,那就在配置时手动加上,即:

$CFLAGS="-fPIC" ./configure ..............

如果这样还不行,你需要试一下sudo

即:

$sudo   CFLAGS="-fPIC" ./configure..............

 

来自 <http://blog.csdn.net/bailyzheng/article/details/17613435>

 

 

 

 

8、faad2

faad2-2.7.tar.gz

http://www.audiocoding.com/downloads.html

安装方法

1     autoreconf -vif 
2     ./configure  --with-mp4v2 --enable-shared 
3     make 
4     make install 

9、faac

faac-1.28.tar.gz

http://www.audiocoding.com/downloads.html

安装方法:

1     tar zxvf faac-1.28.tar.gz 
2     cd faac-1.28 
3     ./bootstrap 
4     ./configure 5    make  
6     make install 

 

错误1

zhang-lsh@ubuntu:~/ffmpeg/faac-1.28$ ./bootstrap

./bootstrap: 3: ./bootstrap: aclocal: not found

./bootstrap: 4: ./bootstrap: autoheader: not found

./bootstrap: 8: ./bootstrap: libtoolize: not found

./bootstrap: 10: ./bootstrap: automake: not found

./bootstrap: 11: ./bootstrap: autoconf: not found

 

没安装automake 工具

sudo apt-get install autoconfautomake libtool

错误2

可能会出现如下错误:

Infile included from mp4common.h:29:0,from 3gp.cpp:28:

mpeg4ip.h:126:58:error: new declaration char*strcasestr(const char*, const char*) /usr/include/string.h:369:28: error:ambiguates old declaration constchar* strcasestr(const char*, const char*)

make[3]:*** [3gp.o] Error 1

make[3]:Leaving directory `/usr/local/pc/ffmpeg/faac-1.28/common/mp4v2'

make[2]:*** [all-recursive] Error 1

make[2]:Leaving directory `/usr/local/pc/ffmpeg/faac-1.28/common'

make[1]:*** [all-recursive] Error 1

make[1]:Leaving directory `/usr/local/pc/ffmpeg/faac-1.28'

make:*** [all] Error 2

解决方法:

修改源文件common/mp4v2/mpeg4ip.h文件

注释掉://char*strcasestr(const char *haystack, const char *needle);这一行

重新编译:

[root@localhostfaac-1.28]# make clean ; make

[root@localhostfaac-1.28]# make install

 

 

 

10、amr-nb

amrnb-10.0.0.0.tar.bz2

http://ftp.penguin.cz/pub/users/utx/amr/( 从此处下载最新版本)

安装方法:

1     ./configure 2     make 
3     make install 

11、amr-wb

amrwb-7.0.0.1.tar.bz2

http://ftp.penguin.cz/pub/users/utx/amr/( 从此处下载最新版本)

安装方法:

1     ./configure 2     make 
3     make install 

 

12、最关键的一步, 安装ffmpeg

 

?

1

2

3

1   ./configure --prefix=/usr/local/ffmpeg2 --enable-libmp3lame --enable-libvorbis --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libxvid --enable-postproc --enable-ffserver --enable-ffplay

2   make 

3   make install 

 在./configure的时候会报错, 提示说没有libopencore-amrnb和libopencore-amrwb两个库. 我参考了 [2], 使用如下命令安装它们:

?

1

sudo apt-get install libopencore-amrnb-dev libopencore-amrwb-dev

 如果./configure的时候加入 --enable-shared, 编译安装没有问题. 但是运行ffmpeg命令就会出错:

?

1

relocation error: /usr/local/lib/libavfilter.so.3: symbol sws_get_class, version LIBSWSCALE_2 not defined in file libswscale.so.2 with link time reference;

 这时可以参考 [3], 大意是说跟gstreamer的动态库冲突了, 要卸载gstreamer. 但是如果卸载了gstreamer我的多媒体软件多不能用了. 所以我卸载了ffmpeg并重新编译成静态库. 安装完之后, 运行ffmpeg成功, 输出如下:

?

1

2

3

4

5

6

7

8

9

10

11

12

13

ffmpeg version 2.0.1 Copyright (c) 2000-2013 the FFmpeg developers                                                     

  built on Oct 25 2013 17:40:51 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)                                             

  configuration: --prefix=/usr/local/ffmpeg2 --enable-libmp3lame --enable-libvorbis --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libfaac --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libxvid --enable-postproc --enable-ffserver --enable-ffplay

  libavutil      52. 38.100 / 52. 38.100

  libavcodec     55. 18.102 / 55. 18.102

  libavformat    55. 12.100 / 55. 12.100

  libavdevice    55.  3.100 / 55.  3.100

  libavfilter     3. 79.101 /  3. 79.101

  libswscale      2.  3.100 /  2.  3.100

  libswresample   0. 17.102 /  0. 17.102

  libpostproc    52.  3.100 / 52.  3.100

Hyper fast Audio and Video encoder

usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...


 

来自 <https://www.cnblogs.com/wanghetao/p/3386311.html>

 

 


推荐阅读
  • 在Linux系统上构建Web服务器的详细步骤
    本文详细介绍了如何在Linux系统上搭建Web服务器的过程,包括安装Apache、PHP和MySQL等关键组件,以及遇到的一些常见问题及其解决方案。 ... [详细]
  • 本文介绍了一款用于自动化部署 Linux 服务的 Bash 脚本。该脚本不仅涵盖了基本的文件复制和目录创建,还处理了系统服务的配置和启动,确保在多种 Linux 发行版上都能顺利运行。 ... [详细]
  • 在Ubuntu 16.04 LTS上配置Qt Creator开发环境
    本文详细介绍了如何在Ubuntu 16.04 LTS系统中安装和配置Qt Creator,涵盖了从下载到安装的全过程,并提供了常见问题的解决方案。 ... [详细]
  • 本文详细介绍了网络存储技术的基本概念、分类及应用场景。通过分析直连式存储(DAS)、网络附加存储(NAS)和存储区域网络(SAN)的特点,帮助读者理解不同存储方式的优势与局限性。 ... [详细]
  • PyCharm下载与安装指南
    本文详细介绍如何从官方渠道下载并安装PyCharm集成开发环境(IDE),涵盖Windows、macOS和Linux系统,同时提供详细的安装步骤及配置建议。 ... [详细]
  • 本文介绍了Java并发库中的阻塞队列(BlockingQueue)及其典型应用场景。通过具体实例,展示了如何利用LinkedBlockingQueue实现线程间高效、安全的数据传递,并结合线程池和原子类优化性能。 ... [详细]
  • 使用Vultr云服务器和Namesilo域名搭建个人网站
    本文详细介绍了如何通过Vultr云服务器和Namesilo域名搭建一个功能齐全的个人网站,包括购买、配置服务器以及绑定域名的具体步骤。文章还提供了详细的命令行操作指南,帮助读者顺利完成建站过程。 ... [详细]
  • Hadoop入门与核心组件详解
    本文详细介绍了Hadoop的基础知识及其核心组件,包括HDFS、MapReduce和YARN。通过本文,读者可以全面了解Hadoop的生态系统及应用场景。 ... [详细]
  • 本文详细介绍了VMware的多种认证选项,帮助你根据职业需求和个人技能选择最合适的认证路径,涵盖从基础到高级的不同层次认证。 ... [详细]
  • 本文介绍如何在现有网络中部署基于Linux系统的透明防火墙(网桥模式),以实现灵活的时间段控制、流量限制等功能。通过详细的步骤和配置说明,确保内部网络的安全性和稳定性。 ... [详细]
  • 本文详细介绍了如何准备和安装 Eclipse 开发环境及其相关插件,包括 JDK、Tomcat、Struts 等组件的安装步骤及配置方法。 ... [详细]
  • 嵌入式开发环境搭建与文件传输指南
    本文详细介绍了如何为嵌入式应用开发搭建必要的软硬件环境,并提供了通过串口和网线两种方式将文件传输到开发板的具体步骤。适合Linux开发初学者参考。 ... [详细]
  • 在编译BSP包过程中,遇到了一个与 'gets' 函数相关的编译错误。该问题通常发生在较新的编译环境中,由于 'gets' 函数已被弃用并视为安全漏洞。本文将详细介绍如何通过修改源代码和配置文件来解决这一问题。 ... [详细]
  • Google排名优化-面向Google(Search Engine Friendly)的URL设计 ... [详细]
  • 本文将详细介绍如何在ThinkPHP6框架中实现多数据库的部署,包括读写分离的策略,以及如何通过负载均衡和MySQL同步技术优化数据库性能。 ... [详细]
author-avatar
手机用户2602906017
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有