[flac-dev] C API: How to get a seektable for very long files?

Stefan Oltmanns stefan-oltmanns at gmx.net
Sun Oct 20 15:50:26 UTC 2024


Am 20.10.24 um 14:44 schrieb Martijn van Beurden:
> Op zo 20 okt 2024 om 03:08 schreef Stefan Oltmanns <stefan-oltmanns at gmx.net>:
>>
>> I'm not sure what else there could be in "STREAMINFO_EXT" except for
>> total samples and sample rate, but maybe there is some other use for (at
>> least partially) backward-compatible flac extensions.
>>
>> Adding that to ffmpeg would also be rather simple.
>>
>
> As with any such change, it will take a lot of time to bring all
> applications up to date. As you say, a lot of applications use
> ffmpeg/libavcodec instead.

Why would that take time? As soon as there is the new libFLAC /
libavcodec in the system applications would be good, don't even require
recompiling (as long as the library version remains the same). For my
testing I did not change the flac application at all, just libFLAC.

(of course applications that ship their own libFLAC/libavcodec would
have to update those)

>
> A much easier solution, which works with ffmpeg right out of the box,
> even with older distributions (such as Ubuntu 22.04 you mention) is to
> use the wavpack codec instead of flac. It supports samplerates up to 1
> GHz, has an arguably better way of seeking, supports a 40 bit number
> for samples and has a non-perceptual lossy option which might actually
> work very well for your usecase.

There is a massive downside to wavpack: Even in fastest mode I could
find (wavpack -f -x0) it is three times slower than "flac -1", making
real-time encoding difficult.
For decoding it's the same: takes three times longer.

Additionally for FLAC there is a chance of GPU-assisted real-time
high-compression encoding with flaccl (unfortunately that is written in
C# as part of a larger tool set and needs porting to C for general
usability)

>
> A lot of editing applications supporting FLAC also support Wavpack,
> often through ffmpeg. The only downsides are that the 40 bit sample
> number seems a hard limit and decoding is a bit slower. The 40-bit
> number still correlates to 7.5 hours at 40MHz though.

That could be a real issue, VHS recordings in LP (PAL) or SLP (NTSC)
mode can exceed 10 hours

Best regards
Stefan


More information about the flac-dev mailing list