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
Register FAQ Calendar Today's Posts Search

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 26th July 2015, 20:07   #13381  |  Link
Thunderbolt8
Registered User
 
Join Date: Sep 2006
Posts: 2,197
is there a way to losslessly change wave/pcm files from 176kHz to flac? when I use the switches -override and -192000 nothing happens, the output flac file still has a sample rate of 176kHz

I can use -ResampleTo192000 but then I get the message "Reducing depth from 64 to 24 bits..." so I dont know if the outcome can still be considered lossless.
__________________
Laptop Lenovo Legion 5 17IMH05: i5-10300H, 16 GB Ram, NVIDIA GTX 1650 Ti (+ Intel UHD 630), Windows 10 x64, madVR (x64), MPC-HC (x64), LAV Filter (x64), XySubfilter (x64) (K-lite codec pack)
Thunderbolt8 is offline  
Old 26th July 2015, 20:20   #13382  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,782
I don't really understand your intentions ... FLAC is a lossless compressor for integer PCM samples without changing the attributes as long as they are supported. If it gets 176 kHz PCM as input, why should the FLAC compressed result have any other sampling rate than 176 kHz? There should be no reason that FLAC would support 192 kHz, but not 176 kHz.

If you wanted to resample 176 kHz to 192 kHz, this resampling won't be lossless. There will probably be a conversion using floating point values intermediately.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline  
Old 26th July 2015, 23:39   #13383  |  Link
Keiyakusha
契約者
 
Keiyakusha's Avatar
 
Join Date: Jun 2008
Posts: 1,576
Thunderbolt8
It will not be lossless. It is similar to converting pcm to MP3 then to FLAC (but far less destructive) where result is a lossless format that contains data that is no longer lossless. And btw, if you started with 16bit pcm, your result will not only be lossy, but an upscale too (in terms of bitdepth, not only sample count)
That said, I have no idea whether flac supports 176kHz, but I don't really see why it wouldn't. If for some reason it does not have support for it, you better use a different format that can handle it.

Last edited by Keiyakusha; 26th July 2015 at 23:45.
Keiyakusha is offline  
Old 27th July 2015, 05:08   #13384  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
According to the info here, the maximum bitdepth supported by flac is 32 bit. https://xiph.org/flac/faq.html#general__samples
It also states: FLAC supports linear sample rates from 1Hz - 655350Hz in 1Hz increments

Only I couldn't make a 32 bit flac file no matter what I did. I tried the command line and several GUIs and the best I could manage was an error message stating 32 bits per sample is unsupported.
Creating a 176kHz wave file was easy. Creating a 176kHz, 64 bit (float) wave file wasn't much harder (adding -full to the command line):

