Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×
Google Businesses The Internet Media Music

Sneaking Past Heavy-Handed Audio Compression on YouTube 234

niceone writes "Recently YouTube seems to have started applying extreme compression to the audio of uploaded clips. This is the type of compressions used by radio stations to make everything louder, but in this case applied extremely badly. In quiet passages, breathing and shuffling become overpoweringly loud. A gently plucked guitar chord becomes a distorted thud. Listen to an example here. And here's what it could sound like — still not perfect, but a whole lot better. The fixed version is thanks to a workaround proposed by Sopranoguitar — the idea is to turn down the audio and mix in a high frequency sine wave (I used 19kHz). The sine wave fools YouTube's compressor into thinking that the file is at a uniform level (and does not need the volume changing at all) but is filtered out by the encoding process (so, no need to worry about deafening any dogs)."
This discussion has been archived. No new comments can be posted.

Sneaking Past Heavy-Handed Audio Compression on YouTube

Comments Filter:
  • Who's the mentally... challenged... individual who decided that applying such compression in the first place was a good idea, and then proceeded to implement or accept such a shitty implementation?

    • by saxoholic ( 992773 ) on Sunday July 27, 2008 @02:31PM (#24360403)
      Well, it starts with the "Loudness War" Record companies/radio stations compete to make everything louder, because the louder the music is coming over the air, the more likely the listener is to notice it. I don't see how that would help youtube though, because we're not listening to youtube in the background like we are to the radio.
      • Comment removed based on user account deletion
        • by billcopc ( 196330 ) <vrillco@yahoo.com> on Sunday July 27, 2008 @03:54PM (#24360999) Homepage

          Louder is one thing, compression is another.

          Compression can help bring out the faint natural harmonics in a sound, making it "warmer", not unlike an overdriven tube amp. These harmonics are like ear candy to most people, subliminally making the sound more enjoyable.

          Radio stations do it for various reasons, one is it helps them sustain peak output power. Another is that the average radio is a cheap chinese gadget that sounds like liquid ass, so the compression actually helps with the sound quality on those devices. When you also consider where radio is often heard, e.g. malls, outdoor venues, cube offices, you realize these are all substandard listening environments where high dynamic range really means you lose half the sound, so the compression again helps with perceived quality by driving most of the content above the noise threshold.

          There are plenty of good reasons for sound compression, but its use should be toggled by the user, and for the love of god, give it some sane thresholds! For most content, anything above 4x compression is overkill!

          • by eh2o ( 471262 ) on Sunday July 27, 2008 @05:29PM (#24361643)

            Compression can help bring out the faint natural harmonics in a sound

            Only a multiband compressor can do this, otherwise it just raises the level of all harmonics by the same amount.

            If the one on YT is fooled by a 19khz sinewave then its single band compressor.

            3:1 compression is usually considered the upper limit for practical purposes. Most people do prefer a small amount of compression.

          • by Anonymous Coward on Sunday July 27, 2008 @05:46PM (#24361769)

            WPLJ 95.5 in NYC knew this very well back in the 70's they' use massive audio compression to keep the modulation index of the carrier at 95.5%... That needle just say there!

            My station WDJF 107.9 Westport CT cared about audio quality. The MI followed the full amplitude of the source audio. Fed by 2 channels of full 15 khz equalized ma-bell-telco pairs. We sounded good! But PLJ was much much louder.

      • by mdmkolbe ( 944892 ) on Sunday July 27, 2008 @03:01PM (#24360657)

        I don't think YouTube is trying to run a loudness war, but rather trying to fix up a lot of amateurish recordings that are uploaded with bad audio. I can't tell you how many recordings on the net are either way to quiet (e.g. I can't hear speech even at max volume) or too loud and that change in mid-video (e.g. person walks away from or closer to mic). Despite their good intentions, though, it seems to have fallen prey to the "Clippy" effect.

        What YouTube needs to do is have a little check-box on uploads that indicates whether to apply the auto-balance. And in case an uploader asks for no auto-balance when they really shouldn't (e.g. they think they know but don't) there should be a side link to listen to the auto-balanced version.

      • by archeopterix ( 594938 ) on Sunday July 27, 2008 @04:05PM (#24361071) Journal
        This is just in. Studies have shown that on a popular site named Slashdot LOUD COMMENTS ARE MODERATED BETTER THAN QUIET ONES!!!
    • Re: (Score:3, Insightful)

      youtube is a huge money sink. They probably can't afford to hire people that have experience in audio compression, test different algorithms, etc. As to why... video and sound quality varies a lot, so they probably are trying to make everything more equal, so the viewer doesn't need to adjust their volume for every video.
      • All they'd have to do is, as mdmkolbe says above, is put some checkboxes up for the uploaders, to choose from a few default compression algorithms, or a box to check if you just want them to leave your audio alone.

        Was there really a big problem with inaudible YouTube videos before this, though? Is this a solution that really didn't have a problem?

      • Re: (Score:3, Interesting)

        Comment removed based on user account deletion
      • by Tacvek ( 948259 )

        But cant they do simple volume equalization rather than compression? I mean equalizing by either maximum volume (the loudest sounds in all videos are exactly the same) or by the average volume (the avaerage volume level of all clips are exactly the same).

        Indeed, I believe they already do use one of those equalizations. So why compress the sounds?

    • by daem0n1x ( 748565 ) on Sunday July 27, 2008 @03:39PM (#24360897)
      I guess they are trying to compensate for the huge differences between recording quality in the videos people submit. Some are loud enough, others are very low and you have to turn the level way up to understand what people are saying.
      They could simply normalise the level, but if you have a speech with very low level and the guy drops the microphone in the middle, that one peak is so loud that will make the normalisation process useless.
      But compression is such a complex and subjective issue that it should be performed by hand. I guess they have an automated process for that, and it doesn't have any intelligence, just steamrolls all the audio it finds, whether it's speech, music, or anything else.
  • by phantomfive ( 622387 ) on Sunday July 27, 2008 @02:30PM (#24360391) Journal
    Wouldn't it be easier to set your gate [wikipedia.org] correctly? Cut out the background sounds BEFORE submitting to youtube; do proper editing and then it doesn't matter so much what they do. Here, in my opinion, is a good site for all such information [tweakheadz.com].
    • by PetiePooo ( 606423 ) on Sunday July 27, 2008 @02:42PM (#24360501)

      Wouldn't it be easier to set your gate [wikipedia.org] correctly?

      That would apparently help, but only in cutting out the quiet scrapes and shuffles before the actual (attempt at) music starts. During that silent period, YouTube's encoder would be cranking up the gain so much that, when the first guitar pluck occured, it would still be a highly clipped thud. This workaround keeps them from adjusting the gain at all.

      In other words, prefiltering your audio stream with a gate would quiet down the quiet parts, but would not prevent YouTube's encoder from fiddling with the gain.

      • by 4D6963 ( 933028 ) on Sunday July 27, 2008 @02:54PM (#24360609)

        During that silent period, YouTube's encoder would be cranking up the gain so much that, when the first guitar pluck occured, it would still be a highly clipped thud.

        Well actually it really depends. It depends whether it's audio compression, or volume normalisation. If it's audio compression then things get amplified regardless of chronology, and therefore if you remove the ambient noise it won't get amplified to an audible hiss and it won't have a negative effect on anything else.

        However what you were thinking about is "volume normalisation". In that case a quick change if volume would have the effect you described. I'm not sure which it is in this case but from the summary it looks like it's audio compression.

        By the way, noise gating? There are more sophisticated things these days for that, like stuff based on STFTs and noise profiling.

        • by zalas ( 682627 )
          It depends on the parameters of the compressor used. If the compressor has a long attack time and no look-ahead, you'll get that the compressor doesn't have enough time to clamp down a sudden loud burst of sound.
    • by Anonymous Coward on Sunday July 27, 2008 @03:43PM (#24360919)

      It still matters what they do. This kind of high compression is unsuitable for most material, yet they're insisting on it. Not only does it completely kill the dynamic range - imagine going to see a classical music concert and the entire concert is played at the exact same volume, no crescendos or decrescendos - that lack of dynamic range also dramatically quickens ear fatigue. What they're doing is great if they want people to stop listening (and therefore likely watching) YouTube videos as much. Otherwise, it's a really dumb idea.

      Using a noise gate to solve YouTube's poor decision is not very realistic - that's trying to get thousands and thousands of different people to fix something caused by YouTube trying to solve what wasn't really much of a problem. What's more, noise gate + high compression leads to Charlie Brown Special kinds of voice tracks and very limited musical choices - e.g., in a classical concert, instead of the quiet parts being just as loud as the loud parts, some of the quiet parts will simply be cut to silence. Noise gate + high compression can be cute for a bit in dialogue, and when done to a particular instrument - but not every instrument in a song - you can get some cool effects from it, but it's shitty thing for YouTube to require of people. It may be enough to force some users away.

  • Update (Score:5, Informative)

    by niceone ( 992278 ) * on Sunday July 27, 2008 @02:32PM (#24360407) Journal
    After some more testing it seems that there is a problem with high quality mode. With the tone and sample rate I used (19kHz and 44.1k) at least the high quality encoder whistles at, some other frequency. Sounds like somewhere less than 10kHz to me.

    I hope YouTube fix this soon.
    • by 4D6963 ( 933028 )
      Any chance this would be due to a non-linearity like clipping? Someone correct me if I'm wrong but I think that with clipping with a strong 19 kHz component in a signal sampled at 44.1 kHz you'd get artifacts which base frequency would be 3,050 Hz.
    • Re:Update (Score:5, Interesting)

      by Anonymous Coward on Sunday July 27, 2008 @02:53PM (#24360595)

      It looks to me like Google have done this on purpose to stop people uploading high quality audio with a still image. A lot of the music I've been listening too recently has been from youtube, I'm sure I'm not the only one...

    • by pz ( 113803 )

      AWith the tone and sample rate I used (19kHz and 44.1k) at least the high quality encoder whistles at, some other frequency. Sounds like somewhere less than 10kHz to me.

      Like, say, 3.05 kHz? That's what one would expect from a non-linear mixing of the sampling frequency and the signal you've injected. There are so many potential sources for non-linear mixing that it's hard to start a meaningful list, but here goes: gain control, compression, resampling, clipping, aliasing, unintentional digital-to-analog-to-digital conversions, non-idealities in the audio driver amplifier, etc. The problem could originate at your end when you created the audio stream, at the far end when

    • Comment removed (Score:4, Informative)

      by account_deleted ( 4530225 ) on Sunday July 27, 2008 @07:45PM (#24362695)
      Comment removed based on user account deletion
    • You are probably hearing aliasing. If your 19kHz has harmonic content (which can be introduced several ways), it will mix with the 44.1Khz sampling frequency, producing sounds at the sum and difference frequencies (for example 44.1 - 38 = 6.1).

  • by 4D6963 ( 933028 ) on Sunday July 27, 2008 @02:32PM (#24360415)

    Wouldn't another solution be to sneak past the entire recompression process by submitting a .flv video that meets YouTube's requirements to avoid recompression? Or would the compression on audio (not the same type of compression, the one this article is talking about) still be forced on these?

    By the way to improve the trick, what you could do is detect the envelope of your sound, a modulate your 19 kHz sine with an envelope complementary so that the two envelopes would sum up to a flat line, so your 19 kHz envelope would be f(t) = 1 - original_sound_envelope(t).

    • Re: (Score:3, Informative)

      "...Wouldn't another solution be to sneak past the entire recompression process by submitting a .flv video..."

      Last time I submitted a video, about six to eight months ago, Youtube did not accept .flv or .swf formats, even though that is the format that they use to stream. Youtube wanted mpg, divx or mov formats. That sucked because my original was done in swf. First I had to convert the swf to divx which I uploaded to Youtube. Converting from swf to divx resulted in a big quality degradation. Youtube

      • Re: (Score:3, Insightful)

        by 4D6963 ( 933028 )
        Ha... however considered that .flv video is H263 (or is it H264 now?) I guess you could find a program that would change the container to an AVI-compatible one and thus avoid recompressing?
        • Ha... however considered that .flv video is H263 (or is it H264 now?) I guess you could find a program that would change the container to an AVI-compatible one and thus avoid recompressing?

          The original Flash video format is Sorenson Spark. It's based on H.263, but incompatible.

          H.264 and AAC don't fit in an AVI well at all... It's possible to do, but it's a mess, which most apps don't properly support.

          In either case, I don't believe for a second that YouTube's video conversion is smart enough to detect com

      • Last time I submitted a video, about six to eight months ago, Youtube did not accept .flv or .swf formats,

        Youtube has accepted flvs for quite some time now. That does not excend to SWFs, however. Animations are not videos, and can't be converted easily.

      • Re: (Score:2, Informative)

        youtube reencodes any flv now, before you uploaded an flv with a total bitrate under 350kbps and it WASN'T re encoded, thus stereo sound, they re encode EVERYTHING now, even a 100 kbps total flv was re encoded
  • Standards (Score:5, Funny)

    by Dan East ( 318230 ) on Sunday July 27, 2008 @02:33PM (#24360417) Journal

    YouTube is just trying to enforce a standard level of quality to the content. Everyone expects crappy video with lots of compression artifacts, so the audio might as well follow suite.

  • by NovaHorizon ( 1300173 ) on Sunday July 27, 2008 @02:43PM (#24360509)
    you mean that high pitched squeal that is driving me nuts in the example more then the audio compression? Yea.. that's filtered out all right...
    • Re: (Score:3, Funny)

      by AngryNick ( 891056 )
      Damn you! I fell for your trick post about hearing the "high pitched squeal" and went back and listened again. I heard the hiss, but now the song is stuck in my head. ARGHHHH!!!
  • by Looce ( 1062620 ) * on Sunday July 27, 2008 @02:46PM (#24360543) Journal

    The high quality version of the audio will have the 19 (or up to 22.1) kHz sine wave you choose to use in your video upload. So this is a trade-off of quality (high-quality = eek!) versus lack of unwanted range compression (low-quality = listenable, for lack of a better word).

    FWIW, I can hear 19 kHz waves. So this trade-off affects me.

    • by pz ( 113803 ) on Sunday July 27, 2008 @03:29PM (#24360821) Journal

      FWIW, I can hear 19 kHz waves. So this trade-off affects me.

      You won't hear 19 kHz much longer. Seriously, not because of this or any other particular factor (although there are many), but because everyone experiences upper-range hearing loss as they get older, and it starts at an astonishingly early age.

      • by Looce ( 1062620 ) * on Sunday July 27, 2008 @03:38PM (#24360889) Journal

        I have indeed heard of such deterioration on the Teen Buzz website (which is currently down for excessive bandwidth usage?) - but this page [wikipedia.org] describes it as well.

        Those little annoying sine-wave sounds are also used by TV advertisers such as Kentucky Fried Chicken [youtube.com] to grab teens' attention if adults are not their market. (For the record, if you can't hear the tone, it sounds off when the KFC bucket shows up.)

      • Re: (Score:3, Interesting)

        by lawpoop ( 604919 )
        People on the Autism spectrum, including people with Asperger's, are able to hear high-frequency sounds much better than the average person. I suspect there are a lot of such people on slashdot.

        I worked with a guy once at a computer recycling place. He clearly had Asperger's, from the way his 'stories' were a list of facts delivered in a monotone, to his encyclopedic knowledge of model numbers and release years, to his inability to explain himself to anybody in charge. He could tell if a monitor was good
  • Lack of Choices (Score:2, Interesting)

    by Tablizer ( 95088 )

    It would be nice if YouTube offered some choices, such as volume adjustment, no volume adjustment, and also other things like stereo. The only way I know of to get stereo is to submit it in Adobe's proprietary formats. YouTube is pulling a Henry Ford: you can have any color you want, as long as its black.

    • by 4D6963 ( 933028 ) on Sunday July 27, 2008 @02:59PM (#24360641)

      It would be nice if YouTube offered some choices, such as volume adjustment

      Yeah, I mean, who on YouTube would even think of abusing that?

    • Choose better. (Score:3, Interesting)

      by jbn-o ( 555068 )

      Host your video somewhere else [archive.org], upload it in a high-quality format, and let the site make derivatives for you (including a Flash video and a player you can embed in your webpage if you insist on placating a proprietor). Some organizations do this daily and it works excellently. YouTube needs you more than you need YouTube.

      • Is there some kind of listing that compares the various video hosting services? Something where I'd find "audio compression" as a column in some matrix with values like "no", "yes, automatically" and "yes, user-configurable"?
  • by Waccoon ( 1186667 ) on Sunday July 27, 2008 @02:51PM (#24360565)

    It surprises me after all these years, audio formats don't provide recording information about the dynamics of the waveform.

    Cameras write EXIF information into JPEG files, why can't we have something similar for audio so we don't have to adjust the volume all the time?

    You don't have to be an audiophile to appreciate good audio. I have a custom amp next to my computer into which I've plugged headphones. Find anyone with a pair of headphones, and you'll find an amp, too. Either that, or a deaf person who's been tortured by a bad Flash file.

    • by 4D6963 ( 933028 )

      It surprises me after all these years, audio formats don't provide recording information about the dynamics of the waveform.

      Well what kind of things would you store that couldn't be obtained through analysis of the actual sound?

      • by tftp ( 111690 )
        All the things that you want to apply to the playback before the playback even starts, or even before the file is even fully downloaded.
        • by 4D6963 ( 933028 )

          All the things that you want to apply to the playback before the playback even starts, or even before the file is even fully downloaded.

          But in the case of YouTube they do all their processing on the entire file once and for all, so the point is moot.

    • by Anonymous Coward

      Read more http://replaygain.hydrogenaudio.org/ [hydrogenaudio.org].

    • by dabadab ( 126782 )

      There is such a thing (google for replaygain), but it's not about that, it's simple compression, i.e. making the really quiet sounds nearly as loud as the loudest ones.

    • by jimicus ( 737525 ) on Sunday July 27, 2008 @03:48PM (#24360945)

      There is, in MP3 at least. It's used by mp3gain:

      http://mp3gain.sourceforge.net/faq.php [sourceforge.net]

      However, not all audio players support it. I'm pretty sure the iPod doesn't, nor does iTunes. (For some reason iTunes does have a "normalise levels on all selected tunes" option but that works by decoding/re-encoding the audio, which is a lot slower because in addition to the audio analysis you have to re-encode the file and is likely to introduce further interference to the stream).

      Having said that, I've only got a fourth gen ipod. For all I know, more recent models do make use of this tag and furthermore, for all I know if iTunes knows that it's being synced with an ipod which does support the tag then that's what it uses to adjust the gain.

  • hopefully this wont date me much, but this reminds me of tape bias, the high-frequency signal applied to the magnetic frequencies used to record tapes (oh it did have unintended consequences). http://en.wikipedia.org/wiki/Tape_bias [wikipedia.org]
  • Thank the iPhone (Score:3, Interesting)

    by wiredlogic ( 135348 ) on Sunday July 27, 2008 @03:57PM (#24361013)

    I would guess they are doing this to better "service" handheld devices like the iPhone and upcoming Android devices that have limited dynamic range in their speakers.

    • Google already creates a different encoding for iPhone (H.264) since it can't play Flash videos. If they are doing this for the iPhone (which I have a hard time believing), why don't they only do it for the files destined for the iPhone?

  • Sorry, couldn't resist.

            -dZ.

  • by rueger ( 210566 ) on Sunday July 27, 2008 @04:20PM (#24361171) Homepage
    Although I tend to think that Dan East [slashdot.org] summed it up best, I feel the need to point out that 95% of bad YouTube audio is the result of lousy recording quality, not subsequent processing.

    Garbage In, Garbage Out.

    The mics and electronics on most consumer camcorders (or that most people use with their Macs and PCs) are just plain crappy, and shouldn't be relied on for anything that you hope to distribute. And of course, some actual audio recording skills help too.
    • Re: (Score:3, Insightful)

      Oh yeah, hold on, let me go spend a couple hundred dollars on microphones for my camcorder. Great idea. As a matter of fact, why don't I go ahead and upgrade that all-in-1 camcorder for a pro kit, take some filmmaking classes, just so I can put videos of my sister's wedding on Youtube. Great idea there, hoss.
  • Use http://vreel.net/ [vreel.net] instead - its divx, better quality anyway.

  • ...who decided to brute-force modify each and every copyrighted audio track on YouTube (every audio track) without permission from the copyright owner?

    Destroying the dynamic range intended by the originator in this manner is not acceptable.

    If Google feels that some audio needs "normalization" or whatever they wish to call it, at least make it a feature that can be opted into by the owner of the video...

    --Tomas

  • How about using a very low frequency sound, say 1 Hz? Or a Square wave with a period that is the same length (or greater) as the clip in question? Maybe that way you could avoid the re-encoding / aliasing issues.
  • So I tried these videos on three different playback mediums:

    • Macbook Pro, 17" w/ the big speakers, Recent FireFox: No audible difference; although the speakers aren't big and powerful enough to get anything spectacular.
    • Fancy Home Theater, Windows XP, Optical fixed at 44.1khz, IE 7: Subtle difference, the "better" one sounded a little quieter, although I wouldn't describe the original as "mangled" or over-compressed.
    • Fancy Home Theater, Wii (Opera), Analog with DSP: Again, a Subtle difference just like m
    • by g-san ( 93038 )

      To you. These videos do not prove the poster's claims, to you. You should probably go clean your ears, because if you can't tell the difference you probably have years of wax build up in there. Or you just don't have an ear for this sort of thing, so are not qualified to comment. People have examined the waveforms, RTFT, and this is happening.

      • by GWBasic ( 900357 )

        You should probably go clean your ears, because if you can't tell the difference you probably have years of wax build up in there.

        I just had them cleaned out a few weeks ago. (The ironic thing is that it was YouTube videos of people digging huge chunks of earwax out of their ears that prompted me to do it.)

        I didn't use a loud volume when I compared the two videos. I'm not doubting that YouTube is in some way altering the audio; however, an A-B comparison between two YouTube delivered videos really can't provide an accurate example of the distortion, because both videos are subject to the same distortion. I'd really like to see imag

  • Particularly if you use the "brown noise" at high volume. That would give additional meaning to "garbage in, garbage out".

Keep up the good work! But please don't ask me to help.

Working...