Most active commenters
  • daneel_w(7)
  • anthk(4)
  • seec(3)

←back to thread

837 points yen223 | 21 comments | | HN request time: 0.378s | source | bottom
Show context
daneel_w ◴[] No.42064988[source]
A couple more:

    afconvert(1) - an audio file format converter, which includes Apple's superior AAC codec from the Core Audio framework

    diskutil(8) - tons of tools for fixed and removable storage
Examples:

    afconvert in.wav -o out.m4a -q 127 -s 2 -b 160000 -f m4af -d 'aac '

    mb=300; diskutil eraseVolume APFS myramdisk `hdiutil attach -nomount ram://$((mb*2048))`
replies(6): >>42065488 #>>42066466 #>>42068656 #>>42068717 #>>42075363 #>>42076594 #
1. hk1337 ◴[] No.42066466[source]
How does that compare with ffmpeg? The arguments seem about the same.
replies(2): >>42067194 #>>42067397 #
2. krackers ◴[] No.42067194[source]
afcovert uses the superior inbuilt AAC converter. FFmpeg can do this as well with the right arguments but you have to dig them up and the quality is capped to a lower value than you can get with afconvert.
replies(2): >>42068952 #>>42084868 #
3. daneel_w ◴[] No.42067397[source]
ffmpeg offers a few different encoders for many of its supported audio/video formats, and the result depends on what encoder you tell ffmpeg to use. It does not have support for using Core Audio on macOS but it does offer FDK AAC, which is one of the better AAC encoders available today - though not nearly as good as the one available in Core Audio.
replies(2): >>42068737 #>>42071269 #
4. seec ◴[] No.42068737[source]
Do you have any sources/informations on an objective comparison of encoders quality ?

Way back then (iPod era), I made an exposé for a science exam (small paper), proving that AAC was indeed better than MP3 both subjectively and objectively at most bitrates. This is how I got introduced to Fourier transforms and the likes; it was very interesting to see that you can literally "see" the difference in quality on the encoded waveform output.

But I just used the default encoders on the Mac and I didn't think about going in deep into encoder comparisons at the time. Does it matter that much? From what I know, it just about properly programming a math spec, with some tricks but I wonder if that makes that much of a difference.

In any case, above 256kbps it takes a very skilled listener to correctly identify encoded music. Apple has some useful tools for that, particularly AU Lab that allows you A/B testing of tracks with on-the-fly encoding. https://www.apple.com/apple-music/apple-digital-masters/

replies(3): >>42068962 #>>42069362 #>>42071109 #
5. anthk ◴[] No.42068952[source]
There's no reason to use AAC when we have both OPUS and FLAC.
replies(2): >>42069139 #>>42080737 #
6. anthk ◴[] No.42068962{3}[source]
Today OPUS is on par of AAC if not better. We aren't at the MP3/OGG times.
replies(1): >>42069375 #
7. daneel_w ◴[] No.42069139{3}[source]
I have three reasons: when using a good encoder (Core Audio, FDK or Nero) it's a quality-wise better lossy format than MP3, it's smaller than FLAC which matters for storage footprint, and unlike Opus and FLAC it's supported pretty much everywhere. At some point Opus will reach the same level of adoption and that's the point where I'll make the switch from AAC, because Opus is evidently a better lossy encoder per same bitrate.
replies(2): >>42077456 #>>42080774 #
8. daneel_w ◴[] No.42069362{3}[source]
One source would be the Hydrogen Audio forums where there are regular scientific comparisons - PSNR etc. instead of blind listening tests - between various encoders and formats. Apple's AAC encoder consistently comes out well above anything MP3, best of all the AAC encoders, and up at the absolute top together with Opus which produces a bit better results per same bitrate.

> Does it matter that much? From what I know, it just about properly programming a math spec, with some tricks but I wonder if that makes that much of a difference.

It does matter a lot and the difference can be staggering. Producing the audio bitstream is a case of both effectively analyzing the original input and programmatically expressing the waveform as correctly and as efficiently possible. Two excellent examples: the old MP3 encoder Xing, which compared to LAME produces very poor material even at higher bitrates, and one of the earliest open-source AAC encoders, FAAC, which also renders a very poor product. A lot of "early adopters" got bitten by FAAC and many of them still stubbornly cling to the misunderstanding that AAC is a worse format than MP3.

replies(1): >>42072831 #
9. daneel_w ◴[] No.42069375{4}[source]
Opus is better at same bitrate - not by much, but all the same it has the upper hand.
replies(1): >>42077460 #
10. meindnoch ◴[] No.42071109{3}[source]
>From what I know, it just about properly programming a math spec

Incorrect. The specification only concerns the bitstream and the decoding. Encoders are free to do whatever they want, as long as they produce a valid bitstream.

replies(1): >>42072675 #
11. satellitemx ◴[] No.42071269[source]
It does. -c:a aac_at uses Core Audio (_at means AudioToolbox).
12. seec ◴[] No.42072675{4}[source]
That makes sense.

Of course, the implementations are going to have varying performance depending on code quality/optimisations but that's a given.

Edit: some other poster gave some cues to my question. I guess you can do some trickery by decomposing the waveform before encoding and recomposing it.

I'll read more on the specs.

replies(1): >>42074780 #
13. seec ◴[] No.42072831{4}[source]
OK I get it. Isn't all that because it is rather hard to correctly implement such math trickery? Since it's not just about manipulating bits, you need to have a pretty good background in physics to do it properly. The more you know about the physics of sound the cleverer you can be about what to discard and what to keep.

I have used Macs since my youth and used iTunes before it was even called that, so encoder quality was never a problem I had. I guess I'll revisit the topic more deeply one of these days, still not that keen on that much math though.

14. meindnoch ◴[] No.42074780{5}[source]
It all boils down to the psychoacoustic model in the encoder. It determines how the bitrate is allocated to various parts of the spectrum, depending on the audio signal.
15. anthk ◴[] No.42077456{4}[source]
Opus is today in every smartphone. MP3's died. No one cares about AAC.

You are using Opus on most VoIP/call providers.

Meanwhile, AAC, MP3, OGG... are history today.

replies(1): >>42079172 #
16. anthk ◴[] No.42077460{5}[source]
>not by much

You are deluded, then. Or deaf. Most MP3 podcasts at 128 KBPS sound worse than an OPUS file @64.

replies(1): >>42079125 #
17. daneel_w ◴[] No.42079125{6}[source]
I'm neither deaf nor deluded. You're not reading me correctly. I'm saying that Opus is better than AAC, but not by much. Compared to MP3 it's a lot better.
18. daneel_w ◴[] No.42079172{5}[source]
> You are using Opus on most VoIP/call providers.

No. Opus support in the PSTN is still unfortunately almost non-existent. Adoption is growing but the pace is very slow. Source: me, working in the European telecommunications industry for over a decade, specializing in telephony and SMS.

19. ok_computer ◴[] No.42080737{3}[source]
I like to load WAVs on my iphone if lossless uncompressed available. AAC is the next highest quality supported lossy compression file in apple music app. From my understanding they won’t ever go to flac or opus because don’t want software decompression.

I like opus on VLC for youtube-dl rips but if I’m buying music I want lossless uncompressed.

20. ok_computer ◴[] No.42080774{4}[source]
It’s nuts using youtube-dl and unwrapping to get the opus files are like 96kbs and sound good. 96kbs mp3 would need to mix to mono and still sound like gravel.
21. synthoidzeta ◴[] No.42084868[source]
Isn't -c:a aac_at the same? And then designate bitrate?