Quote:
eac3to v3.29
command line: "C:\Program Files\MeGUI\tools\eac3to\eac3to.exe" "E:\test.mkv" 2:"D:\T2_Audio - English.wav" -full -resampleTo176400 -progressnumbers
------------------------------------------------------------------------------
MKV, 1 video track, 1 audio track, 0:01:18, 24p /1.001
1: h264/AVC, English, 928x696 24p /1.001 (4:3)
2: AC3, English, 2.0 channels, 192kbps, 48kHz, dialnorm: -27dB
[a02] ac3, 48000, 2.0
[a02] Extracting audio track number 2...
[a02] Removing AC3 dialog normalization...
[a02] Decoding with libav/ffmpeg...
[a02] Resampling to 176.4kHz...
[a02] Writing WAV...
[a02] Creating file "D:\T2_Audio - English.wav"...
Video track 1 contains 1874 frames.
eac3to processing took 5 seconds.
Done.
But as soon as you tell eac3to to output a flac file (I tried different sample rates and it doesn't make any difference):

Quote:
eac3to v3.29
command line: "C:\Program Files\MeGUI\tools\eac3to\eac3to.exe" "E:\test.mkv" 2:"D:\T2_Audio - English.flac" -full -resampleTo176400 -progressnumbers
------------------------------------------------------------------------------
MKV, 1 video track, 1 audio track, 0:01:18, 24p /1.001
1: h264/AVC, English, 928x696 24p /1.001 (4:3)
2: AC3, English, 2.0 channels, 192kbps, 48kHz, dialnorm: -27dB
[a02] ac3, 48000, 2.0
[a02] Extracting audio track number 2...
[a02] Removing AC3 dialog normalization...
[a02] Decoding with libav/ffmpeg...
[a02] Resampling to 176.4kHz...
[a02] Reducing depth from 64 to 24 bits...
[a02] Encoding FLAC with libFlac...
[a02] Creating file "D:\T2_Audio - English.flac"...
Video track 1 contains 1874 frames.
eac3to processing took 14 seconds.
Done.
Reducing the bitdepth to something flac will play with makes sense, but is there any way to encode a 32 bit flac file as the flac help documents suggests it can?

Last edited by hello_hello; 27th July 2015 at 05:11.
hello_hello is offline  
Old 27th July 2015, 08:40   #13385  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,782
FLAC may be able to support up to 32 bit integer resolution by specification. But eac3to may limit the internal resolution to a sane amount of 24 bit:

Most PCM audio streams may have only 16 or at most 24 bit per sample integer resolution. If you have a lossy format based on frequency spectrum subbands, you will usually have encoded 32-bit floating point values, which have a mantissa precision of 24 bit (see IEEE floating point specs regarding "Single Precision Float"). Even if eac3to converts audio to "Double Precision Float" (64 bit overall, 53 bit mantissa), the original samples still had at most 24 bit precision (rather less in less-than-maximum-volume scenes), therefore it doesn't make sense to waste more than 24 bits after any conversion.

I doubt you will ever get your hands on PCM samples with true 32 bit integer resolution.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline  
Old 27th July 2015, 09:14   #13386  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Quote:
Originally Posted by Smithy View Post
Terminator 2 Judgment Day Skynet Edition 1991 Blu-ray 1080p EUR VC-1 DTS-HD MA

eac3to v3.29 (dcadec)

M2TS, 2 video tracks, 9 audio tracks, 19 subtitle tracks, 2:17:19, 24p /1.001
6: DTS Master Audio, German, 7.1 channels, 24 bits, 48kHz
(core: DTS, 5.1 channels, 1509kbps, 48kHz)
[a06] dts, 48000, 7.1
[a06] Extracting audio track number 6...
[a06] Decoding with libDcaDec DTS Decoder...
[a06] Writing WAVs...
[a06] The libDcaDec DTS Decoder reported the error "Bitstream navigation error" while decoding. <ERROR>
Aborted at file position 16039026688. <ERROR>
Can you provide a small sample with which I could reproduce the issue? Then I can report this to the dcadec developer.
madshi is offline  
Old 27th July 2015, 10:07   #13387  |  Link
Smithy
Registered User
 
Join Date: Apr 2015
Location: Germany
Posts: 20
Quote:
Originally Posted by madshi View Post
Can you provide a small sample with which I could reproduce the issue? Then I can report this to the dcadec developer.
maybe, i will find and check the runtime of aborted position.

the demuxxed dtshd has other file aborted position. ^^

eac3to v3.29

DTS Master Audio, 7.1 channels, 24 bits, 48kHz
(core: DTS, 5.1 channels, 1509kbps, 48kHz)
dts, 48000, 7.1
Decoding with libDcaDec DTS Decoder...
Writing WAV...
Creating file "V:\00018.mpls_6ger.dtshd_.wav"...
The libDcaDec DTS Decoder reported the error "Bitstream navigation error" while decoding. <ERROR>
Aborted at file position 1368129536. <ERROR>
__________________
32bit Vista SP2 (DX11 Platform Update), Nvidia GTX960 4GB AMP (365.19), 1. 27' FHD Benq / 2. 65' UHD HDR Sony XE93, madVR 0.92.17, LAV 0.73.1, MPC-HC 1.8.3
Smithy is offline  
Old 27th July 2015, 10:14   #13388  |  Link
Thunderbolt8
Registered User
 
Join Date: Sep 2006
Posts: 2,197
Quote:
Originally Posted by LigH View Post
I don't really understand your intentions ... FLAC is a lossless compressor for integer PCM samples without changing the attributes as long as they are supported. If it gets 176 kHz PCM as input, why should the FLAC compressed result have any other sampling rate than 176 kHz? There should be no reason that FLAC would support 192 kHz, but not 176 kHz.

If you wanted to resample 176 kHz to 192 kHz, this resampling won't be lossless. There will probably be a conversion using floating point values intermediately.
I want to concert a DSD (.DFF) audio file losslessly to Flac, because Winamp cant play DSD and the wasapi Plugin cannot play flac files with 176 kHz (only 96 and 192; also no 32-bit flac files; and no, i dont want to change my audio player)
__________________
Laptop Lenovo Legion 5 17IMH05: i5-10300H, 16 GB Ram, NVIDIA GTX 1650 Ti (+ Intel UHD 630), Windows 10 x64, madVR (x64), MPC-HC (x64), LAV Filter (x64), XySubfilter (x64) (K-lite codec pack)

Last edited by Thunderbolt8; 27th July 2015 at 10:23.
Thunderbolt8 is offline  
Old 27th July 2015, 10:15   #13389  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Quote:
Originally Posted by Smithy View Post
maybe, i will find and check the runtime of aborted position.
If all else fails, you can encrypt and upload the whole DTS file and PM me the download address. I can then cut a sample for the dcadec dev.
madshi is offline  
Old 27th July 2015, 10:24   #13390  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,347
Quote:
Originally Posted by Thunderbolt8 View Post
I want to concert a DSD (.DFF) audio file losslessly to Flac, because Winamp cant play DSD and the wasapi Plugin cannot play flac files with 176 kHz (only 96 and 192; also no 32-bit flac files; and no, i dont want to change my audio player)
You cannot convert DSD to FLAC lossless. There is always going to be a loss when converting DSD to PCM, or vice-versa.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline  
Old 27th July 2015, 10:24   #13391  |  Link
Smithy
Registered User
 
Join Date: Apr 2015
Location: Germany
Posts: 20
Quote:
Originally Posted by madshi View Post
If all else fails, you can encrypt and upload the whole DTS file and PM me the download address. I can then cut a sample for the dcadec dev.
i found the position and here is 1 min sample.
http://workupload.com/file/5ppYHVxe
__________________
32bit Vista SP2 (DX11 Platform Update), Nvidia GTX960 4GB AMP (365.19), 1. 27' FHD Benq / 2. 65' UHD HDR Sony XE93, madVR 0.92.17, LAV 0.73.1, MPC-HC 1.8.3

Last edited by Smithy; 27th July 2015 at 10:29.
Smithy is offline  
Old 27th July 2015, 11:17   #13392  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Quote:
Originally Posted by LigH View Post
FLAC may be able to support up to 32 bit integer resolution by specification. But eac3to may limit the internal resolution to a sane amount of 24 bit:
I think the libflac encoder eac3to uses is limited to 24 bit in the first place. Does an alternative encoder to that even exist?
But as you say: it's probably that way because it's sane.
sneaker_ger is offline  
Old 27th July 2015, 11:23   #13393  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Quote:
Originally Posted by Smithy View Post
i found the position and here is 1 min sample.
http://workupload.com/file/5ppYHVxe
Thanks. I've reported it to the dcadec dev.
madshi is offline  
Old 27th July 2015, 11:39   #13394  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,782
Quote:
Originally Posted by sneaker_ger View Post
I think the libflac encoder eac3to uses is limited to 24 bit in the first place. Does an alternative encoder to that even exist?
Any independent flac.exe or libflac.dll based on official sources:

https://sourceforge.net/projects/flac/
http://www.rarewares.org/lossless.php
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline  
Old 27th July 2015, 11:41   #13395  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
I meant an alternative encoder that encodes to FLAC format but is not based on libFLAC. (And that supports 32 bit encoding)

Last edited by sneaker_ger; 27th July 2015 at 11:50.
sneaker_ger is offline  
Old 27th July 2015, 11:53   #13396  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,782
Please excuse the counter-question ... but: Would there be any reason to spend any time on re-programming an OpenSource software with a rather tolerant free license?

I don't know any source adoption as freely available as the reference implementation by Xiph.org yet.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline  
Old 27th July 2015, 12:24   #13397  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,347
Quote:
Originally Posted by LigH View Post
Would there be any reason to spend any time on re-programming an OpenSource software with a rather tolerant free license?
Often its a good idea to have independent implementations, as it can drive new ideas and improvements. For FLAC, FFmpeg has an independent decoder and encoder, but it seems limited to 24-bit as well.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline  
Old 27th July 2015, 14:36   #13398  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
Quote:
Originally Posted by LigH View Post
FLAC may be able to support up to 32 bit integer resolution by specification. But eac3to may limit the internal resolution to a sane amount of 24 bit....

I doubt you will ever get your hands on PCM samples with true 32 bit integer resolution.
What's the definition of "true 32 bit integer resolution"?
I can make a 32 bit wave file easily enough with Audacity. I think. This is 32 bit integer isn't it?

Quote:
General
CompleteName : D:\test.wav
Format : Wave
FileSize/String : 12.2 MiB
Duration/String : 9s 59ms
OverallBitRate_Mode/String : Constant
OverallBitRate/String : 11.3 Mbps

Audio
Format : PCM
Format_Settings_Endianness : Little
Format_Settings_Sign : Signed
CodecID : 1
Duration/String : 9s 59ms
BitRate_Mode/String : Constant
BitRate/String : 11.3 Mbps
Channel(s)/String : 2 channels
SamplingRate/String : 176.4 KHz
BitDepth/String : 32 bits
StreamSize/String : 12.2 MiB (100%)
I tried both versions of flac you linked to as well as the version on the flac website, and wherever version foobar2000 is using that doesn't seem to like 32 bit integer either.



Audacity is the only program I have installed that'll output a 32 bit integer wave file. The other programs such as foobar2000 seem to want to output a 32 bit float wave file.
You're right though, anything over 24 bit for a flac file would definitely be overkill. I was just curious to try it when I read Thunderbolt8's question.

I don't know much about DSD, but according to Wikipedia it's comparable to 20 bit, 96kHz PCM, so a 24 bit flac file should be quite adequate.

Last edited by hello_hello; 27th July 2015 at 14:41.
hello_hello is offline  
Old 27th July 2015, 15:17   #13399  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,782
Quote:
Originally Posted by hello_hello View Post
What's the definition of "true 32 bit integer resolution"?
I can make a 32 bit wave file easily enough with Audacity. I think. This is 32 bit integer isn't it?
So you want to convert 24 bit PCM to 32 bit PCM ... You can stuff the 8 lsb with 0-bits. The result still has at most 24 bit precision.

I rather mean: I wonder if there is any hardware recording audio with up to 32 bit precision. But I doubt that there are many 32-bit ADC (analogue-digital convertors) available, as well as I doubt there are many microphones with a sensitivity required to record with 32 bit precision.

IMHO, there are physical and electronical limits which would make audio recording with 32 bit precision very improbable. And even if, the "noise carpet" on any realistic movie set (not in "deaf rooms", not for synthetic sounds) would probably be high enough to return a signal-to-noise ratio even below the 24 bit treshold (don't remember exactly where it was, 120 dB?).

So in most practical cases, 32 bit precision would be an illusion, lying on a big fluffy carpet of noise.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid

Last edited by LigH; 27th July 2015 at 15:19.
LigH is offline  
Old 27th July 2015, 21:03   #13400  |  Link
ZMachine95
Registered User
 
Join Date: Feb 2015
Posts: 6
BDMV eac3to pipe ffmpeg

hello guys and girls, I would like to convert some BDMV's folders. I would like to use eac3to to to get the correct mpls file and send all tracks on ffmpeg stdin and convert.

I have thought about using something like that..

Quote:
eac3to J:\BDMV\ 1) stdout.mkv | ffmpeg.exe -hwaccel auto -y -i - -map 0:v:0 -c:v libx265 -crf 20.0 -preset veryfast -map 0:a:0 -c:a:0 libvorbis -b:a:0 192k -map 0:a:1 -c:a:1 libvorbis -b:a:1 192k -map 0:s:0 -c:s:0 copy -map 0:s:1 -c:s:1 copy -map 0:s:2 -c:s:2 copy "H:\output.mkv"
but it doesn't work. If I use only stdout.h264 the video track is piped to ffmpeg and converted.

What am I doing wrong? or there is a fast way to do that?... I don't actually have to use only ffmpeg and eac3to..

thanks guys

Last edited by ZMachine95; 27th July 2015 at 21:07.
ZMachine95 is offline  
Closed Thread

Tags
eac3to


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 13:47.


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