HydrogenAudio

Lossy Audio Compression => Ogg Vorbis => Ogg Vorbis - Tech => Topic started by: selection7 on 2011-05-20 07:31:34

Title: ogg auto-encoding lo-volume passages at lo bitrates?
Post by: selection7 on 2011-05-20 07:31:34
First, my audio to be encoded never has any true, dead silence.
But for example, I have a track that's nothing but a count in and and then only noise floor afterwards...and I want this 4min file to encode at no more than maybe 600kb since 97% of the file should be encoded at ~32kpbs while the part with actual audible sound gets encoded at more like ~200kbps.  I know it's common for variable bitrate encoders to vary bitrates depending on frequency, but I want it to vary depending on volume too! Yes, encoders do reduce bitrate drastically when the file is flatlining dead silence, but I don't want to have to noisegate to achieve this and I don't have dead silence, just noise floor.  I'm not the only one who'll be encoding with this purpose in mind and that's an extra step I'd like to avoid for multiple reasons.

I can't find an ogg encoder that will do this? Has anyone achieved this or have any useful info/suggestions?

EXTRA INFO:
What I'm doing is encoding separate tracks that make up one song, but I'm finding that my LAME encoder (and others I've tried) encode near silence (noise floor) at roughly the same bitrate as very loud audio even. I want it to encode at something like 32kpbs when the audio level is that low.
Title: ogg auto-encoding lo-volume passages at lo bitrates?
Post by: googlebot on 2011-05-20 08:30:37
You are looking at the wrong end of the chain. What you want is a gating effect, that turns all noise below a threshold into absolute silence before encoding.
Title: ogg auto-encoding lo-volume passages at lo bitrates?
Post by: Sunhillow on 2011-05-20 17:47:14
What settings did you use when the noise floor was encoded at high bitrates? You must not use the -b parameter with vbr ;-)

Bitrate in VBR encoding does not depend on frequency, but of the signal's spectral composition. If there is a lot of content that is not masked my other parts of the content you will need a higher bitrate. Examples for this are white (or pink) noise, cympals, trumpets, harpsichords, death metal etc

I would not send musig through a noisegate, this sounds ugly. Better try a dynamic expansion below an appropriate threshold ...
Title: ogg auto-encoding lo-volume passages at lo bitrates?
Post by: selection7 on 2011-05-23 00:05:43
What settings did you use when the noise floor was encoded at high bitrates? You must not use the -b parameter with vbr ;-)

Bitrate in VBR encoding does not depend on frequency, but of the signal's spectral composition. If there is a lot of content that is not masked my other parts of the content you will need a higher bitrate. Examples for this are white (or pink) noise, cympals, trumpets, harpsichords, death metal etc

I would not send musig through a noisegate, this sounds ugly. Better try a dynamic expansion below an appropriate threshold ...

Thanks for the reply.  I'm can't answer about settings in terms of parameters or switches (I'm familiar with these from RazorLAME mp3 encoder, which I also tried).
I'm not sure what the standard ogg encoder is, but I used Adobe Audition's ogg encoder (with variable bitrate choice and settings like "bit reservoir floor", "bit resorvoir bias", and "impulse noise floor", but nothing about specific parameters or switches like "-b".  Varying those 3 settings did no good.  I also tried the ogg encoder made by the VUplayer people.

You suggest a dynamic [volume] expansion to effectively lower the volume of the already quiet parts, but
a) is there an ogg encoder that will do this? and
b) I would prefer not to change the volume of the quiet bits for multiple reasons. 

As far as a) goes...why would that help anyway?  Lowering the volume won't cause my ogg encoder to encode at lower bitrates unless you go all the way to dead silence. 
As for b) What I want is for it to encode at a lower bitrate when the original volume falls below a threshold.  200 people have read this thread without an encoder being suggested, so maybe if such an encoder exists, it is little known.  It makes too much sense, so I'm surprised if it doesn't exist.
Title: ogg auto-encoding lo-volume passages at lo bitrates?
Post by: googlebot on 2011-05-23 09:46:33
WI would not send musig through a noisegate, this sounds ugly.


You can set the attack time to one or two seconds and it won't influence loud passages at all.

I still don't the this as an encoder feature. When you encode a low SNR signal at 32 kbit/s, with MP3/OGG/AAC-LC, it will sound like shit. Almost no masking can be exploited anymore. The resulting decoded signal is 95% artifact, I don't see the sense in keeping 95% trash for 5% information. Saving nothing for those passages and then maybe stuffing the result with generated noise seems much more plausible.

You present the issue, as if it was something extraordinary, that such an obvious feature doesn't exist. It isn't, and the reasons are based on how encoders work.
Title: ogg auto-encoding lo-volume passages at lo bitrates?
Post by: 2Bdecided on 2011-05-23 17:46:21
Some older versions of Lame were more aggressive in reducing the VBR bitrate during quieter passages - but this behaviour was tuned because it created audible artefacts if people increase the volume during quieter passages, or put the file through dynamic range compression etc.

