View Full Version : bad quality AAC audio when encoding to MP4
'Crispz
25th July 2012, 19:08
I'm trying to encode some .dv files of captured VHS to MP4, using ffmpegX.
When I use the h.264 mencoder codec, the image looks great, but for some reason it auto increases the gain on the audio and it sounds dreadful, really hissy.
When I use the h.264 x264 codec, the sound comes out as expected, but the picture is not as good (partly because there doesn't appear to be a denoise filter available).
Can I make the mencoder library use the audio library that x264 is using?
Or is there a better way entirely?
LoRd_MuldeR
25th July 2012, 20:34
x264 is a video-only encoder, so it does not "use" any audio library ;)
Also MEncoder uses x264 for H.264/AVC encoding. There is no such thing as a "H.264 MEncoder Codec". It's just MEncoder using x264 as a library to encode H.264/AVC.
Furthermore MEncoder (and probably most other OpenSource software) uses FAAC for encoding AAC audio. That's because FAAC is the only "usable" OpenSource AAC encoder currently available.
Nonetheless FAAC is dreadful! It's not anywhere near "state of the art". So if you want to re-encode your audio to AAC, better use a "good" AAC encoder, such as Nero AAC or Apple's AAC encoder!
If you need to stick with FAAC for whatever reason, your only way to "improve" the quality is cranking up the bitrate.
But first of all you should ask yourself if the audio really needs to be re-encoded. What format is the original audio in and why do you need to re-encode?
'Crispz
25th July 2012, 20:48
Thanks Lord, please forgive my wooliness over terminology - I think you got the gist though. :)
The purpose of encoding the audio is to make a smaller compact shareable file - dv files as you know are huge. The audio format in them is PCM 48khz 16bit 1536 Kbps.
I tried different quality settings for AAC using mencoder, but it always comes out the same - far too loud compared to the original, increasing the hiss from the VHS tape.
So... when in ffmpegX I select x264 to create the MP4, how can I find out what is converting the audio? Can I get mencoder to use that instead of whatever it's currently using?
LoRd_MuldeR
25th July 2012, 20:56
I don't know what "ffmpegX" is. But the name indicates it's some GUI front-end for FFmpeg. And, not very surprising, FFmpeg uses FAAC for AAC encoding as well.
Anyway, encoding the original PCM audio to AAC with Nero AAC is very simple. Just download Nero AAC from the web-site. There even are plenty of GUI front-ends, if you prefer a GUI.
Also: If the target format doesn't have to be AAC, you may consider MP3 or Ogg Vorbis. With LAME we have an excellent OpenSource MP3 encoder available. Vorbis is great too...
[EDIT]
I just noticed that "ffmpegX" is some Mac OS X software. Because I don't use Apple products, I can only guess here. But ffmpegX might be using the Apple/QuickTime AAC encoder.
And it's also quite possible that ffmpegX simply passed through the original PCM audio unchanged. Did you check that ffmepgX actually re-encoded the audio?
smok3
26th July 2012, 00:19
@'Crispz; and ffdrop is not good enough for you? (Fully configurable, change the script, bundled x264 related droplets are using apple aac encoder)
p.s. Also the audio is ReplayGained before encoding.
but the picture is not as good (partly because there doesn't appear to be a denoise filter available).
interlacing?
minaust
26th July 2012, 10:47
The purpose of encoding the audio is to make a smaller compact shareable file - dv files as you know are huge. The audio format in them is PCM 48khz 16bit 1536 Kbps.
If there are any settings for normalization, (or anything else monkeying with the gain) turn it off. If there are any defects in the audio, normalization makes them louder, and it sounds like something is boosting the gain.
'Crispz
26th July 2012, 11:02
@smok3 - not heard of ffdrop - will give it a whirl. Is the ReplayGain what's messing up my audio in my current method, as it certainly sounds like a likely culprit? Does mencoder use it?
@minaust - in ffmpegx there is audio settings for gain, but I had them all switched off/down. There was no normalisation switch, though I guessed that was what was being done. :angry:
smok3
26th July 2012, 18:07
@smok3 - not heard of ffdrop - will give it a whirl. Is the ReplayGain what's messing up my audio in my current method, as it certainly sounds like a likely culprit? Does mencoder use it?
ReplayGain will not mess anything, afaik mencoder is not using it (or any other transcoder that i know).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.