HydrogenAudio

Lossy Audio Compression => AAC => AAC - Tech => Topic started by: anderbytes on 2016-05-28 05:21:46

Title: FFMPEG AAC Native VBR Quality questions
Post by: anderbytes on 2016-05-28 05:21:46
Hello. I'm new at this forum but I need some help from you experts.

For some reasons I can't detail quickly, I have to use ffmpeg as my encoder/decoder.
As amazing Opus is not yet compatible for lots of hardwares, I'll have to stick with AAC-LC to encode my family videos and keep them with quality.

What happen is: I have to batch-transform all my videos that come from the camera because it's audio bitrate is not configurable. It comes with DCA (DTS Audio) and something as ~384Kbps

As I want to save space and keep the best quality possible without noticing audio artifacts, I decided to use 192kbps as my ~max Kbps.

THE PROBLEM: Using CBR is easy in ffmpeg. -b:a 192k and it`s done. But that wastes space, so I wanted to use VBR that would max around 192-224Kbps. For the life of me I can't understand still this day how the -q:a ranges work.

In some sites it says 0.1-2 , others 0.1-10, others 0-100 ... I don't know what to believe, and testing the parameters with the video brings unpredictable results. In some cases -q:a 0.3 brings it perfectly to around 192Kbps, in others drops to 64Kbps...

- Can anyone explain me exactly what those numbers mean?
- If I use -q:a 0 (zero), what that does?
- If I just wanted to switch to DCA to AAC-LC without losing quality/bitrate, is there a VBR command in ffmpeg to do this?

THANKS A LOT!
Title: Re: FFMPEG AAC Native VBR Quality questions
Post by: saratoga on 2016-05-28 05:28:13
THE PROBLEM: Using CBR is easy in ffmpeg. -b:a 192k and it`s done. But that wastes space, so I wanted to use VBR that would max around 192-224Kbps.

You probably don't want to do this.  The default AAC encoder is not very good.  Instead use an external encoder with ffmpeg:

https://trac.ffmpeg.org/wiki/Encode/AAC

Last I checked the difference was quite large.

Can anyone explain me exactly what those numbers mean?

I don't even think VBR support is fully working in the ffmpeg AAC encoder, or at least, its not recommended.  It may just be that rate estimation is all over the place.
Title: Re: FFMPEG AAC Native VBR Quality questions
Post by: anderbytes on 2016-05-28 05:30:39
As I use some kind of pre-compiled version of FFMPEG, I wish I hadn't have to compile version with other AAC encoder that doesn't come native.

I'm not discarding using another good AAC encoder. Is it easy to compile? which should I use and why?
Title: Re: FFMPEG AAC Native VBR Quality questions
Post by: saratoga on 2016-05-28 05:42:18
I'm not discarding using another good AAC encoder. Is it easy to compile? which should I use and why?

See the link in my first reply.  You probably don't have to compile anything, there are builds floating around.
Title: Re: FFMPEG AAC Native VBR Quality questions
Post by: smok3 on 2016-05-28 07:02:38
Bitrates all over the place with fdk-aac as well (have been using fdkaac (https://github.com/nu774/fdkaac) -m5 for a while now). But I haven't heard any quality problems so far (which doesn't say a lot considering my old ears).
Title: Re: FFMPEG AAC Native VBR Quality questions
Post by: [JAZ] on 2016-05-28 10:57:16
You probably don't want to do this.  The default AAC encoder is not very good.
While you are correct that the native aac encoder is not the best AAC encoder in existence, I believe you have exaggerated that a bit, except if "not very good" means literally that is is not in the "very good" category.

Indeed, if the user is able to use a build with fdkaac support, or even to use Apple's AAC encoder, they are worth considering, but in the absence of those, the current native aac encoder is acceptable, more so if it is a recording from a camera.

As for the VBR options, i guess that link that saratoga mentioned should be enough to get an answer.
Title: Re: FFMPEG AAC Native VBR Quality questions
Post by: Maurits on 2016-05-28 12:24:53
THE PROBLEM: Using CBR is easy in ffmpeg. -b:a 192k and it`s done. But that wastes space, so I wanted to use VBR that would max around 192-224Kbps.

You probably don't want to do this.  The default AAC encoder is not very good.  Instead use an external encoder with ffmpeg:

https://trac.ffmpeg.org/wiki/Encode/AAC

Last I checked the difference was quite large.

Can anyone explain me exactly what those numbers mean?

I don't even think VBR support is fully working in the ffmpeg AAC encoder, or at least, its not recommended.  It may just be that rate estimation is all over the place.
Last February, with the release of FFMPEG 3.0 (https://ffmpeg.org/index.html#news), "The native FFmpeg AAC encoder has seen extensive improvements and is no longer considered experimental" according to the release notes.

Are you sure it should still be called "not very good"?
Title: Re: FFMPEG AAC Native VBR Quality questions
Post by: 2012 on 2016-05-28 14:07:15
Last February, with the release of FFMPEG 3.0 (https://ffmpeg.org/index.html#news), "The native FFmpeg AAC encoder has seen extensive improvements and is no longer considered experimental" according to the release notes.

Are you sure it should still be called "not very good"?

Yes (https://hydrogenaud.io/index.php/topic,111085.0.html).
Title: Re: FFMPEG AAC Native VBR Quality questions
Post by: [JAZ] on 2016-05-28 19:41:41
Yes (https://hydrogenaud.io/index.php/topic,111085.0.html).

In fact, that listening test demonstrates that it scales well with bitrate, even though fdkaac requires less bitrate. (Since the test stops at 128kbps, we cannot extrapolate exactly how it will perform at 160, but the progression could possibly be similar). Also note that the OP was considering 192kbps.

In other words: It cannot be considered in the "best encoders" group, but that does not put it in the "shitty, do not use" group. Worse encoders do exist, definitely.
Title: Re: FFMPEG AAC Native VBR Quality questions
Post by: saratoga on 2016-05-28 21:16:09
At high enough bit rate, its likely fine.  However, I would still follow the ffmpeg recommendations, even if it means taking several minutes to download an updated build.
Title: Re: FFMPEG AAC Native VBR Quality questions
Post by: Nrs994 on 2018-05-01 16:01:15
Recent releases can be used for lower bitrates by manually overriding the cutoff settings.In my experience it seems to outperform both quality obtained by default settings and fdkaac  0.6.2 with libfdk-aac 3.4.12