possible to get Lame (ideally VBR) audio, and for mp4 too?
Posted: Wed Feb 10, 2010 4:46 am
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.
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.