Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mp4info - Wrong duration value? #18

Open
sandreas opened this issue Sep 23, 2022 · 4 comments
Open

mp4info - Wrong duration value? #18

sandreas opened this issue Sep 23, 2022 · 4 comments

Comments

@sandreas
Copy link

Hey @enzo1982,

recently I had an issue in m4b-tool, where mp4info reported a wrong duration value (I assume a wrong one, cause the user also reported it as wrong).

> mp4info 001-finished.m4b | grep secs
1       audio   MPEG-4 AAC LC, 213.179 secs, 67 kbps, 22050 Hz
>
> tone dump 001-finished.m4b | grep duration               
│          duration │ 00:03:33.134              │
> 
  • mp4info - 213179ms
  • tone - 213134ms

The shift is only 45ms, but it is summing up to a greater value when using multiple files.

This is the first time ever that mp4info is wrong about the duration of a file, so I wonder, what the problem is. Surely, you cannot reproduce this without the files, but unfortunately, they can't be shared publicly. So let me know when you have the time to care about this - I'll invite you to a private repository to share one of the files with you, so that you can reproduce the problem.

@enzo1982
Copy link
Owner

enzo1982 commented Oct 1, 2022

Hi Andreas,

I'll have time to have a look at those files this weekend. So would be great if you could share them with me.

From your description, I would guess that the difference is due to tone considering gapless information (iTunSMPB or elst) and stripping delay and padding samples, which mp4info does not.

Thus far, I considered that out of scope for MP4v2 and something that has to be supported by 3rd party software integrating the library. It might make sense to add this to mp4info, though.

@sandreas
Copy link
Author

sandreas commented Oct 2, 2022

I emailed you the file to freac.org, please let me know if you got it and were able to reproduce the issue. If it did not work, please let me know how you wanna share the file.

Thank you.

@enzo1982
Copy link
Owner

enzo1982 commented Oct 2, 2022

Thank you for providing the file!

As suspected, the file uses an edit list (elst) box to signal encoder delay of 1024 samples. tone apparently considers this when reporting the duration, while mp4info does not.

I'll see if I can add support for this to mp4info. We can leave this issue open until then.

@sandreas
Copy link
Author

sandreas commented Oct 2, 2022

I'll see if I can add support for this to mp4info. We can leave this issue open until then.

Great, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants