Why is there ffmpeg codec noise when encoding test tone?

I used FFmpeg to generate a test clip with color bars and a tone. I also made a special filter to dump out the raw audio data to check it. I was surprised to find that there is significant noise riding on the audio tone after it has gone through the AAC codec. Is this expected? Is there a way to prevent it?

To make the test file I used:

ffmpeg -f lavfi -i "smptehdbars=duration=600:size=1280x720:rate=59.94" -qscale:v 1 -pix_fmt yuv420p smpte_r59_720.mp4

then

ffmpeg -i smpte_r59_720.mp4 -f lavfi -i "sine=frequency=1000:sample_rate=48000:duration=600" -qscale:v 1 -vcodec copy -c:a aac -b:a 192k -shortest -map 0:0 -map 1:0 smpte_r59_720T.mp4

and then

ffmpeg -i smpte_r59_720T.mp4 -y -map 0 -acodec aac -vcodec libx264 -crf 23 -bsf:v h264_mp4toannexb smpte_r59_720T.ts

(Trying to do this all in one step kept failing.)

Other variations on this have varying degrees of noise, sometimes above nominal amplitude and sometimes below.

After finding this problem I pulled a third party test tone .WAV file with 44.1KHz sample rate from the web and checked it. The raw file is clean, but the encoded file I made has noise.

Noise on TS SMPTE bars

Clean audio from MP4

链接地址: http://www.djcxy.com/p/33872.html

上一篇: Android OpenGLES渲染

下一篇: 编码测试音时为什么会出现ffmpeg编解码器噪声?