"Fran Burstall (Gmail)" <[email protected]> writes: > On Tue, 29 Nov 2022 at 22:18, Yoni Rabkin <[email protected]> wrote: > >> >> I think that the problem is that most files out there do not encode the >> song duration at all. My guess is that various tools do some kind of >> calculation to try and figure out how long the track is based on frame >> length and the number of frames. >> >> You can hexl-mode some of the files in question and see how many of them >> have TLEN at the start. I just checked two files at random in my >> collection and found no song duration in the header. >> >> If this is true, we'll have to add that type of approximation >> calculation to emms-info-native. >> >> > I think you may be right. I just had a look at the source of tinytag and > it does quite lengthy computations to arrive at the duration. > > Who knew?
I guess that if the file has a variable bit rate, you couldn't just use the number of frames and sampling rate to make that calculation. But that wouldn't make sense for huge video files, as you would need to read the entire thing. The one large webm file (6.3GB) I have to hand here has its video length encoded in the header. So if we implement it, we would need to have a cut-toff that ignores files over a certain size. -- "Cut your own wood and it will warm you twice"
