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 15th September 2020, 19:00   #1  |  Link
bjoker
Registered User
 
Join Date: Jan 2013
Posts: 50
How to convert DTS and PCM audios to FLAC on Linux

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).

Quote:
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)

Quote:
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)
Quote:
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?


Last edited by bjoker; 15th September 2020 at 19:16.
bjoker is offline   Reply With Quote
Old 15th September 2020, 19:41   #2  |  Link
richardpl
Registered User
 
Join Date: Jan 2012
Posts: 272
You want closed source, unmaintained software on linux? Yes you get what you wish for....
richardpl is offline   Reply With Quote
Old 15th September 2020, 22:19   #3  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,219
Out of interest....

Are your DTS sources 6-channel or 2-channel?
__________________
| 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 15th September 2020, 22:25   #4  |  Link
Richard1485
Guest
 
Posts: n/a
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.
  Reply With Quote
Old 15th September 2020, 23:22   #5  |  Link
bjoker
Registered User
 
Join Date: Jan 2013
Posts: 50
Quote:
Originally Posted by SeeMoreDigital View Post
Out of interest....

Are your DTS sources 6-channel or 2-channel?
Ofcourse 2-channel. I prefer FLAC only for mono & stereo.

Quote:
Originally Posted by Richard1485 View Post
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.
Thanks for pointing SoX - will try it

Quote:
Originally Posted by richardpl View Post
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 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)
bjoker is offline   Reply With Quote
Old 21st September 2020, 11:02   #6  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,259
iirc correctly the problem is with ffmpeg not properly writing wav chunk sizes.
I usualy use:
ffmpeg | sox | flac
for example:
Code:
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.
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 21st September 2020, 14:00   #7  |  Link
Helg1980
Registered User
 
Join Date: Jul 2020
Posts: 13
Try Simplest Studio:

https://www.pling.com/p/1423148/
Helg1980 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 06:10.


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