possible to get Lame (ideally VBR) audio, and for mp4 too?

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
TimmyC
Posts: 13
Joined: Sun Jan 31, 2010 7:30 pm

possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by TimmyC »

So I'm curious why Handbrake only offers mp3 audio option when using Matroska container output, and also why only Constant Bit Rate mp3.
As far as I understand,
1) mp3 is compatible with mpeg-4 standard container format
2) VBR audio streams are spec-compatible and work fine in matroska and mpeg-4 video containers
3) Lame mp3 is better audio at a given bitrate than the FAAC encoder

On point #1, it may be that iTunes/Quicktime won't play mpeg-4 video streams (whether .mv4 for iTunes or .mp4 for Quicktime) with mp3 audio. I made an mpeg-4 video with mp3 audio stream (demux h264 and AAC audio using MP4Box, transocde the AAC audio stream to mp3, then mux the h264 and mp3 together). The resulting video played fine in VLC, but not in iTunes or Quicktime. So even if mpeg-4 video standard allows mp3 audio streams (and I may be wrong on that too), Apple's market dominance allows them to set de facto standards for compatibility.

On point #2, I understand that some players have trouble with AVI files that use VBR audio, but such players aren't the norm, and this doesn't apply to Matroska and mpeg-4 videos anyway. Handbrake is already using VBR video (encoding by quality level rather than desired output filesize), and with 0.9.4 has moved away from AVI compatibility.
Maybe VBR audio is already in the works for 0.9.5, as Handbrake has clearly added a lot of changes in recent editions. But if there are other reasons for not using VBR audio, I'm curious to know them.

On point #3. the AAC audio format certainly has more "headroom" and potential for improvement than mp3, which is likely very near topped-out in terms of quality within the limits of the format. However, at present, the best AAC encoders (Nero and iTunes) are only slightly better than mp3 at bitrates above 128kbps, and often statistically tied with Lame mp3 in listening tests conducted by Hydrogen Audio. Given the oft-mentioned age and "unimpressive performance of the FAAC encoder, I suspect Lame would handily outperform FAAC for audio quality at a given bitrate. I suspect this is true at CBR (currently available in Handbrake), but would be even more true when comparing VBR, as most of the optimization to Lame's encoder in recent years have been on the VBR presets.

So, at least for people encoding to the Matroska container format, Lame mp3 should be included with the ability to encode using the VBR presets. I'm not sure of the status regarding mp3 format within mpeg-4 video streams, for compatibility with common programs (read: Apple).

4) If mp3 audio can't work in videos encoded for Apple, is there any possibility of getting a better audio encoder for AAC? I understand Nero's AAC encoder is free for the public, but this may just be for personal use, as it's definitely not open-source.
- Or is there a way of building program functionality for Nero AAC into Handbrake so that users can download Nero's encoder themselves (for personal use) but still command it from within Handbrake?
- Or finally, is there a way to use Handbrake's muxer (so I could just encode AC3 passthru audio, extract that from the resulting .m4v and encode it with Nero AAC, and use Handbrake to re-mux the Nero AAC audio stream to replace the AC3? I can mux with MP4Box currently (Yamb frontend), but it doesn't seem to handle chapter markers well.

Thanks much for consideration and/or response.
Last edited by TimmyC on Wed Feb 10, 2010 1:12 pm, edited 1 time in total.
TedJ
Veteran User
Posts: 5388
Joined: Wed Feb 20, 2008 11:25 pm

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by TedJ »

The no mp3 in mp4 limitation isn't isolated to iTunes and Quicktime, I'm afraid. While it is certainly allowable under the specification, most of the hardware and software players I've encountered haven't implemented it... most likely with the reasoning that aac is more efficient at lower bitrates than mp3. ;)

I'll leave the other questions to those more qualified than myself.
creamyhorror
Enlightened
Posts: 134
Joined: Mon Jan 04, 2010 2:00 pm

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by creamyhorror »

Why HB doesn't include LAME is a good question, since LAME probably beats faac as you said (and MP3 is perfectly legal in MKV). Personally I generally use the original AC-3 track. If I have to transcode, I use Nero AAC (obviously not with HB), which is probably superior to LAME.
Deleted User 13735

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by Deleted User 13735 »

