libfdk-aac和x264安装编译

简介: libfdk-aac和x264安装编译



使用libfdk-aac库编码(s16)

libfdk-aac输入的音频格式为s16编码后输出的音频格式为AV_SAMPLE_FMT_FLTP。

在ubuntu16下系统有包:

sudo apt-get install libfdk-aac-dev


在centos7下:

首选要卸载系统原有的fdk-aac,不然使用AV_SAMPLE_FMT_S16格式时会报错:

Specified sample format -1 is invalid or not supported


卸载:

sudo yum remove fdk-aac
git clone https://github.com/mstorsjo/fdk-aac.git


或:

https://sourceforge.net/projects/opencore-amr/files/fdk-aac/


然后编译:

./autogen.sh
./configure CFLAGS=-fPIC
make -j20
sudo make install


在编译ffmpeg时需要增加编译选项:

--enable-nonfree  --enable-libfdk-aac


编译x264,获取网站

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


打开下载的x264源码,执行

./configure --enable-shared --enable-static --disable-asm 
make
make install


可以看一下x264都支持哪些参数配置

x264 -h
x264 --fullhelp
ffmpeg -h encoder=libx264


这些配置,ffmpeg都有对应的接口来配置。

编译ffmpeg命令:这里增加了h264编码和解码

cd ffmpeg-4.3
make uninstall
./configure --disable-x86asm --enable-shared --enable-libx264 --enable-swscale --enable-avresample --enable-gpl --enable-nonfree  --enable-libfdk-aac --enable-decoder=h264 --prefix=/usr/local
make clean
make -j20
make install


编码后可以查看ffmpeg对x264支持的参数配置,包括支持的像素格式:

ffmpeg -h encoder=libx264


Encoder libx264 [libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10]:

General capabilities: delay threads

Threading capabilities: auto

Supported pixel formats: yuv420p yuvj420p yuv422p yuvj422p yuv444p yuvj444p nv12 nv16 nv21 yuv420p10le yuv422p10le yuv444p10le nv20le

libx264 AVOptions:

-preset E…V… Set the encoding preset (cf. x264 --fullhelp) (default “medium”)

-tune E…V… Tune the encoding params (cf. x264 --fullhelp)

-profile E…V… Set profile restrictions (cf. x264 --fullhelp)

-fastfirstpass E…V… Use fast settings when encoding first pass (default true)

-level E…V… Specify level (as defined by Annex A)

-passlogfile E…V… Filename for 2 pass stats

-wpredp E…V… Weighted prediction for P-frames

-a53cc E…V… Use A53 Closed Captions (if available) (default true)

-x264opts E…V… x264 options

-crf E…V… Select the quality for constant quality mode (from -1 to FLT_MAX) (default -1)

-crf_max E…V… In CRF mode, prevents VBV from lowering quality beyond this point. (from -1 to FLT_MAX) (default -1)

-qp E…V… Constant quantization parameter rate control method (from -1 to INT_MAX) (default -1)

-aq-mode E…V… AQ method (from -1 to INT_MAX) (default -1)

none E…V…

variance E…V… Variance AQ (complexity mask)

autovariance E…V… Auto-variance AQ

autovariance-biased E…V… Auto-variance AQ with bias to dark scenes

-aq-strength E…V… AQ strength. Reduces blocking and blurring in flat and textured areas. (from -1 to FLT_MAX) (default -1)

-psy E…V… Use psychovisual optimizations. (default auto)

-psy-rd E…V… Strength of psychovisual optimization, in : format.

-rc-lookahead E…V… Number of frames to look ahead for frametype and ratecontrol (from -1 to INT_MAX) (default -1)

-weightb E…V… Weighted prediction for B-frames. (default auto)

-weightp E…V… Weighted prediction analysis method. (from -1 to INT_MAX) (default -1)

none E…V…

simple E…V…

smart E…V…

-ssim E…V… Calculate and print SSIM stats. (default auto)

-intra-refresh E…V… Use Periodic Intra Refresh instead of IDR frames. (default auto)

-bluray-compat E…V… Bluray compatibility workarounds. (default auto)

-b-bias E…V… Influences how often B-frames are used (from INT_MIN to INT_MAX) (default INT_MIN)

-b-pyramid E…V… Keep some B-frames as references. (from -1 to INT_MAX) (default -1)

none E…V…

strict E…V… Strictly hierarchical pyramid

normal E…V… Non-strict (not Blu-ray compatible)

-mixed-refs E…V… One reference per partition, as opposed to one reference per macroblock (default auto)

-8x8dct E…V… High profile 8x8 transform. (default auto)

-fast-pskip E…V… (default auto)

-aud E…V… Use access unit delimiters. (default auto)

