Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: wrong length reported in he-aac mp4 files (Read 6917 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

wrong length reported in he-aac mp4 files

Hi.
I transcode all my music files to HE-AAC M4A files (-q 0.29), and when I use foobar, all is good.
The problem starts when I try to use them in linux. In all gstreamer-based apps, the length gets calculated wrong, and the player skips the last seconds of the song. When using amarok (with xine engine), the length is displayed wrong also, but plays even past the supposed duration of the song, so no harm. However, amarok doesn't read certain "genre" tags, they all fall into "unknown".

The duration problem started with foobar 0.9, using "neroaacenc.exe". 0.8.x didn't need the cli encoder, and it worked fine. Now half my collection doesn't play well in linux.
I noticed VLC for windows also reads the duration wrong, so maybe it's not limited to linux.

Thanks for the help.

wrong length reported in he-aac mp4 files

Reply #1
personally, i've experianced a similar problem with mplayer where the length is read wrong. it also plays past the end. however, this file was an mp4 file with video and audio in it. on mplayer(which is what i use), i used mplayer -demuxer lavf in order to fix the length. not sure if this will work but you might as well try.

wrong length reported in he-aac mp4 files

Reply #2
It seems that the written length in the mp4 file is incorrect, when recalculating the length from the tables in the mp4 file it is right. This is why some players report it incorrectly and why some report it correctly...
We're looking to fix this for the next release.

wrong length reported in he-aac mp4 files

Reply #3
It seems that the written length in the mp4 file is incorrect, when recalculating the length from the tables in the mp4 file it is right. This is why some players report it incorrectly and why some report it correctly...
We're looking to fix this for the next release.


Will there be an easy way to fix the files without recompressing them? A big part of my collection is like that, re-encoding them all would be a pita...
Edit: any estimates about a release date for the new version?

 

wrong length reported in he-aac mp4 files

Reply #4
The problem I had was that iTunes would see the correct time when the file had a .mp4 ext, but thought it was twice as long when it was renamed .m4a or .m4b (I'd encoded an audiobook and wanted iTunes to load the file to its audiobooks section).
The output from mp4box -info was
* Movie Info *
   Timescale 1000 - Duration 10:16:00.817
   Fragmented File no - 1 track(s)
   File Brand 3gp6 - version 0
   Created: GMT Tue Apr 17 00:37:24 2007

File has root IOD
Scene PL 0xff - Graphics PL 0xff - OD PL 0xff
Visual PL: No visual capability required (0xff)
Audio PL: No audio capability required (0xff)
No streams included in root OD

Chapters:
   Chapter #1 - 00:00:00.105 - ""

iTunes Info:
   Encoder: Nero AAC codec / Feb 12 2007

Track # 1 Info - TrackID 1 - TimeScale 44100 - Duration 10:21:54.282
Media Info: Language "Undetermined" - Type "soun" - Sub Type "mp4a" - 803497 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio AAC LC - 1 Channel(s) - SampleRate 22050 - SBR SampleRate 44100
Self-synchronized

Perhaps some problem with the TimeScale?

I found you simply need to extract the audio as raw aac and then remux to an mp4 it to get iTunes to see the correct length no matter what extension you use. This can be done in YAMB.