mp3 is grossly inferior to AC3/AAC in my opinion, both for intrinsic quality and "quality vs. compression."
i wouldn't care if mp3 wasn't included in any legit video format.
creamyhorror
Enlightened
Posts: 134
Joined: Mon Jan 04, 2010 2:00 pm

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by creamyhorror »

musicvid wrote:mp3 is grossly inferior to AC3/AAC in my opinion, both for intrinsic quality and "quality vs. compression."
On what basis do you say this (references, listening tests, whatever)? Have you heard of LAME, which is what we're talking about here?
Dukers
Posts: 43
Joined: Sat Jun 27, 2009 1:39 am

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by Dukers »

For me is pretty simple: FAAC is crap. So, since encoding with LAME presets allways beats FAAC, I suggest that LAME presets can be made available at least with MKV.
Deleted User 13735

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by Deleted User 13735 »

On what basis do you say this (references, listening tests, whatever)? Have you heard of LAME, which is what we're talking about here?
I've been in the live music business for the better part of forty years. I have hundreds of hours of live audio performances backed up with LAME. I understand its options and its limitations as well as anybody. MP3 achieves its compression by literally chopping the top off the high frequencies, which is its Achilles heel. MP3 was a good idea in its time, and teenagers of all ages cling to it to this day, kind of like people of my generation held on to our cassette tapes long after CD audio became the norm. However, AAC achieves better quality than MP3 at any bitrate without sacrificing the high freqs, which despite my advanced age, are still important to me.

Why do you think iTunes delivers AAC rather than MP3? Because they want to sell us lower quality vs. bitrate ??
Think again. Download bandwidth = $ in their game, in its most simple analysis.

I have licensed AC3 and AAC encoders on my editing system. I use them for almost all of my video work. While not perfect, when every portable player, cell phone, etc., accepts them, I will begin delivering my audio content in those formats, and we are getting much closer to that day. Until then, taking a giant step backwards by putting MP3 audio in my video is something I am simply not interested in doing. And I can promise you that the day that LAME embraces AAC technology will be a day of jubilation for me. But to each his own, I guess. I understand there are still some people out there who prefer the "warmth" of their cassette tapes . . . :wink:
Dukers
Posts: 43
Joined: Sat Jun 27, 2009 1:39 am

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by Dukers »

