Re: flac 1.40 verses ffmpeg

Martijn van Beurden <[email protected]> Tue, 27 Sep 2022 15:07:32 +0200
Newsgroups gmane.comp.audio.compression.flac.user
Message-ID <CADQbU6_OMVBKLa8hJ0dd4+jSJMfv5C9n8ifwuL9rAnDizEt90w@mail.gmail.com>
--===============5612757676627461696==
Content-Type: multipart/alternative; boundary="00000000000075e74f05e9a8547f"

--00000000000075e74f05e9a8547f
Content-Type: text/plain; charset="UTF-8"

Op di 27 sep. 2022 om 14:22 schreef Michael D. Lawler <[email protected]>:

> My conclusion is that ffmpeg's library is doing something that -e
> does, but not using a lot of CPU so perhaps this could be studied and
> flac could be updated to improve compression further with reasonable
> CPU usage.  I have all of the files and could provide the ones where
> -e is necessary and the few where ffmpeg still does better with -8pe
> --lax -l 32.
>


One important difference between libflac and ffmpeg is that they use
different blocksizes. FLAC as you've used it will default to blocksize 4096
no matter what sample rate the input is. ffmpeg will adapt its blocksize to
the samplerate. For 44.1kHz and 48kHz, it uses blocksize 4608. In the past
it has been shown this benefits certain kinds of music, but the 4096 used
by libflac does better for others. ffmpeg uses a larger blocksize for
higher samplerates and a smaller blocksize for lower samplerates. This
might be the reason you're seeing this difference.

Perhaps you can find out what the sample rates are of the files that ffmpeg
compresses better than libflac. If those are mainly 44.1kHz or 48kHz, you
can try to improve on it with libFALC by adding -b 4608

Kind regards, Martijn van Beurden

--00000000000075e74f05e9a8547f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail=
_attr">Op di 27 sep. 2022 om 14:22 schreef Michael D. Lawler &lt;<a href=3D=
"mailto:[email protected]">[email protected]</a>&gt;:<br></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px=
 solid rgb(204,204,204);padding-left:1ex">My conclusion is that ffmpeg&#39;=
s library is doing something that -e <br>
does, but not using a lot of CPU so perhaps this could be studied and <br>
flac could be updated to improve compression further with reasonable <br>
CPU usage.=C2=A0 I have all of the files and could provide the ones where <=
br>
-e is necessary and the few where ffmpeg still does better with -8pe <br>
--lax -l 32.<br></blockquote><div><br></div><div><br></div><div>One importa=
nt difference between libflac and ffmpeg is that they use different blocksi=
zes. FLAC as you&#39;ve used it will default to blocksize 4096 no matter wh=
at sample rate the input is. ffmpeg will adapt its blocksize to the sampler=
ate. For 44.1kHz and 48kHz, it uses blocksize 4608. In the past it has been=
 shown this benefits certain kinds of music, but the 4096 used by libflac d=
oes better for others. ffmpeg uses a larger blocksize for higher samplerate=
s and a smaller blocksize for lower samplerates. This might be the reason y=
ou&#39;re seeing this difference.</div><div><br></div><div>Perhaps you can =
find out what the sample rates are of the files that ffmpeg compresses bett=
er than libflac. If those are mainly 44.1kHz or 48kHz, you can try to impro=
ve on it with libFALC by adding -b 4608</div><div><br></div><div>Kind regar=
ds, Martijn van Beurden <br></div></div></div>

--00000000000075e74f05e9a8547f--

--===============5612757676627461696==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Flac mailing list
[email protected]
http://lists.xiph.org/mailman/listinfo/flac

--===============5612757676627461696==--