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 17th July 2020, 10:06   #1  |  Link
LeXXuz
21 years and counting...
 
LeXXuz's Avatar
 
Join Date: Oct 2002
Location: Germany
Posts: 716
HD-Audio to FLAC, or not?

Up front, please bear with me if this reads more like an essay then a simple question.

Well... this is bothering me for some time now. And I would love to have some input from audio experts.

Many moons ago it was almost mandatory to convert HD-Audio tracks to a much smaller and mostly lossy format. Disk space was much more expensive than today, and what's the point in compressing video for space sake if you keep audio tracks that can easily be several GB alone, right?

So encoding to DTS/AC3 (or just keeping DTS/AC3 core from HD tracks) was my prefered choice for many years. My AV back then had no HDMI inputs and couldn't handle HD-Audio anyway.

Well, a few years ago I upgrade to an HD capable AV-System.
Again, the question what to do with audio now. Since the AV receiver was now capable of Multichannel PCM, the decision was obvious to transcode HD-Audio to 16-bit FLAC from now on, instead of lossy DTS/AC3 tracks.

It seemed to be the best compromise between file size and quality.

A few month ago, merely by accident, I noticed some differences between the original HD-Audio tracks and the transcoded FLAC tracks while having a movie night with friends.

The days after I investigated even more movies and came to the conclusion that the source audio tracks kinda sound better. It's hard to describe, sometimes the dynamic sounds better, or the spatial resolution gives me more of the 'you are right in the middle' impression than with the transcoded FLAC.

Since then I keep asking myself if it is still a good idea to transcode to FLAC?

And I'm wondering if:

1) I'm just imagining things,
2) they just occur because my AV has to use different decoding algorithms for DTSHD/THD/FLAC (and I still haven't found the best matching settings obviously),

OR
3) there is any additional information inside DTS/THD tracks besides the plain audio data that gets lost during transcoding to FLAC and therefore may change the acoustic experience?

