IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
iTunes 4 and VBR AAC encoding, vbr settings question
blessingx
post Apr 29 2003, 06:19
Post #1





Group: Members
Posts: 256
Joined: 22-April 03
From: just west of san fran
Member No.: 6131



AAC codec builds upon state-of-the art signal processing technology from Dolby Laboratories and brings true variable bit rate (VBR) audio encoding to QuickTime.

The encoding settings in iTunes doesn't list VBR options. Now if all AAC encoding rates are VBR (are they?) what do the bitrates mean? Guaranteed minimums? Rough middle ground? Never quite understood previous iTunes mp3 VBR settings either. Unlike LAME encoding which made much more sense (and was documented). Anyone have any ideas about the mp4 settings?
Go to the top of the page
+Quote Post
hans-jürgen
post Apr 30 2003, 08:13
Post #2





Group: Members
Posts: 573
Joined: 2-August 02
From: Hamburg, Germany
Member No.: 2898



QUOTE (blessingx @ Apr 29 2003 - 07:19 AM)
AAC codec builds upon state-of-the art signal processing technology from Dolby Laboratories and brings true variable bit rate (VBR) audio encoding to QuickTime.

The encoding settings in iTunes doesn't list VBR options.

QuickTime is not the same as iTunes... wink.gif

QUOTE
Now if all AAC encoding rates are VBR (are they?) what do the bitrates mean? Guaranteed minimums? Rough middle ground? Never quite understood previous iTunes mp3 VBR settings either. Unlike LAME encoding which made much more sense (and was documented). Anyone have any ideas about the mp4 settings?


It's a bit difficult to clear up what Apple means and knows or wants to tell about CBR and VBR and/or ABR in their applications. To start from the top: the MP4 container that is used in QuickTime 6 Pro understands VBR. This is documented in a comprehensive paper about the new features of QuickTime 6. This may be the reason why you often find statements that QuickTime uses VBR for AAC encodings. As far as I know, the Dolby AAC codec inside QT does not use VBR, but rather CBR with its usual bit reservoir, so there is a small headroom for variations of the bitrate. Maybe you should test it yourself with two different WAVs/AIFFs that you know are completely opposite in sound and resulting bitrates. If you get almost the same file size afterwards, QT 6 uses CBR.

What they've decided to do in iTunes4 now isn't clear yet, but probably they use the same Dolby codec. The resulting *.m4a file is a simple MPEG-4 AAC LC file, by the way (thanks, Menno), so you can just rename them to *.mp4 and look for the header infos with an appropriate player (Winamp or foobar2000). Keep in mind that these might not be the truth, though... wink.gif

This post has been edited by hans-jürgen: Apr 30 2003, 08:29


--------------------
myspace.com/bluezzbastardzz
myspace.com/indigorocks
Go to the top of the page
+Quote Post
blessingx
post Apr 30 2003, 22:29
Post #3





Group: Members
Posts: 256
Joined: 22-April 03
From: just west of san fran
Member No.: 6131



QUOTE (hans-jürgen @ Apr 29 2003 - 11:13 PM)
Maybe you should test it yourself with two different WAVs/AIFFs that you know are completely opposite in sound and resulting bitrates. If you get almost the same file size afterwards, QT 6 uses CBR.

Okay. I tested the following-

Velvet Underground's Beginning To See The Light, off of the 1969 Live Album Vol1. Time- 5:32:??
Chet Baker's Moon & Sand, off Let's Get Lost soundtrack. Time- 5:32:??

Encoded at 224kps aac in iTunes 4. Guess it's CBR. Files sizes are almost exactly the same.

Light- 9,382,960 bytes
Sand- 9,386,822 bytes.
Go to the top of the page
+Quote Post
blessingx
post May 1 2003, 00:55
Post #4





Group: Members
Posts: 256
Joined: 22-April 03
From: just west of san fran
Member No.: 6131



Another test for this whole VBR question. I just recorded 5:32 of silence to a wav/aiff, burned to a CD-RW, then encoded to 224 kps mp4. Byte count is 9,382,203, nearly identical to both earlier tracks.
Go to the top of the page
+Quote Post
hans-jürgen
post May 1 2003, 08:13
Post #5





Group: Members
Posts: 573
Joined: 2-August 02
From: Hamburg, Germany
Member No.: 2898



QUOTE (blessingx @ May 1 2003 - 01:55 AM)
Another test for this whole VBR question. I just recorded 5:32 of silence to a wav/aiff, burned to a CD-RW, then encoded to 224 kps mp4. Byte count is 9,382,203, nearly identical to both earlier tracks.

Thanks for testing, so now we know it for sure... smile.gif By the way, I read today on the 3ivx forum that there has been a huge increase in encoding speed from QuickTime 6.1 to 6.2 (not available for Windows at the moment) which probably uses the same codec as iTunes4 now. This could be another reason for the reported sound problems on the Apple forums with the downloaded Music Store files at 128 kbps.

Another interesting fact is that *.m4a files encoded with iTunes4 can be played back with the Windows Media Player using the freeware 3ivx DS filter with no further modifications, not even renaming them to *.mp4. See this thread:

