Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th December 2016, 22:40   #1  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,317
LossyFlacGUI



This application was designed to simplify process of processing FLAC files using lossywav.
Unfortunately Lossywav is quiet slow due to single threaded nature. In order to speed up processing with lossywav work is split in chunks using --skip and --until switches and then all chunks are executed simultaneously. Split points are done according to optimal block size (512 for 44.1/48KHz or 1024 for 96KHz or 2048 for 192 KHz).

Example for 2 threads.

chunk 1
Code:
"flac.exe" -d "audio.flac" --skip=0 --until=7379456 --silent --stdout | "lossywav.exe" - --stdinname "audio.001.wav" --force --outdir "..\LossyFlacGUI_temp"
chunk 2
Code:
"flac.exe" -d "audio.flac" --skip=7379456 --silent --stdout | "lossywav.exe" - --stdinname "audio.002.wav" --force --quality standard --outdir "..\LossyFlacGUI_temp"

No matter how many CPUs you have on motherboard each core will work at 100% reducing processing time significantly. This is very helpful if you work with long movie audio tracks. My Xeon E5-2690 (8C/16T) can convert 120 min 48KHz 6 channels 24 bit in ~1min:30s where before it took ~17min! Of course there is small bottleneck because wavs must be combined (using SOX) and encoded back to FLAC. I suppose this shouldn't be a big problem if you have decent MLC SSD and GPU (encoding with FlacCL).

Download
http://www.mediafire.com/file/qepld4...cGUI_v1.0.1.7z
Atak_Snajpera is offline   Reply With Quote
Old 17th December 2016, 01:19   #2  |  Link
mariush
Registered User
 
Join Date: Dec 2008
Posts: 590
I honestly don't see the point of making these not lossless , not lossy sound files.

If you want almost lossless, why don't you just go for Opus 512 kbps VBR (the maximum possible) ... you'll get almost transparent sound files, encoded much faster.
mariush is offline   Reply With Quote
Old 17th December 2016, 11:35   #3  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,317
Because not all tvs support opus? Because this method is alot less agresive? Because 24 bit or even 16 bit audio is just an overkill for human beings? Lossywav by reducing bitdepth acts like video denoiser. Even gentle denoising can improve lossless video compression (ut video/magicyuv)

Last edited by Atak_Snajpera; 17th December 2016 at 11:43.
Atak_Snajpera is offline   Reply With Quote
Old 17th December 2016, 17:13   #4  |  Link
Gser
Registered User
 
Join Date: Apr 2008
Posts: 414
Quote:
Originally Posted by Atak_Snajpera View Post
Because 24 bit or even 16 bit audio is just an overkill for human beings? Lossywav by reducing bitdepth acts like video denoiser
Lossy doesn't reduce bitdepth. That can be accomplished through a filter. I have tried LossyFLAC with Foobar before but didn't really see any need for it as a format. I tried for example compressing Matrix's TrueHD 5.1 audio with extreme compression setting in Lossy flac, the file went from 1,56 GB to 984 MB. I wanted to keep the 24 bit depth to maintain the low noise floor and high dynamic range. In comparison to the movie size the audio does not take up much space.

But in music use it is pretty much useless, I'd rather keep my files at the SACD quality in which I purchased them. Some I still have to purchase in CD quality which is unfortunate and most certainly don't need even more compression. But I am not unreasonable, if you listen to music through tin cans while using floppy disks as a storage format I can see the appeal of LossyFlac.

