Skip to main content
Topic: Get duration of raw AAC file (Read 206 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Get duration of raw AAC file

I was wondering if Foobar2000 can handle raw AAC with no duration tag by other ways, so it would show an duration, and be able to seek.

Plenty of other media players can handle such file, so I suppose it is possible.

A sample file is provided below.

Thank you!

Re: Get duration of raw AAC file

Reply #1
It's possible by completely parsing the file end to end every time it's opened. The input doesn't even do this for MP3 files, instead relying on the Xing/LAME header to determine the correct duration.

Re: Get duration of raw AAC file

Reply #2
How does Mp3DirectCut do it? It doesn't seem to play well with multichannel AAC, but raw stereo VBR AAC opens very quickly (so I assume parsing shouldn't take long) and it tends to show the duration more accurately than fb2k does for DTS. That seems odd to me given DTS is usually constant bitrate (the DTS decoder DSP and decoding with ffmpeg are the same).

I was in the middle of re-encoding a stereo DTS movie soundtrack while reading this, so I compared the reported durations.

Fb2k raw DTS    1:22:45:616
Fb2k DTS in MKA    1:24:14:464
Fb2k after converting to M4A/AAC    1:24:14:464
Mp3DirectCut raw VBR AAC    1:24:33:545
MediaInfo GUI raw DTS    1h 24 min

Re: Get duration of raw AAC file

Reply #3
Other software usually reads a limited fragment of the whole file to estimate the average bitrate. Mp3DirectCut reads 5 MB and then reads more as I scroll on the timeline, XMPlay without the option to pre-scan in the plugin settings reads 128 K, Winamp 5 64 K. The parsing time is not that noticeable from a harddisk, but I would definitely prefer inaccurate time over the whole file needing to be read from CD or network.

With this constant bitrate sample file, Mp3DirectCut is off by 3 minutes over 16 hours in its estimate (I appended the aac to itself).

If you don't need "HD" decoding, revert to the old and stable DTS decoder plugin.

Re: Get duration of raw AAC file

Reply #4
Thanks j7n.
Luckily I did still have an old version of the DTS decoder plugin (0.5.5), and yes it does report the length accurately. I'll still with the old version as I assume ffmpeg supports HD decoding, so I'd be able to switch to it if need be.

SimplePortal 1.0.0 RC1 © 2008-2020