http://forums.3ivx.com/cgi-bin/ikonboard/t...rum=15&topic=19


--------------------
myspace.com/bluezzbastardzz
myspace.com/indigorocks
Go to the top of the page
+Quote Post
brett
post May 1 2003, 08:21
Post #6





Group: Members
Posts: 35
Joined: 8-November 01
Member No.: 426



nice find hans -- thanks
Go to the top of the page
+Quote Post
ShootThemLater
post May 20 2003, 15:38
Post #7





Group: Members
Posts: 8
Joined: 18-May 03
Member No.: 6700



I did some testing myself, and files of the same length come out the same size. However, if you get the properties of the sound track in QuickTime, it says the files are variable bitrate. Is this some sort of average bitrate thing that just happens to come out to exactly the right size every time? That's a neat trick if it is.
Go to the top of the page
+Quote Post
Ivan Dimkovic
post May 20 2003, 16:54
Post #8


Nero MPEG4 developer


Group: Developer
Posts: 1466
Joined: 22-September 01
Member No.: 8



AAC is always variable bit rate with following rules:

1. Maximum number of bits per one frame is in range from 0 to 6144, multiplied by the number of channels

2. If encoder uses bit reservoir of exactly specified and defined size (by formulae in the standard), approx 10000 bits for 128 kbps, 44.1 kHz, Stereo - in that case, encoded stream is CBR and it follows the ISO 13818-7/14496-3 buffer guidelines.

3. If encoder uses bit reservoir of 0 bits (no bit reservoir), in that case files are perfect CBR and this is used only in LD (Low Delay) AAC to minimize pre-buffering delay when decoding of streamed content. Not recommended in any way except for the said application (two-way low delay communication)..

4. If encoder uses much bigger bit reservoir than one defined by the standard in that case it is ABR

5. If encoder does not care about bit reservoir and encodes only according to the psychoacoustic rules it is VBR


Usual methods are 2 and 5 and in some cases 4
Go to the top of the page
+Quote Post
ShootThemLater
post May 21 2003, 05:02
Post #9





Group: Members
Posts: 8
Joined: 18-May 03
Member No.: 6700



Thanks for the info. My understanding of audio codecs becomes less imperfect every day. So I'm guessing Apple's using option 2?
Go to the top of the page
+Quote Post
Ivan Dimkovic
post May 21 2003, 08:33
Post #10


Nero MPEG4 developer


Group: Developer
Posts: 1466
Joined: 22-September 01
Member No.: 8



Well, while I played with conversion of Dolby AAC files to MP4 format - I remember that it followed buffer guideliness, so it is option #2

I should check if for "VBR" (as they call it) they use bigger bit reservoir, but I am not sure.
Go to the top of the page
+Quote Post
neomoe
post Feb 24 2004, 13:06
Post #11





Group: Members
Posts: 302
Joined: 18-June 03
From: Europe/Germ./MA
Member No.: 7255



hi!

I've made some screenshots from foobar while itunes-encoded (192kbps) m4as were playing. the bitrate goes sometimes down to ~140 and sometimes up to ~270 kbps.

shot a:



shot b:



regards!

This post has been edited by neomoe: Feb 24 2004, 13:11


--------------------
[url="http://www.ergosum-apple.de"]www.ergosum-apple.de[/url]
Go to the top of the page
+Quote Post
XXX
post Apr 30 2004, 11:16
Post #12





Group: Banned
Posts: 32
Joined: 4-August 03
Member No.: 8154



While they will go up and down, all aac files I've seen do. But they do this at the start only; after a second or two they settle down to 128 or real close. Not quite a x-file.
Go to the top of the page
+Quote Post
neomoe
post Apr 30 2004, 13:24
Post #13





Group: Members
Posts: 302
Joined: 18-June 03
From: Europe/Germ./MA
Member No.: 7255



well, that's not true, i guess..
try it and you'll find that this happens during the whole file.


--------------------
[url="http://www.ergosum-apple.de"]www.ergosum-apple.de[/url]
Go to the top of the page
+Quote Post
Ivan Dimkovic
post Apr 30 2004, 14:26
Post #14


Nero MPEG4 developer


Group: Developer
Posts: 1466
Joined: 22-September 01
Member No.: 8



At 128 kb/s, 44.1 kHz, Stereo AAC by standard has bit reservoir of some 10000 bits, 1 stereo frame is somewhat near 3000 bits - so you can do your math: bit rate could fluctate in following way:

bit rate < 3000 --- bit reservoir is being filled
bit rate > 3000 --- bit reservoir is being drained
bit rate = 3000 --- bit reservoir stays intact (*)

(*) 3000 is not exact value, but I am too lazy to calculate it now smile.gif

Some engineers claim that this bit reservoir size is usually enough to handle music PE variations under normal circumstance (no worst case items, codec killers, etc...) - however this is matter of personal judgment under careful listening tests.

Nero AAC "CBR" uses same allocation - however with VBR, bit reservoir is just unlimited.
Go to the top of the page
+Quote Post
XXX
post May 1 2004, 21:25
Post #15





