I'm trying to convert a 24-bit W64 to 16-bit FLAC.
How can I do this with the FLAC command-line tool?
P.S. a 24-bit FLAC is just too large; that's why I'm converting it to 16-bit.
+ Reply to Thread
Results 1 to 14 of 14
-
-
I have no idea how you can do it with FLAC command line, but with foobar2000, you can select FLAC in the output file format and then choose output bit depth.
"The greatest trick the Devil ever pulled was convincing the world he didn't exist." -
-
"The greatest trick the Devil ever pulled was convincing the world he didn't exist."
-
-
Lossy conversion (requantization with noisehaped dither) to lossless flac.
Code:@ffmpeg -threads %NUMBER_OF_PROCESSORS%*1.5 -i %1 -vn -c:a flac -compression_level 12 -af "aresample=resampler=soxr:dither_method=shibata,aformat=sample_fmts=s16" %1_16.flac
Noise shaping is available for limited set of sampling frequencies (for anything higher than 48ksps - in example case noiseshaping "Shibata" was replaced by regular High Pass TPDF - for "normal" sampling frequencies noisehaping will made virtually lossy free requantization). In most of cases lossy transformation is transparent (from human auditory perspective).
Original
[Attachment 30469 - Click to enlarge]
16 bit
[Attachment 30470 - Click to enlarge]Last edited by pandy; 27th Feb 2015 at 06:27.
-
-
It use FLAC library so it is like flac converter tool.
Try it, listen, verify with your signal lineup - usually this kind of processing may be applied at the final stage of processing and for sure if this is possible then you should keep 24 bit for archiving purposes (but for example this processing may be applied to files where target is your portable player then set of reduced size files may be created in such way). -
I see. Guess I should've known.
It's just too many commands and I don't really know what they're doing. By the way, I'm doing it for temporary playback purposes, not permanent archiving, so 16-bit is fine.
I thought maybe there could be a simple command for flac or ffmpeg, like how eac3to has. It's really simple in eac3to:
eac3to input1 output -down16.
I just don't want to use it for flac because it's quite old now.
Maybe I should stick to foobar. I'm just too dumb for all these stuff.Last edited by eddman; 27th Feb 2015 at 08:25.
-
It doing conversion from whatever source to flac 16 bit, no sample rate conversion is applied, only signal is requantized (if necessary) with applied noiseshaping (when it is possible).
Create text file with extension like cmd or bat, copy sequence, download latest zeranoe static ffmpeg win32 build and use it (drag file over batch), with few changes folders can be automatically converted, alternatively search for some universal GUI, put same command line and use as regular application. -
I meant that at least I should learn what they do, or it'd be kind of pointless.
-threads %NUMBER_OF_PROCESSORS%*1.5: This is clear, but I don't get the "*1.5" part.
-i %1: input file
-vn: don't know what this is.
-c:a flac: output flac?
-compression_level 12: Is this the quantization part you mentioned?
-af "aresample=resampler=soxr:dither_method=shibata,af ormat=sample_fmts=s16" %1_16.flac: I have no idea. -af? soxr? dither? shibata? I think "sample_fmts=s16" tells it to convert to 16-bit, right?Last edited by eddman; 27th Feb 2015 at 08:53.
-
http://environmentvariables.org/Number_Of_Processors (from some unknown reason in my configuration forcing threads by factors 1.5 works better) - you may ignore this and left decision to software
%1 is command line parameter http://www.robvanderwoude.com/parameters.php in this case this is filename with extension
-vn means no video (only audio is processed well documented in ffmpeg doc)
-c:a flac - yes, codec:audio flac
-compression_level 12 - no this is tell flac library to really work hard to compress data as much as possible (value 12 is a bit not specified but it works fine for me and it provide lower file size always)
-af - audiofilter, aresample is filter responsible for resampling but in this case we not changing sample rate - we use only dither part in resampler, =resample=soxr is sox resampling library - considered as one of best (details are available on ffmpeg and on sox pages),
dither_method=shibata is dither with particular noiseshaping (it reduces perceived noise even if overall noise level is higher - noise is tuned to average human auditory sensitivity, shibata is curve, there is few others for details go to sox documentation),
aformat=sample_fmts=s16 - yes - this is where 16 bit signed PCM is requested. -
-
You welcome, and yes - dither is required from subjective and objective perspective (with some exception but they are limited - coherent sampling, fixed quantization levels) - it remove or significantly reduce quantization errors correlated with signal (partially responsible for "metallic sound" of first CD's) - probably best explanation http://www.youtube.com/watch?v=cIQ9IXSUzuM - proof that you can store signal with fractional bit resolution i.e. less than 1 bit (that's why 24 bit to 16 bit under some assumption may be considered as virtually lossless).
Last edited by pandy; 27th Feb 2015 at 12:48.