HydrogenAudio

Lossless Audio Compression => FLAC => Topic started by: apastuszak on 2015-09-27 17:56:32

Title: FLAC command line options to convert stereo to mono
Post by: apastuszak on 2015-09-27 17:56:32
I ripped The Beatles in Mono to FLAC.  Even though the tracks are "mono," they're actually stereo, with each channel being identical.  Is there some flac command line magic I can do to knock them down to one channel without having to re-rip everything?  Seems a waste of space to have "mono" tracks at twice the size they need to be.
Title: FLAC command line options to convert stereo to mono
Post by: ktf on 2015-09-27 18:57:38
You can't do that with the FLAC command line tool (as it only does lossless operations), you'll have to use something like SoX or another tool. This is intended behaviour.
Title: FLAC command line options to convert stereo to mono
Post by: lvqcl on 2015-09-27 18:59:39
There will be no difference in file size between mono and dual-mono FLAC files.
Title: FLAC command line options to convert stereo to mono
Post by: apastuszak on 2015-09-27 20:08:44
There will be no difference in file size between mono and dual-mono FLAC files.


Why would there be no difference?  Shouldn't a mono file only have one channel in it, vs the two in there now?
Title: FLAC command line options to convert stereo to mono
Post by: Apesbrain on 2015-09-27 20:22:08
There will be no difference in file size between mono and dual-mono FLAC files.

I would never have suspected that but sure enough.  Same mono file converted to "stereo":

1-channel: 18.6 MB (19 520 182 bytes)
2-channel: 18.6 MB (19 532 503 bytes)
Title: FLAC command line options to convert stereo to mono
Post by: Octocontrabass on 2015-09-27 20:38:20
FLAC is pretty clever. If you're using the default compression level (5) or higher, it will detect that left and right are identical, and save space by only compressing a single channel of audio. (It can also do this at some of the lower compression levels, but not all of them. You might get a smaller file at level 2 than at level 3, for example.)
Title: FLAC command line options to convert stereo to mono
Post by: apastuszak on 2015-09-27 20:44:22
FLAC is pretty clever. If you're using the default compression level (5) or higher, it will detect that left and right are identical, and save space by only compressing a single channel of audio. (It can also do this at some of the lower compression levels, but not all of them. You might get a smaller file at level 2 than at level 3, for example.)


Gotcha!  Thanks for the info.
Title: FLAC command line options to convert stereo to mono
Post by: ktf on 2015-09-28 08:47:38
I would never have suspected that but sure enough.

Why not? Stereo decorrelation is perhaps the easiest way to losslessly compress a file.
Title: FLAC command line options to convert stereo to mono
Post by: mjb2006 on 2015-09-28 21:48:09
You may find that the Beatles material is actually 99-point-something percent mono, being identical channels when mastered at 24/96 or whatever, but then made different due to dither added during conversion to consumer formats.

There was some discussion of this previously in these threads:
http://www.hydrogenaud.io/forums/index.php?showtopic=77630 (http://www.hydrogenaud.io/forums/index.php?showtopic=77630)
http://www.hydrogenaud.io/forums/index.php?showtopic=107566 (http://www.hydrogenaud.io/forums/index.php?showtopic=107566)