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


相关文章
|
Ubuntu 开发工具 计算机视觉
RK3588 RGA 图像操作
RK3588 RGA 图像操作
|
消息中间件 负载均衡 监控
【ZMQ PUB模式指南】深入探究ZeroMQ的PUB-SUB模式:C++编程实践、底层原理与最佳实践
【ZMQ PUB模式指南】深入探究ZeroMQ的PUB-SUB模式:C++编程实践、底层原理与最佳实践
3619 1
|
Linux C语言 内存技术
Linux下使用alsa-lib库完成音频开发: 实现放音和录音(从声卡获取PCM数据保存、向声卡写PCM数据输出)
Linux下使用alsa-lib库完成音频开发: 实现放音和录音(从声卡获取PCM数据保存、向声卡写PCM数据输出)
1798 0
|
11月前
|
编解码 监控 网络协议
如何使用FFmpeg实现RTSP推送H.264和H.265(HEVC)编码视频
本文详细介绍了如何使用FFmpeg实现RTSP推送H.264和H.265(HEVC)编码视频。内容涵盖环境搭建、编码配置、服务器端与客户端实现等方面,适合视频监控系统和直播平台等应用场景。通过具体命令和示例代码,帮助读者快速上手并实现目标。
2717 6
|
编解码 vr&ar 内存技术
FFmpeg常用命令讲解及实战二(1)
FFmpeg常用命令讲解及实战二
421 0
|
机器学习/深度学习 编解码 API
FFmpeg命令行解析
FFmpeg命令行解析
896 1
|
Linux
CentOS 7 配置yum阿里源 (三步即可)
CentOS 7 配置yum阿里源 (三步即可)
26982 1
|
存储 编解码 缓存
libfdk_aac音频采样数和编码字节数注意
libfdk_aac音频采样数和编码字节数注意
469 0
|
Linux 开发工具 C语言
【研究Qt webengine 模块编译】linux 交叉编译qt5.12的webengine模块成功的条件
【研究Qt webengine 模块编译】linux 交叉编译qt5.12的webengine模块成功的条件
1974 1
|
人工智能 Ubuntu Shell
【Ubuntu工具】安装教程:Ubuntu系统上源码编译安装QT5.15.13(有坑)
【Ubuntu工具】安装教程:Ubuntu系统上源码编译安装QT5.15.13(有坑)
2102 0