musicvid wrote:Why do you think iTunes delivers AAC rather than MP3?
The problem is not AAC. With a good encoder (like Apple), of course AAC is better than MP3. But we are talking about FAAC, the AAC encoder used by Handbrake at Windows and Linux versions (OS X version uses Apple's implementation with Core Audio). FAAC is very, very bad. It always loses to LAME preset mode (MP3 VBR). That's about it.
Deleted User 13735

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by Deleted User 13735 »

Thanks for the heads up. Is there something inherently wrong with faac? Aren't all the settings available in the CLI? If it's just a preset issue surely there are workarounds. Is there a reason Handbrake can't pass on existing AAC? Licensing? Since so much of my own video work is 5.1 AC-3, I guess I never paid much attention, but since AVC/AAC is such a popular format, maybe I had better . . .
Dukers
Posts: 43
Joined: Sat Jun 27, 2009 1:39 am

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by Dukers »

musicvid wrote:Thanks for the heads up. Is there something inherently wrong with faac? Aren't all the settings available in the CLI? If it's just a preset issue surely there are workarounds. Since I have encoded all of my own dvd work 5.1 AC-3, I guess I never paid much attention, but since I am just getting into AVCHD, maybe I had better . . .
Inherently? Maybe the horrible audio quality... :lol:

With 96kbps or more, LAME performs very well. If predictable file size is important to Handbrake, LAME has the ABR presets (--preset <bitrate>), which are also good. The detail is that as the low preset bitrate LAME automatically apply resample (I don't know if it's high quality). HB would has to pass this task to libsamplerate according to the chosen bitrate.
creamyhorror
Enlightened
Posts: 134
Joined: Mon Jan 04, 2010 2:00 pm

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by creamyhorror »

IIRC, LAME has (admittedly in trials a few years old) matched AAC (think it was the iTunes encoder) in blind listening tests. Whether you think it cuts off higher frequencies, it clearly can't be doing a bad job with the crowd that was testing it (they'd have noticed the loss of high frequencies relative to AAC, I'm sure). And you can turn off the lowpass filter (right term?) when encoding with LAME.

Basically I think the tuning and improvements to LAME have kept it competitive with mid-level AAC encoders. (FAAC is apparently not even mid-level.) Anyway, it's premature to write off LAME for encoding just because you believe all MP3 sucks due to lowpassing. Different encoders can perform very differently, regardless of the technical capabilities of the codec. Witness x264 versus the crappy Quicktime H.264 encoder.
Deleted User 13735

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by Deleted User 13735 »

I just ran some pink noise tests using Lame and Faac (in HB) at the same bitrate, and I have to agree with the other posts on this forum, Lame is better.
So I have been educated by this thread, thanks to all who took the time.
Doesn't mean I'm going to start using mp3 in my videos, however, it just means I'm going to stick with AC-3 or use another solution for AVC/AAC.
TedJ
Veteran User
Posts: 5388
Joined: Wed Feb 20, 2008 11:25 pm

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by TedJ »

This thread illustrates the problem of specification versus implementation. AAC is inherently superior to MP3 if correctly implemented. Unfortunately, faac never had the opportunity to mature before active development on it ceased due to the primary developers moving to greener (read: paid) pastures.

At this stage, faac is still the only free, cross platform AAC encoder currently available.
TimmyC
Posts: 13
Joined: Sun Jan 31, 2010 7:30 pm

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by TimmyC »

@musicvid - thanks for being open-minded here. Lame mp3 is actually quite good, and at settings of V3 and above (V2, V1, and V0 are respectively higher quality and thus higher bitrates) is transparent to the vast majority people on the vast majority of music (presuming listening on good equipment, too).
I was about to jump on you when you mention "pink noise tests." Not that they're necessarily invalid, but the first point of an audio codec is to reproduce sound as heard, not as looked at :)

In general, AAC as a format has a "higher ceiling" (i.e., more room in which to improve) than mp3, which is commonly thought to be nearly maxed-out in terms of performance.
But currently at bitrates in the 128-and-above range, iTunes and Nero AAC encoders are not much ahead of Lame in blind listening tests. At given bitrate, mp3 is better than AC3 as well (although transcoding from AC3 to mp3 will not result in better sound quality, as any transcoding simply applies another round of lossy compression and can only lose quality that way).

But all of this is stuff that I covered in my initial post.


Anyway, I was excited when I came to the forum and saw 12 replies. Great! Now I'll actually get an answer to my question.
But I leave disappointed. I'm pretty surprised that nobody around here actually knows why Lame VBR isn't included in Handbrake.

And I'm also still curious if there's a way to use Nero AAC with Handbrake. There are plenty of programs that supply the presets, but require the user to download the actual encoder binary themselves (for both mp3 and aac format encoders). Perhaps Handbrake could do something like this?
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by mduell »

TimmyC wrote:I'm pretty surprised that nobody around here actually knows why Lame VBR isn't included in Handbrake.
I eagerly await your patch.
creamyhorror
Enlightened
Posts: 134
Joined: Mon Jan 04, 2010 2:00 pm

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by creamyhorror »

musicvid wrote: Doesn't mean I'm going to start using mp3 in my videos, however, it just means I'm going to stick with AC-3 or use another solution for AVC/AAC.
Wait, are you encoding *to* AC-3, or just passing an AC-3 source through? If the former, I don't see why you'd encode to AC-3 instead of (LAME) MP3 when AC-3 is a more primitive codec, same generation as MP2. If it's for playback compatibility, I'd understand, but LAME MP3 is almost certainly going to beat AC3 at sub-200kbps bitrates.
Deleted User 13735

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by Deleted User 13735 »

Wait, are you encoding *to* AC-3, or just passing an AC-3 source through?
Wait, I didn't know that it was possible to encode to AC-3 in HandBrake. Would you kindly point me to this option?

Once again, I have a licensed Dolby Digital Professional AC-3 5.1 Encoder on my system, and that is what I use for most of my content creation. Would you suggest I be using MP3 instead? (Oh, except that isn't part of the DVD or BD spec. Darn.) Or how about discrete 6-channel LPCM? Should I be using that instead :?:
I don't see why you'd encode to AC-3 instead of (LAME) MP3 when AC-3 is a more primitive codec, same generation as MP2.
"More primitive?" Would you kindly point me to your source of information? If that is true, why hasn't MP3 Surround simply taken the entertainment world over by storm? (It came out around the same time as AC-3). Have you ever seen MP3 audio on a video DVD or BD? Or FLV2/MP4 or iTunes m4v/m4a for that matter? Or HDV or AVCHD footage? Did you ever wonder why not?
but LAME MP3 is almost certainly going to beat AC3 at sub-200kbps bitrates.
Again, I'd like to see your source of information. BTW, the stereo DVD default bitrate for AC-3 is 192Kbs, and 384Kbs for 5.1. Just between you and me, I can barely stand any compressed stereo audio below 192Kbs. But with the tiny, cheap multi-GB storage available this century, just why would anyone want to do this?

ONCE AGAIN, MP3 audio with MPEG-4 Part 10 video has never been embraced by any significant portion of the hard media, internet or portable entertainment delivery spectrum, nor do I have any compelling interest to pursue that as the course for the future. Just my own hangup, I guess . . .

But wait, instead of obsessing over MP3, why don't you and the OP just hook up and develop a better open source AAC solution for HandBrake? Since H264/AAC is the soft delivery method of choice at this point it history, I'm sure it would be welcomed by all.
creamyhorror
Enlightened
Posts: 134
Joined: Mon Jan 04, 2010 2:00 pm

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by creamyhorror »

musicvid wrote:Wait, I didn't know that it was possible to encode to AC-3 in HandBrake. Would you kindly point me to this option?
I wasn't talking about using Handbrake. You can encode to AC-3 in MeGUI and probably other GUIs.
Would you suggest I be using MP3 instead? (Oh, except that isn't part of the DVD or BD spec. Darn.) Or how about discrete 6-channel LPCM?
I know you're being facetious, but clearly I wouldn't be recommending MP3 for anything other than stereo streams in formats like AVI and MKV.
I don't see why you'd encode to AC-3 instead of (LAME) MP3 when AC-3 is a more primitive codec, same generation as MP2.
"More primitive?" Would you kindly point me to your source of information? If that is true, why hasn't MP3 Surround simply taken the entertainment world over by storm? (It came out around the same time as AC-3). Have you ever seen MP3 audio on a video DVD or BD? Or FLV2/MP4 or iTunes m4v/m4a for that matter? Or HDV or AVCHD footage? Did you ever wonder why not?[/quote]
What makes you assume MP3 would automatically displace an older standard? They're not even intended for the same purposes! I'm interested in actual technical information and argument. IIRC I've seen tests where LAME MP3 has performed close to mid-level AAC encoders, so I certainly think it's only a step or two behind AAC/Vorbis. I've also seen comments saying that AC-3 is an older generation codec, but on checking I'll retract that and just link a discussion that has a few relevant points.

Here's a link concerning the relative performance of AAC, MP3 and other codecs on classical music, where LAME performs very well against AAC. It's one guy doing the tests, and it's from 2005, but it's illustrative of how tuned LAME is, such that it can keep up with AAC in some areas. I couldn't even find anyone testing AC3 against MP3 and AAC.
but LAME MP3 is almost certainly going to beat AC3 at sub-200kbps bitrates.
Again, I'd like to see your source of information. BTW, the stereo DVD default bitrate for AC-3 is 192Kbs, and 384Kbs for 5.1. Just between you and me, I can barely stand any compressed stereo audio below 192Kbs. But with the tiny, cheap multi-GB storage available this century, just why would anyone want to do this?
At 192kbps and above, the audible difference gets eroded, so the question of codec efficiency simply becomes less important. But a better encoder is a better encoder - hence I encode my music to LAME MP3 rather than AC-3. If I can achieve transparency at 192kbps with one encoder and only at 256kbps with another, I'd use the first (assuming both are playable on my device).
ONCE AGAIN, MP3 audio with MPEG-4 Part 10 video has never been embraced by any significant portion of the hard media, internet or portable entertainment delivery spectrum, nor do I have any compelling interest to pursue that as the course for the future. Just my own hangup, I guess . . .
Fair enough, assuming you're looking to distribute in MP4 format. But MP3 was the standard with MPEG-4 Part 2 video, which wasn't very long ago. Anyway, I use MKV and play back on computers and modern standalones, so I don't have any problem using any codec. If Vorbis were still competitive I'd probably use that.
But wait, instead of obsessing over MP3, why don't you and the OP just hook up and develop a better open source AAC solution for HandBrake? Since H264/AAC is the soft delivery method of choice at this point it history, I'm sure it would be welcomed by all.
I just use Nero AAC in my MKVs, which usually beats the rest. I was correcting your implication that AC3 is better than MP3, when this hasn't been proven at all (and in the case of LAME, AC3 is probably going to be worse). Remember that your original comment in the thread was basically that "MP3 sucks for everything", but that's clearly not the case. Whether encoding to MP3 fits your purposes (whatever they are) is another matter altogether. For HB users, for example, having the option of LAME MP3 streams is certainly better than having FAAC alone.

edit: In addition, I specifically said that MP3 is a better choice to encode to than AC3 if playback compatibility was not an issue - and it obviously is for you.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by jbrjake »

Why isn't LAME VBR available in HandBrake?

Because you guys all seem to be so much more interested in talking about it than actually implementing it in code.

As mduell already said, we eagerly await your patch.
Deleted User 13735

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by Deleted User 13735 »

I wasn't talking about using Handbrake. You can encode to AC-3 in MeGUI and probably other GUIs.
But this is the HandBrake forum. And a discussion about that project. Why are you now telling me it's about something else?
I wouldn't be recommending MP3 for anything other than stereo streams in formats like AVI and MKV.
AVI doesn't commonly support VBR audio, afaik. MKV is a wrapper that is gaining popularity for storage, but as a delivery format well . . ., the jury's still out on that one. But if what you're asking for is Lame with MKV in Handbrake (ostensibly with ffmpeg MP4 video, right?), I support that. That's not been the focus of any of my posts, however.
What makes you assume MP3 would automatically displace an older standard?
That's not an assumption I made, but one that would need to be prerequisite to support your assertions. Apparently, MP3 appeared about a year before the first DD encoded movie was released, so loaded language like "older standard" and "more primitive" are just simply untrue.
I'm interested in actual technical information and argument.
So you're a hobbyist concerned with theoretical advantages, and not any practical delivery or playability considerations. I support your experiments entirely, but it nails down the reason why we are on completely different planets. Here's something for you to think about though: What advantage is there to transcoding from one lossy audio format to another lossy audio format unless absolutely necessary, when no one disagrees that doing so degrades audio quality. As inferred early on in my last post, are you really suggesting we all start with LPCM as a production format and then convert to MP3? That's the only way what you're advocating makes any sense. If it can't be delivered to or played by most people, what's the point?
Fair enough, assuming you're looking to distribute in MP4 format.
But that's exactly what HandBrake does, and was designed to do. And it's why I use it!
But MP3 was the standard with MPEG-4 Part 2 video, which wasn't very long ago.
No, it was part of the standard, along with PCM, MP2, AAC, and a host of others. So if what you really want to do is mux ffmpeg MP4 video with MP3 audio in Handbrake, then which one of us is promoting an "older, more primitive standard?" Part 10 doesn't specify or license audio standards (at the request of the industry), so we have to go with the flow of implementation standards and current practices, or else swim upstream, which I completely support your right to do.
Remember that your original comment in the thread was basically that "MP3 sucks for everything", but that's clearly not the case.
No, you've taken me out of context again. I made my comment in the context of a video forum in a video discussion in comparison to other audio-for-video formats. I also said that I have used Lame to back up hundreds of hours of my live recordings. So, if the quality in that context wasn't acceptable to me, why has it been my audio archiving and delivery choice for so many years? As you so clearly stated, "They're not even intended for the same purposes!" But you don't seem to want to acknowledge that fact in the context of this forum or discussion, which is about video, so I suspect you are really promoting another agenda.
Personally I generally use the original AC-3 track.
Now there's your original comment taken in context that seems to contradict much of what you've said since. Also, you linked to a 5 year old discussion with divergent opinions, and absolutely no quantitative support. Your other link, also five years old, quotes a listening test that doesn't even include AC-3, and puts Lame right down there with faac most of the time. So you reference the two formats interchangeably, depending on what you can find posted in other internet forums. Makes me think you're just gaming and not serious about any of this.
I couldn't even find anyone testing AC3 against MP3 and AAC.
Why do you think that is? Maybe the same reason AC-3 and LPCM is the AVCHD and Blu-Ray mandate and MP3 isn't even allowed? But if even you came to me and said, "I have proof that AC-3 stereo is clearly superior to Lame MP3 at all bitrates," do you think I would start using it tomorrow as my audio-only format of choice, either for archiving or delivery? I think you know what my answer would be, and that clearly establishes the differences in our thinking and motivation.
hence I encode my music to LAME MP3 rather than AC-3. If I can achieve transparency at 192kbps with one encoder and only at 256kbps with another, I'd use the first (assuming both are playable on my device).
Me too. But the implied converse of your statement is that if AC-3 won a listening test you would use it for your audio. Pretty much establishes where we are at with this. Go ahead and play with it, but anyone would look silly trying to use it for delivery and expect others to embrace it. BTW, I would like to see the data on the comparison you just mentioned, although the hydrogenaudio notion of "transparency" has never been quantified in redundant laboratory testing afaik.
Whether encoding to MP3 fits your purposes (whatever they are) is another matter altogether. For HB users, for example, having the option of LAME MP3 streams is certainly better than having FAAC alone.
No, in the real context of this discussion, it's the only matter to me. And please don't speak for "HB users," because just maybe one or two of us is interested in delivering our material to others, with the presumption that they will be able to play it back conveniently (that's allowed under the EULA, isn't it?). So not everyone is interested in using Handbrake just as a personal hobby. That being the case, I have already acquiesced that a better AAC solution in Handbrake is a viable one. That in no way detracts from the notion of Lame support in Handbrake, except that I would use the former a lot, and the latter hardly at all, and I suspect a few others might just agree with that. Unfortunately, since I can't code on that level, I can't put my "money where my mouth is," and the lack of responses to mduell's and jrbrake's challenges indicate that I am not alone in that respect.
edit: In addition, I specifically said that MP3 is a better choice to encode to than AC3 if playback compatibility was not an issue - and it obviously is for you.
Aah, you're finally beginning to understand what's important to me; and likewise I'm beginning to understand what's important to you (your superiority arguments notwithstanding)!

I'm going to check out on this discussion for now. I'm starting rehearsals on a new musical show this weekend, and yet I can assure you we won't be using mp3 audio to produce the video (and we won't be using AC-3 to deliver the audio, either). If there is anyone here who can't accept the fundamental logic that decision presents, then my part in this discussion has been a total waste of my time, save for the personal revelations about faac.

[Note: this post was last edited at 1:40 pm CST. Just mentioning that in case anyone is overposting.}
TimmyC
Posts: 13
Joined: Sun Jan 31, 2010 7:30 pm

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by TimmyC »

There are lots of reasons why format specifications include or don't include things. One of these reasons is quality. Others include business and patent politics, and of course timing.
So "mp3 isn't included in DVD-video" is not, by itself, a valid point about the audio quality of the format.

And while mp3 is formally included in the MPEG-4 spec, it hasn't been supported in major commercial implementations (read: Apple), presumably because AAC is presumed to be the future. That is understandable as well, but it doesn't mean that AAC is (at the moment) much better than mp3.

My guess is politics and business had more to do with mp3 being excluded from blue-ray spec (if I read you right) than audio quality issues. My best guess is AC3 is included for "legacy" reasons - it could just be that lots of blue-ray discs will include better picture but the original already-encoded AC3 audio.

Anyway, this doesn't mean that mp3 is worse than AC3.

This discussion has gotten me interested in where AC3 actually compares to other lossy codecs. It hasn't shown up in listening tests that I can find, either because people don't take it seriously, or because the only optimized encoders are dolby-licensed and very expensive to purchase. I've posted about this at Hydrogen Audio and hope to figure this out a lot more by tomorrow.

I suspect that the majority of people fail blind-tests on mp3 much more easily than they would with AC3. Which is to say, the odds are VERY high that they would be able to tell the difference between an original wav file and an AC3 file encoded from that wav file, more consistently than they would be able to tell the difference between the original wav file and an mp3 file encoded from that wav file. (here I am presuming the best available mp3 and AC3 encoders, and similar bitrates for the mp3 and AC3 file, and presuming that you don't know when you're comparing AC3 to wav vs. comparing mp3 to wav, in order to screen out expectation bias toward one codec)

As a side-note, "transparency" isn't meant to be quantified, beyond in-general statistics. Transparency is specific to a given user, on given audio samples - a codec is transparent at a given bitrate if the listener can't tell the difference. A codec is judged as better than another if, at similar bitrates, it is transparent to more people on more samples.
Sound system quality actually isn't a big part of this picture - the sort of artifacts that "golden ears" can identify from audio codecs usually don't depend on hi-fi audio reproduction systems.

Most of my friends who say they "can't stand mp3" and even make more specific statements (e.g., "I can barely stand any compressed stereo audio below 192Kbs") can't tell NEARLY the difference that they think they can, when I subject them to blind testing. Maybe you can tell the diff. It's just that most people can't tell the difference nearly as easily as they expect to be able to.


BUT enough on mp3 - I understand that playback compatibility is an issue. The Matroska format is apparently a better video format than anything else out there, in terms of supporting audio codecs, a variety of subtitle strutures, etc. But that doesn't mean it's going to take over. The muscle of the Motion Picture Experts Group is obviously behind MPEG-4, and of course so is Apple's muscle as well. (of course there are values to a less-flexible format as well - it's easier to ensure that a player can handle anything in an mp4 movie, than to ensure that it can handle anything in a Matroska movie (which allows a wider range of video and audio streams).
And given that most people will therefore encode to MPEG-4 video, the mp3 discussion is mostly moot.


the point that jbrjake raises about "who's gonna code it" is valid. one answer is "not me" - I'm not a coder. In some cases (including this one) I wish I were. But I'm not. I started with two questions:
I'm curious why Handbrake only offers mp3 audio option when using Matroska container output, and also why only Constant Bit Rate mp3
My first question was answered readily - Apple and therefore most others haven't supported mp3-audio in MPEG-4 video
My second question about mp3 vbr, and a third that spins off the first, about better-quality AAC, are the things remaining to be figured out.

I still don't know the decisions on the part of Handbrake coders, as to WHY VBR mp3 isn't included, and WHY only FAAC encoder is used for AAC audio. Before saying "well go write your patch" (even if I were a coder), it's worth knowing whether there are some reasons these aren't included. It could be as simple as "we used CBR mp3 because some older AVI players had trouble with vbr, and just haven't gotten around to changing it yet since we've been focused more on improving other parts of the software." Totally viable answer. etc. So, that's the sort of information that I'm looking for.

Of course, given MPEG-4 as the dominant video standard, to which most HB users will be encoding, the AAC encoder issue is more pressing.
I asked some pretty specific questions (under heading 4 in my OP) about ways of getting better AAC audio encoding in Handbrake. If I were a coder, these are things that I would want to know the answers to, before doing any coding. But they haven't been answered here yet.
nightstrm
Veteran User
Posts: 1887
Joined: Fri Mar 23, 2007 5:43 am

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by nightstrm »

I still don't know the decisions on the part of Handbrake coders, as to WHY VBR mp3 isn't included, and WHY only FAAC encoder is used for AAC audio.
I can answer that one... there isn't another open source, cross platform solution available at the moment. There was quite a lengthy discussion to add CoreAudio to the Mac builds since it isn't available on the other platforms, but it was finally included since it is a core (pun) part of the operating system, is always accessible, and provides substantially better quality than FAAC. In the end, it took a developer with an interest writing the code and championing its inclusion in the project.

I heard rumblings of someone picking up where the FAAC team stopped, but that was awhile ago (admittedly I haven't been paying too much attention).
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by jbrjake »

TimmyC wrote: the point that jbrjake raises about "who's gonna code it" is valid.
<snip>
I still don't know the decisions on the part of Handbrake coders, as to WHY VBR mp3 isn't included
Um. I already told you, as you clearly already read.

It isn't present because you haven't coded it yet.

It's an open source project. Things get implemented because people want to implement them and have the time to do so. Asking "why" something isn't present is nonsensical--as if someone has to go through extra effort to *not* implement functionality.

You're also taking a bunch of things as gospel and I don't know where you're getting them from. AVI support for VBR and player support for MP3 in MP4 are neither here nor there. The only reason VBR isn't present, the only reason why MP3 in MP4 isn't present, is that none of you guys seem to be interested in giving us patches that provide them, just posting extended diatribes measuring the penile lengths of various encoding engines and rate control methods.
Deleted User 13735

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by Deleted User 13735 »

Thanks, nightsrm,
I have one lingering question that got lost in the tempest, one that I hope you can answer. Would there be any practicality in being able to "pass through" an existing AAC stream in Handbrake, such as is done with AC-3? The advantage of not re-encoding a lossy format is the main reason.

@ TimmyC,
Although I might not agree with everything you said in your last post, your thinking is reasonable and you support it with facts. One thing I might add to your first comment, "So 'mp3 isn't included in DVD-video' is not, by itself, a valid point about the audio quality of the format," is that DVD, AVCHD, and BD would have never made it to the market without 5.1, because they are movie-centric video acquisition and delivery formats. MP3 Surround arrived a bit late to be considered, in fact it has only been recently included in DivX, so it will be interesting to see how it plays out.
TimmyC
Posts: 13
Joined: Sun Jan 31, 2010 7:30 pm

Re: possible to get Lame (ideally VBR) audio, and for mp4 too?

Post by TimmyC »

@nightstrm - thanks for the useful reply on the ACC front. "Good for them" (particularly the developer, but also other decision-makers for being open to a platform-specific solution since an across-the-board isn't yet available) for the inclusion of CoreAudio.

@musicvid - AAC passthru would certainly be useful for DVDs that already have AAC audio. Any step of encoding via lossy process adds a step of quality-diminishment, whether it is noticeable or not. A very useful thing if I wanted to shrink down a video down for an iPod screen or whatnot, without necessarily having to transcode the audio.
(I assume, here, you're talking about transcoding from one video to another, rather than from DVD - it's my understanding that AAC is not included in the spec for DVD-video, nor for Blu-Ray)

On the quality of AC3 audio. I started a thread at Hydrogen Audio precisely about this, because I don't really know, and there had been precious little discussion about it either (at least based on searching "AC3" in thread titles at HA). Here is the thread:
http://www.hydrogenaudio.org/forums/ind ... opic=78815

And here are some take-away points:
- mp3 is excluded from Blu-Ray and DVD-video because it doesn't have native multichannel support, as musicvid has similarly noted here
- mp3 was developed before AC3, and AC3 is more technically similar to AAC but has similar block-size limitations to mp3.
- AC3 was included in the blue-ray spec not because of quality, but because "every multichannel receiver on earth supports it." compatibility with existing hardware was necessary for blu-ray to beat HD-DVD in the format war.
- actual listening tests including AC3 are rarely available for two reasons: first, the cost of the encoders, or security dangers posed by downloading cracked versions. and secondly, because many encoders (not the format itself, but most available encoders) support only 5.1 audio, whereas killer audio samples used to tune audio codecs are almost always stereo.
- when AC3 is tested, it does very poorly. Even at very high bitrates, compared to typically-used audio codecs
- while blu-ray includes AC3 audio, many (most?) blu-ray discs also include lossless audio tracks as well, and are easily-enough able to do so because of the higher disc capacity.

@jbrjake - I thought my questions were still reasonable. I guess to make what I was asking more clear, I wondered whether there were reasons other than "nobody's coded it yet." My mentioning of the things you call "neither here nor there" (e.g., AVI's reputation for having trouble with VBR mp3 audio) was simply my trying to put out some hypotheses for why things hadn't been included.
Apart from the coding aspects, compatibility and quality of various encoding formats are important. Presumably, quality has a whole lot to do with why h264 video is the norm for HB encoding nowadays.
I do understand that open-source projects like HB are coded in people's free time, and as such developers are not beholden to user base. If you consider anything along the lines of feature requests, or interest about the quality of various encoders, to be "diatribes about penile length" you might consider formally restricting this "general" forum to developers only.
Post Reply