(I'm not talking about object based audio formats like Atmos/DTS:X just 'plain' DTSHD/TrueHD tracks.)

You could argue why bother, just keep the source tracks. Well, I still feel uncomfortable by keeping audio tracks that are several GB in size while spending hours on encoding video to get smaller files.

Anyhow, thank you for reading and I'm eager to read your thoughts on this.
LeXXuz is offline   Reply With Quote
Old 17th July 2020, 14:24   #2  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by LeXXuz View Post
instead of lossy DTS/AC3 tracks.
DTS is not necessarily lossy. DTS-HDMA is lossless, such as some Dolby formats. Even with lossy format you will have no benefit converting them to FLAC: shit in leads to shit out.

Quote:
Originally Posted by LeXXuz View Post
I noticed some differences between the original HD-Audio tracks and the transcoded FLAC tracks while having a movie night with friends.
Simply because a DTS/Dolby audio is not just "plain audio". There can be metadata, describing much more than the "plain audio" itself, to make it easy. If you are interested, read some wiki or official internet sites.

Quote:
Originally Posted by LeXXuz View Post
Since then I keep asking myself if it is still a good idea to transcode to FLAC?
IMHO no. When you use a file format you have to consider portability and longevity. DTS/Dolby can be streamed in original format thru HDMI or SPDIF to an A/V and offload all the decoding process to the A/V. You can use FLAC on many A/V but only as audio files, not directly decoded when part of a movie or bitstreamed to A/V.

Quote:
Originally Posted by LeXXuz View Post
my AV has to use different decoding algorithms for DTSHD/THD/FLAC
Are you bitstreaming or feeding PCM? 99% FLAC can't be bitstreamed.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 17th July 2020, 14:44   #3  |  Link
LeXXuz
21 years and counting...
 
LeXXuz's Avatar
 
Join Date: Oct 2002
Location: Germany
Posts: 716
Quote:
Originally Posted by tormento View Post
DTS is not necessarily lossy.
When I'm talking lossy DTS I mean DTS(-Core) not the HD formats.

Quote:
Originally Posted by tormento View Post
Simply because a DTS/Dolby audio is not just "plain audio". There can be metadata, describing much more than the "plain audio"
That's what I meant. I know there is some additional data stored like speaker setup and such but what/how exactly can it affect the acoustic experience? Without going into too much tech detail.

Quote:
Originally Posted by tormento View Post
IMHO no. When you use a file format you have to consider portability and longevity.
I don't care about that. My devices can decode FLAC to PCM on the fly. And I only create my files for myself and no one else. All I care about is the best ratio between fidelity and file size, unless of course some vital information is lost which I'd like to find out.

Quote:
Originally Posted by tormento View Post
Are you bitstreaming or feeding PCM? 99% FLAC can't be bitstreamed.
Typo. I meant PCM of course.
LeXXuz is offline   Reply With Quote
Old 17th July 2020, 15:49   #4  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by LeXXuz View Post
I don't care about that. My devices can decode FLAC to PCM on the fly. And I only create my files for myself and no one else.
The beginning of your thread was about file size is no matter to you. So, I can’t understand why you want to convert to FLAC a perfectly working DTS, if your flac doesn’t come from a previous audio processing and you want to preserve same quality.

I do convert everything to AC3 because my devices can’t accept any other format and I have some storage requirements, such as I prefer good video more than audio and I process it with FFMPEG to have audio normalization, since I live in a flat and don’t want to wake up my neighborhood at 3 am because of a unexpected explosion.

Do not forget that your devices support FLAC now but, as I told you, think about longevity in a 20-30 years time frame if you are a movie collector as I am.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 17th July 2020, 16:25   #5  |  Link
LeXXuz
21 years and counting...
 
LeXXuz's Avatar
 
Join Date: Oct 2002
Location: Germany
Posts: 716
Quote:
Originally Posted by tormento View Post
The beginning of your thread was about file size is no matter to you. So, I can’t understand why you want to convert to FLAC.
Sorry if that was misleading. File size DOES matter to me, but also fidelity. That's why I chose a lossless format like FLAC as a compromise.

Quote:
Originally Posted by tormento View Post
Do not forget that your devices support FLAC now but, as I told you, think about longevity in a 20-30 years time frame if you are a movie collector as I am.
Who knows what's in 20 years.
Looking 20 years back, that was the time before I got my first DVD-R drive. So, like most people I encoded my DVDs to AVI with 'Xvid/DivX or SVCD and split those onto several CDs. You know where these copies are today? In the garbage. All of them. They have been replaced by much better versions in the meantime.

So in many years from now, disk space may be so damn cheap that I can remux my vast movie collection on my NAS and don't care about re-encoding at all.

But until then I'd like to have the best compromise.

Last edited by LeXXuz; 17th July 2020 at 16:29.
LeXXuz is offline   Reply With Quote
Old 17th July 2020, 16:44   #6  |  Link
mbcd
Registered User
 
Join Date: Dec 2008
Location: Germany
Posts: 173
But what is stored in Metadarta that makes it sound that much better?

There is still a dialnorm and may be some "Room-type" ... but I dont think that it improves that much, because its all about filtering and filters cant change the sound that much heavily.

May be the loudness downmix or playback of the channels are stored in the dts stream, but then its all about leveling when encoded to flac.

I mean: Metadata cant improove quality that much, or am I wrong? The basicstream is both the same ... but there are still some filter only available on DTS-Playback.
mbcd is offline   Reply With Quote
Old 17th July 2020, 17:16   #7  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
I think audio enthusiasts prefer direct output anyway, i.e. without any dynamic compression or filtering in the decoder part.

I've never tested decoding a DTS-HD MA track to WAV and comparing it to the WAV track resulting from a FLAC file which was encoded from the DTS-HD MA track. It should be bit identical by nature.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 17th July 2020, 19:26   #8  |  Link
LeXXuz
21 years and counting...
 
LeXXuz's Avatar
 
Join Date: Oct 2002
Location: Germany
Posts: 716
Quote:
Originally Posted by mbcd View Post
I mean: Metadata cant improove quality that much, or am I wrong? The basicstream is both the same ... but there are still some filter only available on DTS-Playback.
That's what I was thinking all the time. Even the downgrade from 24 to 16 bits should not be noticeable on a consumer device. If you need the track for further processing that's a total different story.

It's not really a loss in quality I've noticed. It's more like the sound stage is shifting to a more upfront position for example. Or the center channel being louder or quiter than in the original track and so on.

Anyway, I'm talking nuances here. My wife for example can't hear any difference at all.

Quote:
Originally Posted by Boulder View Post
I think audio enthusiasts prefer direct output anyway, i.e. without any dynamic compression or filtering in the decoder part.
Yes. Usually I use direct output on my Yamaha AVR. Unless it's in the middle of the night when I let it enhance dialogue level and reduce overall dynamic range.

Quote:
Originally Posted by Boulder View Post
I've never tested decoding a DTS-HD MA track to WAV and comparing it to the WAV track resulting from a FLAC file which was encoded from the DTS-HD MA track. It should be bit identical by nature.
From what I've read it should. And I read quite a lot before I decided to use FLAC a couple of years ago. Because I was under the impression I can't go wrong with FLAC. I still have a high fidelity lossless track which is always smaller than DTSHD/TrueHD, escpecially when going from 24 to 16bit.

So, that's why I started this topic. Because I simply can't explain myself why I hear these tiny differences.

That's why I was hoping for someone with a lot of knowledge about HD Audio to put my mind at ease.
And either tell me my AVR is just messing with me, or there is indeed some additional data in these tracks that can cause AVR's to produce a slightly different sound characteristic.
LeXXuz is offline   Reply With Quote
Old 17th July 2020, 19:35   #9  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
The audio data stored in a DTS-MA is bit-identical to the recoded FLAC.

Other question is how you can config your Audio Receiver to play one stream or other.

With the same configuration in your receiver you can't difference both.

Also you need a good audio equipment (receiver and speakers, much more than 1000 €) and good ears (golden ears) to difference a DTS-MA from a AC3 640 Kb/s
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 17th July 2020, 19:39   #10  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
HD-Audio to FLAC, or not?

To decode DTS to FLAC you need a library, perhaps that one is not the best in the world and the library used on the device to decode DTS is better than the one on your PC.

What do you use to decode DTS and encode in FLAC?

If the answer is eac3to, much better you switch to FFMPEG.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 17th July 2020, 22:50   #11  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
The libdcadec with eac3to to decode DTS-HD is the same included in ffmpeg (improved in ffmpeg to decode DTS-Express).

The output is bitidentical than the sources used to encode the DTS-MA (tested by me, and better until last bit than ArcSoft decoder with some rounding error).
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 18th July 2020, 00:18   #12  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,219
Speaking as somebody who likes listening to surround sound music, I used to re-encode every audio disc format (ie: Lossy DTS and Dolby Digital. Along with lossless DTS-HD MA, Dolby TrueHD and PCM) to FLAC.

Nowadays however, I only re-encode lossless PCM audio to FLAC. All the other audio formats I keep "as is". And place them within the .mka container.

And when it comes movie audio formats, I don't bother re-encoding them, I keep those "as is" too
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 18th July 2020, 07:57   #13  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by tebasuna51 View Post
The libdcadec with eac3to to decode DTS-HD is the same included in ffmpeg
Do spectrogram and bit to bit comparison of eac3to and new FFMPEG decoded material.

eac3to libraries are far obsolete.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 18th July 2020, 12:00   #14  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by tormento View Post
Do spectrogram and bit to bit comparison of eac3to and new FFMPEG decoded material.

eac3to libraries are far obsolete.
If I compare the eac3to decode and the ffmpeg decode and is different I must conclude than there are a regression in ffmpeg, because the eac3to decode is bitexact with source used to encode the DTD-MA.

The ffmpeg can decode DTS-Express and maybe manage better some errors, but can't improve a bitexact decode.

Quote:
Originally Posted by LeXXuz View Post
...to transcode HD-Audio to 16-bit FLAC
After re-read the first post I see your FLAC encode is only 16-bits, if the source is 24 bits you can listen a difference because the average human ear can difference until a precission of 20 bits
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 18th July 2020, 13:51   #15  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,718
Quote:
Originally Posted by tebasuna51 View Post
After re-read the first post I see your FLAC encode is only 16-bits, if the source is 24 bits you can listen a difference because the average human ear can difference until a precission of 20 bits
I'd still say ABX'ing that difference would require a lot of effort - something that won't be possible while watching a movie.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 18th July 2020, 14:04   #16  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by tebasuna51 View Post
the eac3to decode is bitexact with source used to encode the DTD-MA.
Need more information about this, considering eac3to AFAIK uses old FFMPEG avcodec-54.dll to decode DTS...
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 18th July 2020, 17:27   #17  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by tormento View Post
Need more information about this, considering eac3to AFAIK uses old FFMPEG avcodec-54.dll to decode DTS...
You are wrong, to decode DTS eac3to v3.34 uses libdcadec.dll

v3.30
* libDcaDec is now default for all DTS tracks except XSA / low bitrate
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 18th July 2020 at 17:35. Reason: add info
tebasuna51 is offline   Reply With Quote
Old 18th July 2020, 17:32   #18  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by Boulder View Post
I'd still say ABX'ing that difference would require a lot of effort - something that won't be possible while watching a movie.
Yes, of course my old ears can't listen the difference, but at least is possible in some circunstances.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 is offline   Reply With Quote
Old 18th July 2020, 18:44   #19  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by tebasuna51 View Post
to decode DTS eac3to v3.34 uses libdcadec.dll
Last commit 2 Jun 2016.

Please elaborate your theory of perfect decoding to source quality.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 18th July 2020, 19:52   #20  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by tormento View Post
Please elaborate your theory of perfect decoding to source quality.
Is not difficult to understand:

1) I make some wav (24 int 48000 samplerate) files sources

2) I encode that sources to DTS-MA's

3) Decode the DTS-MA's with eac3to libdcadec

4) Compare the output with sources, for instance with

FC /B source1.wav decoded1.wav

and they are bitexact.
__________________
BeHappy, AviSynth audio transcoder.
tebasuna51 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 07:53.


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