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视频播放以及音视频同步:时间基与样本处理
1531 1
|
Linux 编译器 数据安全/隐私保护
Windows10 使用MSYS2和VS2019编译FFmpeg源代码-测试通过
FFmpeg作为一个流媒体的整体解决方案,在很多项目中都使用了它,如果我们也需要使用FFmpeg进行开发,很多时候我们需要将源码编译成动态库或者静态库,然后将库放入到我们的项目中,这样我们就能在我们的项目中使用FFmpeg提供的接口进行开发。关于FFmpeg的介绍这里就不过多说明。
1168 0
|
编解码 监控 网络协议
如何使用FFmpeg实现RTSP推送H.264和H.265(HEVC)编码视频
本文详细介绍了如何使用FFmpeg实现RTSP推送H.264和H.265(HEVC)编码视频。内容涵盖环境搭建、编码配置、服务器端与客户端实现等方面,适合视频监控系统和直播平台等应用场景。通过具体命令和示例代码,帮助读者快速上手并实现目标。
4087 6
|
缓存 监控 计算机视觉
视频监控笔记(三):opencv结合ffmpeg获取rtsp摄像头相关信息
本文介绍了如何使用OpenCV结合FFmpeg获取RTSP摄像头信息,包括网络架构、视频监控系统组成、以及如何读取和显示网络摄像头视频流。
653 1
|
程序员 Linux Android开发
libYuv编译
安卓使用NDK编译libYuv库
1157 0
|
编解码 Linux vr&ar
如何使用ffmpeg将.m4a 格式转换为 pcma格式
ffmpeg是一款开源的万能媒体格式转换工具。它包含了非常先进的音频/视频编解码库libavcodec,为了保证高可移植性和编解码质量,libavcodec里很多code都是从头开发的
|
监控 开发工具 数据安全/隐私保护
Windows平台如何实现多路RTSP|RTMP流合成后录像或转发RTMP服务
本文介绍了在Windows平台上实现多路RTSP/RTMP视频流的合并技术。主要应用场景包括驾考、全景摄像头以及多路会议录制等。技术实现上,文章详细展示了如何使用特定的SDK来解码并回调YUV或RGB数据,再将这些数据按照图层形式进行合成。示例代码中给出了初始化参数、设置视频帧回调函数、以及如何配置不同图层的具体步骤。最终,合成后的视频可以推送到RTMP服务器、注入到本地RTSP服务,或是直接录制为MP4文件。此外,还提供了添加实时文字水印的方法,并展示了四路视频流合成后的“四宫格”效果。
929 0
|
Linux 编译器 网络安全
linux 交叉编译libcurl库
linux 交叉编译libcurl库
1123 1
|
编解码 IDE 开发工具
使用FFmpeg4.3.1的SDK官方开发包编译ffmpeg.c(一)
使用FFmpeg4.3.1的SDK官方开发包编译ffmpeg.c(一)
441 1
|
存储 编解码 数据处理
深入浅出:FFmpeg 音频解码与处理AVFrame全解析(二)
深入浅出:FFmpeg 音频解码与处理AVFrame全解析
1242 0