Opened 5 years ago

Last modified 5 years ago

#7550 open defect

Audible artifacts when converting from WAV to AAC

Reported by: Sylvain Leroux Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: aac
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

While converting a WAV file to AAC I noticed audible audio artifacts. Especially, the artifacts seem to appear on only one channel even in dual-mono.

The issue has improved in the latest build compared to ffmpeg 3.2.12-1~deb9u1 used on our Debian 9.4 production host but is still clearly audible.

A particularly audible artifact is present between 00:05:30.930 and 00:05:30.940 is the attached example file. I copied the audio files in extenso since the artifact seems to vanish when I trim the input file.

Attached:

  • EP26-wav-to-aac-artifacts-orig.wav : the original uncompressed audio file
  • EP26-wav-to-aac-artifacts-ffmpeg-debian-stable.mp4 : the audio transcoded as AAC by ffmpeg 3.2.12-1~deb9u1 on our Debian 9.4 production host
  • EP26-wav-to-aac-artifacts-ffmpeg-static-latest.mp4 : the audio transcoded as AAC by the latest ffmpeg static build
  • Audacity screen capture pinpointing an artifact (first stereo pair is original WAV, second stereo pair is output produced by ffmpeg on Debian 9.4, third stereo pair in output produced by the lattest ffmpeg static build)

How to reproduce:

$ /tmp/ffmpeg-git-20181115-amd64-static/ffmpeg -i EP26-wav-to-aac-artifacts-orig.wav -c:a aac EP26-wav-to-aac-artifacts-ffmpeg-debian-stable.mp4
ffmpeg version N-47455-g1096614c42-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg
  libavutil      56. 23.101 / 56. 23.101
  libavcodec     58. 39.100 / 58. 39.100
  libavformat    58. 22.100 / 58. 22.100
  libavdevice    58.  6.100 / 58.  6.100
  libavfilter     7. 43.100 /  7. 43.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'EP26-wav-to-aac-artifacts-orig.wav':
  Duration: 00:07:46.24, bitrate: 1536 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, mp4, to 'EP26-wav-to-aac-artifacts-ffmpeg-debian-stable-2.mp4':
  Metadata:
    encoder         : Lavf58.22.100
    Stream #0:0: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.39.100 aac
size=    6513kB time=00:07:46.24 bitrate= 114.4kbits/s speed=36.3x    
video:0kB audio:6427kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.342028%
[aac @ 0x55cedc0] Qavg: 15720.868

Change History (4)

comment:1 by Sylvain Leroux, 5 years ago

I'm struggling at uploading the sample files to upload.ffmpeg.org so here are direct links to download them:

EP26-wav-to-aac-artifacts-orig.wav
EP26-wav-to-aac-artifacts-ffmpeg-debian-stable.mp4
EP26-wav-to-aac-artifacts-ffmpeg-static-latest.mp4

http://www.chicoree.fr/pub/ffmpeg-wav-to-aac-artifacts/EP26-audacity-screenshot.png

comment:2 by Carl Eugen Hoyos, 5 years ago

Keywords: aac added

Your input sample is completely silent between 5:30:930 and 5:30:940. What does the speaker say when you hear the artefacts?

comment:3 by Sylvain Leroux, 5 years ago

Hi @cehoyos. Thank you for your comment.

Your input sample is completely silent between 5:30:930 and 5:30:940.

From what I can hear here, it is not completely silent in the original:

ffplay -ss 00:05:29 http://www.chicoree.fr/pub/ffmpeg-wav-to-aac-artifacts/EP26-wav-to-aac-artifacts-orig.wav

If you use a visualization tool, you may need to look at the waveform using a log/dB scale instead of a linear one.

The speaker saids "[...]Look at the Bluetooth hardware indi^cator you may see it blinks rapidly[...]", where ^ denotes the point where the artifact is audible. It's while the "I" sound is decaying, and just before the attack for the "CA" sound.

With quality headphones, I can clearly hear the difference with

ffplay -ss 00:05:29 http://www.chicoree.fr/pub/ffmpeg-wav-to-aac-artifacts/EP26-wav-to-aac-artifacts-ffmpeg-static-latest.mp4

In that latter case, there is undoubtedly some extra noise on the right channel. Actually, this is that asymmetry that makes me noticed it.

Let me know if it was unclear.

comment:4 by Carl Eugen Hoyos, 5 years ago

Component: undeterminedavcodec
Status: newopen
Note: See TracTickets for help on using tickets.