-mbtree E…V… Use macroblock tree ratecontrol. (default auto)

-deblock E…V… Loop filter parameters, in alpha:beta form.

-cplxblur E…V… Reduce fluctuations in QP (before curve compression) (from -1 to FLT_MAX) (default -1)

-partitions E…V… A comma-separated list of partitions to consider. Possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all

-direct-pred E…V… Direct MV prediction mode (from -1 to INT_MAX) (default -1)

none E…V…

spatial E…V…

temporal E…V…

auto E…V…

-slice-max-size E…V… Limit the size of each slice in bytes (from -1 to INT_MAX) (default -1)

-stats E…V… Filename for 2 pass stats

-nal-hrd E…V… Signal HRD information (requires vbv-bufsize; cbr not allowed in .mp4) (from -1 to INT_MAX) (default -1)

none E…V…

vbr E…V…

cbr E…V…

-avcintra-class E…V… AVC-Intra class 50/100/200 (from -1 to 200) (default -1)

-me_method E…V… Set motion estimation method (from -1 to 4) (default -1)

dia E…V…

hex E…V…

umh E…V…

esa E…V…

tesa E…V…

-motion-est E…V… Set motion estimation method (from -1 to 4) (default -1)

dia E…V…

hex E…V…

umh E…V…

esa E…V…

tesa E…V…

-forced-idr E…V… If forcing keyframes, force them as IDR frames. (default false)

-coder E…V… Coder type (from -1 to 1) (default default)

default E…V…

cavlc E…V…

cabac E…V…

vlc E…V…

ac E…V…

-b_strategy E…V… Strategy to choose between I/P/B-frames (from -1 to 2) (default -1)

-chromaoffset E…V… QP difference between chroma and luma (from INT_MIN to INT_MAX) (default -1)

-sc_threshold E…V… Scene change threshold (from INT_MIN to INT_MAX) (default -1)

-noise_reduction E…V… Noise reduction (from INT_MIN to INT_MAX) (default -1)

-x264-params E…V… Override the x264 configuration using a :-separated list of key=value parameters


相关文章
|
存储 算法 C++
深入理解ffmpeg视频播放以及音视频同步:时间基与样本处理
深入理解ffmpeg视频播放以及音视频同步:时间基与样本处理
1705 1
|
Ubuntu Linux 时序数据库
sudo apt-get update提示E: 仓库 “http://mirrors.aliyun.com/ubuntu eoan Release” 没有 Release 文件。亲试解决办法
将自己亲身解决这个办法进行分享,希望朋友们可以少走弯路。
12997 1
|
编解码 监控 网络协议
如何使用FFmpeg实现RTSP推送H.264和H.265(HEVC)编码视频
本文详细介绍了如何使用FFmpeg实现RTSP推送H.264和H.265(HEVC)编码视频。内容涵盖环境搭建、编码配置、服务器端与客户端实现等方面,适合视频监控系统和直播平台等应用场景。通过具体命令和示例代码,帮助读者快速上手并实现目标。
4446 6
|
网络协议 算法 网络性能优化
【流媒体】推流与拉流简介
【流媒体】推流与拉流简介
3077 0
|
Linux Shell
Linux系统编程:掌握popen函数的使用
记得在使用完 `popen`打开的流后,总是使用 `pclose`来正确关闭它,并回收资源。这种做法符合良好的编程习惯,有助于保持程序的健壮性和稳定性。
1189 6
|
缓存 应用服务中间件 nginx
安装nginx-http-flv-module模块
本文介绍如何为Nginx安装`nginx-http-flv-module`模块。此模块基于`nginx-rtmp-module`二次开发,不仅具备原模块的所有功能,还支持HTTP-FLV播放、GOP缓存、虚拟主机等功能。安装步骤包括:确认Nginx版本、下载相应版本的Nginx与模块源码、重新编译Nginx并加入新模块、验证模块安装成功。特别注意,此模块已包含`nginx-rtmp-module`功能,无需重复编译安装。
1761 3
|
存储 编解码 数据处理
深入浅出:FFmpeg 音频解码与处理AVFrame全解析(二)
深入浅出:FFmpeg 音频解码与处理AVFrame全解析
1380 0
FFmpeg学习笔记(二):多线程rtsp推流和ffplay拉流操作,并储存为多路avi格式的视频
这篇博客主要介绍了如何使用FFmpeg进行多线程RTSP推流和ffplay拉流操作,以及如何将视频流保存为多路AVI格式的视频文件。
2050 0
|
Linux 编译器 网络安全
linux 交叉编译libcurl库
linux 交叉编译libcurl库
1259 1
ffmpeg的下载、编译与安装
ffmpeg的下载、编译与安装
872 0

热门文章

最新文章