If you increase the ath (absolute threshold of hearing) in lame, it'll see the quiet sections as silence, and encode them at 32kbps. I'm sure there's a command line switch to do this, though it might only be accessible in beta versions. Ah, no, I think it's been removed altogether. You're stuck then!

If you heard what 32kbps 44.1kHz joint stereo encoding does to background noise, you'd probably prefer the noise gate.

Cheers,
David.
Title: ogg auto-encoding lo-volume passages at lo bitrates?
Post by: selection7 on 2011-05-25 01:45:35
Thanks again for your thoughts.  What you're saying is all good stuff.  But while I was trying not to bore you with essay length posts (I like lots of detail myself, but learned long ago that often others will just do a tl;dr), lol, but I guess I do indeed need to explain myself since you (understandably) still seem concerned with why I'd want to do it that way.

But first, thanks 2Bdecided, for the info about old versions.  That's a lead anyway.  You don't happen to have one of those old verisions?

I decided to see if I could track down an answer to this issue to help someone else, but someone who I don't necessarily want noisegating things.    Granted, noisegating only noise floor can't be screwed up if you set the settings correctly beforehand as a template.  But I also don't like workarounds (noisegating) if I think a proper solution could exist, and I don't want the extra step (which maybe means another piece of software?) for others who might be lazy or careless.  In this case, low volume material such as bleed and background sounds would likely get muted during a final mixdown of the individual instruments in the multitrack anyway, however, there is still useful information there (bleed for timings...comments by an engineer...obvious audio cues as to what other instruemnts were accompanying "live" while the one in question was being recorded...whatever) that I don't want completely lost, yet don't care if it sounds poor (after all, it won't be in the final mix).  While googlebot is right to say that 32kpbs is useless for anything you'd want to hear for music listening, it doesn't matter if I don't want to noisegate.  Plus, 32kbps being 95% artifact is a huge exaggeration (I just tried it to confirm).  To be clear, when I said I'd be surprised if it didn't exist (and 2Bdecided says it does**did**), I meant lower bitrates for very quiet passages or frequencies but not 32kbps stupid low.  For me I guess, what would work best is something that would do 0!kpbs at noise floor and up to maybe 96 for very low volume sounds, with everything above that threshold getting normal treatment.  I just didn't want to be overly demanding when I posed the original question...getting pointed in the right direction was my first goal.  So anyway a 32kbps bitrate would only make sense for my specific purposes or if a noisegating didn't get used (even if it should have been).  Any bitrate spent on a very low volume section is bitrate not used on cymbal crashes, so it doesn' matter if we're uncomfortable with the idea, it's a  tradeoff one way or the other whether we like it or not.

That out of the way, are there encoders that will employ noisegating?  I'm not stubborn, if I can't find an older encoder that will encode lowest volumes at something small then I will look into how well the other options could work out.
Title: ogg auto-encoding lo-volume passages at lo bitrates?
Post by: googlebot on 2011-05-25 09:44:47
Plus, 32kbps being 95% artifact is a huge exaggeration (I just tried it to confirm).


You quote me incorrectly. I said for "a low SNR signal" as, for example, noisy silence. Here 95% artifact is no exaggeration. When you want to capture engineers talking in between music takes, these words aren't low SNR.

Any bitrate spent on a very low volume section is bitrate not used on cymbal crashes, so it doesn' matter if we're uncomfortable with the idea, it's a tradeoff one way or the other whether we like it or not.


I think you still don't get it. Not encoding low volume signals equates raising the SNR (also for intended high quality passages). What you are basically asking for is a mechanism to support your laziness, i.e. not wanting to indicate which passages are intended to be high quality and which are not. Volume is not a good, general indicator. Too low bitrates for low volumes have been removed from encoders for a reason (not because programmers would have been blind to such a 'highly plausible' demand). The purpose of an encoder is encoding, not supplying a whole range of special interest tools - your demand is special interest - for people unwilling to build custom pipelines - for example by adding a gating DSP - for custom tasks. Tools as SoX are intended and better suited for this.
Title: ogg auto-encoding lo-volume passages at lo bitrates?
Post by: Joe Bloggs on 2011-12-02 11:52:42
@Selection7: you should be able to find any version of LAME from sourceforge but you‘d need to compile the exe yourself.  Of course, old versions of lame may have the feature you want but may also encode the whole track at lower quality than the current version. Like you said everything is a tradeoff--why can't the tradeoff be to just use a high quality off the shelf preset and use some more disk space?  Heck if I were doing mixing and mastering like you I would be using 24/96 lossless for everything, probably.  If I had to use lossy it would be cbr 320. :confused: