FFmpeg -strict -2 的这个参数好多说的不太正确 好多都是说 -strict strictness 跟标准的严格性 解释的和实际含义差别很大 这里详细说明下:
ffmpeg -re -i /Users/Downloads/RelaxingGuitarMusic.3gp -vcodec copy -acodec copy -strict -2 -f flvrtmp://192.168.10.61:1935/zbcs/room
ffmpeg -re -i /Users/Downloads/RelaxingGuitarMusic.3gp -vcodec copy -acodec copy -strict -2 -f flvrtmp://localhost:1935/zbcs/room
ffmpeg -re -i /Users/Downloads/RelaxingGuitarMusic.3gp -vcodec libx264 -acodec aac -strict -2 -f flvrtmp://192.168.10.61:1935/zbcs/room
Native FFmpeg AAC encoder ¶
The native FFmpeg AAC encoder. This is currently the second highest-quality AAC encoder available in FFmpeg and does not require an external library like the other AAC encoders described here. This is the default AAC encoder.
Note: -strict experimental (or -strict -2) was previously required for this encoder, but it is no longer experimental and these options are unnecessary since 5 December 2015.
-strict -2 之前是实验参数表示 aac音频编码 如果不使用aac音频编码使用使其的编码好像还需要导入第三方的音频编码库 比较麻烦 使用FFmpeg自带的aac音频编码要带上-strict -2 参数就可以了。带这个参数是为了使用aac音频编码。
https://zhidao.baidu.com/question/539258608.html
-sameq 指相同的量级数,常被误用成“相同的画质”,所以被取消。官方推荐用-qscale和-qmax替代
ffmpeg不支持libfaac库,faac库音质也一般。
另支持2套AAC音频编码,
-acodec aac 是ffmpeg自制的AAC编码器,处在实验阶段,需要开启"-strict experimental"参数,音质也不差。
-acodec libvo_aacenc 是移植自安卓系统的AAC编码器,比较成熟。
我测试发现-qmax或者-qscale 后面需要填一个数字,请问这个数字是什么含义呢? -sameq相同量级数是什么意思呢? 谢谢
xvid或x264之类的编码器对编码的程度有量化的级数。-sameq保持和输入时一样的级数,但再次有损编码进行编码,画质肯定会下降,所以不是一样的画质。 -qmax n 声明变化级数编码时最大的级数整数n。 n的值由具体编码决定,x264是[0,51]之间。0代表最好,51最差 -qscale n 以固定的量化级数值n编码,x264是[0,51]之间。
非常感谢!
参考地址:
http://trac.ffmpeg.org/wiki/Encode/AAC
Native FFmpeg AAC encoder ¶
The native FFmpeg AAC encoder. This is currently the second highest-quality AAC encoder available in FFmpeg and does not require an external library like the other AAC encoders described here. This is the default AAC encoder.
Note: -strict experimental (or -strict -2) was previously required for this encoder, but it is no longer experimental and these options are unnecessary since 5 December 2015.
Example using -b:a
ffmpeg -i input.wav -c:a aac -b:a 160k output.m4a
Example using -q:a
ffmpeg -i input.wav -c:a aac -q:a 2 output.m4a
Effective range for -q:a is around 0.1-2. This VBR is experimental and likely to get even worse results than the CBR.