-
Notifications
You must be signed in to change notification settings - Fork 80
Allow for AAC he-audio encoding, configurable bitrates #48
Conversation
Update to allow AAC, in addition to opus codec, to be used in --he-audio mode. Adds a new --he-audio-format parameter and --he-audio-bitrate parameter to specifify the bitrate per channel of audio in the stream. The old --downmix-he-audio parameter is removed and replaced by --he-audio-format prologic. Default bitrate set at 64kbps/channel. Link to the FFmpeg wiki explaing the default included in code comment.
I've used he aac profile 2 before and opus provides superior quality at the same bitrate. |
It does, however, it does not have as robust support among devices, meaning that, for example, if you're using Plex, the server has to transcode the track. Note this commit does not change the default -- it's still opus, it just adds the aac support. |
Neither does h265, but I'm not going to add an option to use x264. I believe this utility should only provide the best, users should already be aware that h265ize does not target compatibility. On another note @bdaroz, I think I'm going to to merge |
Fair enough, but keep in mind tests pulled off Also, if you want to look at those flags, check #46 as well. |
The documentation actually refers to per 2 channels. But even that is wrong, in the code it's set to 64kbps per 2 channels. That's why your seeing 32kbps/channel. I will make an issue to update the documentation. I set it at 32k because I personally don't notice any difference, but I am by no means an audiophile. BTW, can you provide me a link to the recommendation of 64kbps/channel. |
Here's the link: Also note the chart at the top of this Opus page: |
Interesting, but I suppose bitrate is really just subjective. Do you notice any degredation in audio quality when using
|
I think I might bring the bitrate up to 40k/channel just so it falls under fullband, |
Because all the gear I have hooked up to audio equipment that's not crap (eg computer headphones) can't decode opus I have no way of telling. (Which is why I added this option in the PR to start with -- I'd have to transcode back to aac or something else in real time anyway.) That said, because any loss of quality would need the source material to correct (and if people are replacing existing h264/ac3 or h264/dts, would need to reacquire it) I would err on the slightly larger, but known quality side. I picked 64k/channel because all the comparisons and listening tests used that bitrate, but nothing I could see went lower. One last thought... Looking at the quality graph on the page I linked, if you're coming from 64k/channel ac3, going to anything less than at least 48k/channel opus would be a drop in quality. Worse still DTS (or DTS-MA) to opus at 40k could be a significant drop (at least with a significant bitrate improvement). Either way, hard to hard to argue it's the "best" when you're reencoding to an audio quality loss for a small gain at best. (If my math is right 64k/channel ac3 -> 40k/channel opus is a 24kbps/channel savings, over 6 channels 144kbps, or 18KB/s or about 64MB/hr. If there is a perceptible loss, is the paltry space improvement worth it?) |
You bring up a good point about no research material going below 64k. As to why I feel it's worth the 64MB/hr, I only use he audio on half hour episodes where I target 130-180MB. So that's why it's worth it for me personally. I already didn't notice any degradation when it came to 32k so I feel people such as myself with little audio experience wouldn't mind the 40k bitrate. |
Understood, my use case is more for archival purposes (think inactive or not often accessed) with shows that are no longer on the air. I don't need dts audio there anymore, but while I think h265 decoder support will be more and more likely in future devices, I'm not as optimistic for opus, hence why I go aac. In that case the drop from 1500kbps to 384kbps is already dramatic, another 160kbps or so isn't really going to make as much an impact in space savings. |
I know it has been a while, but I'd love to chime in to voice my support for AAC just for compatibility reasons. |
I will reconsider this since more people have shown interest. In the mean time, I do believe @bdaroz's fork has AAC support. |
Update to allow AAC, in addition to opus codec, to be used in
--he-audio
mode. Adds a new--he-audio-format
parameter and--he-audio-bitrate
parameter to specify the bitrate per channel of audio in the stream. The old--downmix-he-audio
parameter is removed and replaced by--he-audio-format prologic
.Default bitrate set at 64kbps/channel. Link to the FFmpeg wiki explaining the default included in code comment.