Log in

View Full Version : How to convert DTS and PCM audios to FLAC on Linux


bjoker
15th September 2020, 19:00
Hi,

I need to convert DTS and PCM audios to FLAC on Linux using libflac 1.3.3 (not with in-built FLAC of ffmpeg).

test $ ffmpeg -version
ffmpeg version 4.1.6-1~deb10u1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)

test $ flac --version
flac 1.3.3
test $


So I tried various ways and all of them throw errors (even with "-s" option)

ffmpeg -i Test.dts -f wav - | flac - -o Test.flac

ffmpeg -i title_t01.mkv -vn -map 0:a:0 -f wav - | flac -s --ignore-chunk-sizes -8 - -o title.flac

ffmpeg -i title_t01.mkv -vn -map 0:a:0 -f wav - | flac -8 - -o title.flac


Getting various errors like - (even with different compression levels)
WARNING: unexpected EOF; expected 1073741823 samples, got 549924864 samples
WARNING: skipping unknown chunk 'LIST' (use --keep-foreign-metadata to keep)
WARNING: 'data' chunk has non-zero size, using --ignore-chunk-sizes is probably a bad idea


Also, using flac without ffmpeg doesn't work for DTS audio as it can't figure --endian, --sign, --channels, --bps, and --sample-rate values on its own.
Able to do this on Windows using eac3to without any issues but not on Linux. It's a shame there's no eqc3to equivalent on Linux. :(

Could anyone please advise correct CLI method please?

:thanks:

richardpl
15th September 2020, 19:41
You want closed source, unmaintained software on linux? Yes you get what you wish for....

SeeMoreDigital
15th September 2020, 22:19
Out of interest....

Are your DTS sources 6-channel or 2-channel?

Richard1485
15th September 2020, 22:25
I don't really understand why you are avoiding ffmpeg's flac encoder, but eac3to runs fine for me under Wine stable on Debian 10. You could also try SoX (http://sox.sourceforge.net/Docs/Features).

bjoker
15th September 2020, 23:22
Out of interest....

Are your DTS sources 6-channel or 2-channel?

Ofcourse 2-channel. I prefer FLAC only for mono & stereo.

I don't really understand why you are avoiding ffmpeg's flac encoder, but eac3to runs fine for me under Wine stable on Debian 10. You could also try SoX (http://sox.sourceforge.net/Docs/Features).

Thanks for pointing SoX - will try it :)

You want closed source, unmaintained software on linux? Yes you get what you wish for....

where did I say I "want" an unmaintained software with closed source, ? I just asked how could I use FLAC (https://xiph.org/flac/) command line on Linux to convert PCM/DTS to FLAC. I hate M$$ Windows and can't help but praise eac3to as it's very tiny tool that does wonders. I couldn't figure any free/open-source tool on Linux which does what eac3to is capable of (TSMuxeR does only few things)

Selur
21st September 2020, 11:02
iirc correctly the problem is with ffmpeg not properly writing wav chunk sizes.
I usualy use:
ffmpeg | sox | flac
for example:
ffmpeg -y -threads 8 -loglevel fatal -nostdin -i "E:\Temp\iId_1_aid_1_2020-09-21@11_53_34_1510_01.mp3" -ac 2 -ar 48000 -f sox - | sox --multi-threaded --temp "E:\Temp\2020-09-21@11_53_34_151001" --buffer 524288 -S -t sox - --endian little -b 24 -t wav - | flac -f -F --ignore-chunk-sizes -5 -o "E:\Temp\iId_1_aid_1_2020-09-21@11_53_34_1510_02.flac" -
(this should work on Windows/Mac/Linux; here sox is just used to rewrap the content into proper wav)

Cu Selur

Ps.: depending on how you compile sox you could probably just use sox and not use ffmpeg and flac.

Helg1980
21st September 2020, 14:00
Try Simplest Studio:

https://www.pling.com/p/1423148/