Last edited by Gser; 17th December 2016 at 17:27.
Gser is offline   Reply With Quote
Old 17th December 2016, 17:51   #5  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,317
Quote:
Lossy doesn't reduce bitdepth.
http://wiki.hydrogenaud.io/index.php?title=LossyWAV
Quote:
lossyWAV is based on the lossyFLAC idea proposed by David Robinson at Hydrogenaudio, which is a method of carefully reducing the bitdepth of (blocks of) samples which will then allow the FLAC lossless encoder to make use of its wasted bits feature. The aim is to transparently reduce audio bit depth (by making some lower significant bits (lsb's) zero), consequently taking advantage of FLAC's detection of consistently-zeroed lower significant bits within each single frame and significantly increasing coding efficiency.[1] In this way the user can enjoy audio encoded using the same codec (which may be all important from a hardware compatibility perspective) at a reduced bitrate compared to the lossless version.
Quote:
I tried for example compressing Matrix's TrueHD 5.1 audio with extreme compression setting in Lossy flac, the file went from 1,56 GB to 984 MB. I wanted to keep the 24 bit depth to maintain the low noise floor and high dynamic range.
I see much larger savings with standard preset. Examples

Original FLAC
Code:
General
Complete name                            : C:\Users\Dave\Desktop\audio1.flac
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
File size                                : 211 MiB
Duration                                 : 10 min 14 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 2 885 kb/s

Audio
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Duration                                 : 10 min 14 s
Bit rate mode                            : Variable
Bit rate                                 : 2 885 kb/s
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 kHz
Bit depth                                : 24 bits
Stream size                              : 211 MiB (100%)
Writing library                          : libFLAC 1.3.1 (UTC 2014-11-25)
LossyFlac preset standard
Code:
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
File size                                : 103 MiB
Duration                                 : 10 min 14 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 1 408 kb/s

Audio
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Duration                                 : 10 min 14 s
Bit rate mode                            : Variable
Bit rate                                 : 1 408 kb/s
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Back: L R, LFE
Sampling rate                            : 48.0 kHz
Bit depth                                : 24 bits
Stream size                              : 103 MiB (100%)
Writing library                          : libFLAC 1.3.1 (UTC 2014-11-25)
LossyFlac preset extraportable
Code:
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
File size                                : 74.2 MiB
Duration                                 : 10 min 14 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 1 012 kb/s

Audio
Format                                   : FLAC
Format/Info                              : Free Lossless Audio Codec
Duration                                 : 10 min 14 s
Bit rate mode                            : Variable
Bit rate                                 : 1 012 kb/s
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Back: L R, LFE
Sampling rate                            : 48.0 kHz
Bit depth                                : 24 bits
Stream size                              : 74.2 MiB (100%)
Writing library                          : libFLAC 1.3.1 (UTC 2014-11-25)

Last edited by Atak_Snajpera; 17th December 2016 at 17:55.
Atak_Snajpera is offline   Reply With Quote
Old 17th December 2016, 20:00   #6  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 5,694
Maybe OPUS is still not supported by some players, but also FLAC is not fully supported.

We have AAC than is compatible with any actual player.

There are some audio test than compare the quality between this method and the equivalent, or near, bitrate using AAC?
__________________
BeHappy, AviSynth audio transcoder, in Doom9 forums. NicAudio, BassAudio, audio decoders.
tebasuna51 is offline   Reply With Quote
Old 17th December 2016, 22:39   #7  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,070
Quote:
Originally Posted by Atak_Snajpera View Post
Because 24 bit or even 16 bit audio is just an overkill for human beings? Lossywav by reducing bitdepth acts like video denoiser. Even gentle denoising can improve lossless video compression (ut video/magicyuv)
I don't think a bit-depth of 16-Bit is "overkill". It's more like 16-Bit is just about sufficient. At 8-Bit you get a whole lot of quantization noise (sounds like and old telephone). And if you ever tried amplifying a "quiet" section of a 16-Bit file, you will notice that quantization noise becomes very audible, event at 16-Bit. So, using 24-Bit or even 32-Bit (IEEE 754) can make a lot of sense - especially if you intend to process the audio. Proper dithering helps too, of course.

What really is "overkill" are sampling-rates above 48 KHz. That's because at a sampling-rate of 48 KHz you can already retain frequencies up to 24 KHz (without aliasing), according to Nyquist–Shannon sampling theorem. And the highest frequency humans can hear is about ~20 KHz. For most adults it's actually way lower. So, sampling frequencies higher than 48 KHz are pretty much "snakeoil". That's why modern audio formats, like Opus, are fixed at 48 KHz.
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 17th December 2016 at 22:42.
LoRd_MuldeR is offline   Reply With Quote
Old 18th December 2016, 14:45   #8  |  Link
Gser
Registered User
 
Join Date: Apr 2008
Posts: 414
Quote:
Originally Posted by Atak_Snajpera View Post
I see much larger savings with standard preset.
Ah yes, perhaps I should have mentioned I first had to convert the TrueHD file to a flac file which size was 2.5GB. So yes flac to flac compression is decent but seems TrueHD is better at compression than flac.

What I meant by bit depth is that indeed Lossy does fiddle around with perceived bit depth but even in the guide it says that it is optimized for 16-bit, 44.1kHz sources meaning it is better to lower the bit depth before compression rather than relay on its perceived bit depth manipulation for optimal compression.

Last edited by Gser; 18th December 2016 at 14:49.
Gser is offline   Reply With Quote
Old 4th January 2020, 19:10   #9  |  Link
Yoshi
Registered User
 
Join Date: Apr 2014
Posts: 31
While being a little late to kick in, the following is still valid so I don't wanna leave it uncommented after having stumbled across it:

Quote:
Originally Posted by LoRd_MuldeR View Post
I don't think a bit-depth of 16-Bit is "overkill". It's more like 16-Bit is just about sufficient.
It is more than sufficient, at least as an end-user format. Properly dithered, 16 Bit linear PCM exceeds any human's hearing capabilities both in SNR and dynamic range.

Quote:
Originally Posted by LoRd_MuldeR View Post
At 8-Bit you get a whole lot of quantization noise (sounds like and old telephone).
Partly true, however with decent noise shaping dither, that still sounds quiet decent and certainly above an old telephone's performance. Also for today's dynamic compressed charts crap, even less bits would suffice.

Quote:
Originally Posted by LoRd_MuldeR View Post
And if you ever tried amplifying a "quiet" section of a 16-Bit file, you will notice that quantization noise becomes very audible, event at 16-Bit.
True, but an invalid argument since one always can amplify any signal high enough so it will be above the hearing threshold. The point is that one won't perceive it as long as the playback gain level is adjusted in a way where a signal at maximum level won't damage your hearing.

Quote:
Originally Posted by LoRd_MuldeR View Post
So, using 24-Bit or even 32-Bit (IEEE 754) can make a lot of sense - especially if you intend to process the audio.
Replace the "especially" with "only", and the statement is correct.

Quote:
Originally Posted by LoRd_MuldeR View Post
Proper dithering helps too, of course.
Absolutely, the same is true for video by the way. Sadly, only very few seem to have a profound understanding here which gets us uncountable Blu-ray-releases with severe, ugly banding artifacts.

With the sampling part of your posting I entirely agree.
Yoshi is offline   Reply With Quote
Old 4th January 2020, 19:16   #10  |  Link
Cary Knoop
Cary Knoop
 
Cary Knoop's Avatar
 
Join Date: Feb 2017
Location: Newark CA, USA
Posts: 233
Flac is supposed to be lossless, why on Earth have all those compromising and potentially misleading solutions?
Cary Knoop is offline   Reply With Quote
Old 5th January 2020, 00:33   #11  |  Link
Atak_Snajpera
RipBot264 author
 
Atak_Snajpera's Avatar
 
Join Date: May 2006
Location: Poland
Posts: 7,317
Quote:
Originally Posted by Cary Knoop View Post
Flac is supposed to be lossless, why on Earth have all those compromising and potentially misleading solutions?
Why don't you post your question under correct address?
https://hydrogenaud.io/index.php/top...msg498343.html
Atak_Snajpera is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:18.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.