Group: Banned
Posts: 32
Joined: 4-August 03
Member No.: 8154



QUOTE (neomoe @ Apr 30 2004, 04:24 AM)
well, that's not true, i guess..
try it and you'll find that this happens during the whole file.

You don't sound too convinced. When I said first second, I meant first 10 seconds or so, obviously, which everyone should have known. I only know about iTunes music store files. Are there others? For example, Toxic has 2 frames under 64 kbps, 1 under 80, 2 under 112, 1000s under 128 kbps, 146 (frames) under 160, and 2 under 192 kbps. Those not right around 128 kbps happened within the first 10 seconds. The actual low was 11 kbps (you see a few of those at the very start) and the high was 189 kbps, but in the end ... waiting for it to end, out of

8565 frames

8411 were right around 128 kbps

and all that weren't happened in the first 10 seconds.

8535 frames used m/s (99%), and 886 (10%) used tns (hard to imagine since it's sooo LOUD, way over the limit). I used Toxic as an example. Please do not try this at home. I am a skilled daredevil and because I listened and survived does not mean you will.
Go to the top of the page
+Quote Post
neomoe
post May 2 2004, 10:42
Post #16





Group: Members
Posts: 302
Joined: 18-June 03
From: Europe/Germ./MA
Member No.: 7255



i'm actually very convinced!
but, i meant files, which i encoded on my own with iTunes 4.2.
proof it yourself.


--------------------
[url="http://www.ergosum-apple.de"]www.ergosum-apple.de[/url]
Go to the top of the page
+Quote Post
XXX
post May 2 2004, 13:16
Post #17





Group: Banned
Posts: 32
Joined: 4-August 03
Member No.: 8154



QUOTE (neomoe @ May 2 2004, 01:42 AM)
i'm actually very convinced!
but, i meant files, which i encoded on my own with iTunes 4.2.
proof it yourself.

For your pleasure, I have. Metallica has been encoded in 4.2 and I hear Lars complaining about me pirating already (who let him on here?). In the first FEW seconds, there were frames from 11 to 190 kbps, but after that it settled to 128. In the end there are ... wait. It's the same story as last time (tune's too long). If you think it only happens at 192, I could check but I don't use Aac at 192. (later) Since I am doing 192 I can tell you the results at 128 since it's done.

14282 frames

Of those
2 are under 64,
1 is under 80,...
2 under 112,
14154 around 128 (+/- 2 kbps),
120 (frames) under 160,
and 2 under 192.

Other ranges didn't apply.

The 192 is done encoding. Same story. Low is 29 and high is 298 kbps (actually measures, not mp4 box numbers).

1 under 64,
1 under 80,
1 around 128,
14108 frames at 192,
and 170 over 192.

All those not around 192 happened in the first few seconds.

This is iTunes 4.2.0.72. No "VBR" in the classic sense here.

... waiting for it to end so I can write the frames at 192...hold on. Done (14108 at 192, or 98.8 % of them).
Go to the top of the page
+Quote Post
neomoe
post May 2 2004, 18:49
Post #18





Group: Members
Posts: 302
Joined: 18-June 03
From: Europe/Germ./MA
Member No.: 7255



QUOTE
This is iTunes 4.2.0.72. No "VBR" in the classic sense here.


never said, iTunes produced VBR files..

but, ok, i'm convinced for now. i did not look that close to the files, just noticed a variation of the bitrate...
though the results are surprising. if ypu play those files back in foobar bitrate looks really very varying.. hrmm..


--------------------
[url="http://www.ergosum-apple.de"]www.ergosum-apple.de[/url]
Go to the top of the page
+Quote Post
buzzy
post Jun 7 2004, 14:07
Post #19





Group: Members
Posts: 203
Joined: 28-July 02
Member No.: 2836



It might be interesting to do this analysis on an encode of some tracks with more variation in the music than the 2 you picked; and using iTunes 4.5
Go to the top of the page
+Quote Post
Ivan Dimkovic
post Jun 7 2004, 14:18
Post #20


Nero MPEG4 developer


Group: Developer
Posts: 1466
Joined: 22-September 01
Member No.: 8



That method is doomed do fail - even in "CBR" mode, AAC allows free frame size, as long as you do not violate buffer requirements - so with particular signal you could have frames ranging anywhere between 4 and 512 kb/s

Best way to test is just encoding silence - if the file is still 128 kb/s with fill bits, it is using reservoir and not the "true" VBR in LAME/MPC/Ogg VBR sense.
Go to the top of the page
+Quote Post
buzzy
post Jun 7 2004, 14:29
Post #21





Group: Members
Posts: 203
Joined: 28-July 02
Member No.: 2836



Though I'm not sure the question is necessarily whether it's true VBR. A strong ABR implementation might do for most stuff.

Has anyone determined the size of the bit reservoir in 4.5? Searches don't turn up any answer.

Someone did do some tests on music with silence ...
http://www.hydrogenaudio.org/forums/index....showtopic=21814

This post has been edited by buzzy: Jun 7 2004, 14:30
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 30th August 2014 - 13:43