Skip to content
New issue

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

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

Already on GitHub? # to your account

Get correct media duration for files produced using afconvert #404

Open
padenot opened this issue May 4, 2023 · 1 comment
Open

Get correct media duration for files produced using afconvert #404

padenot opened this issue May 4, 2023 · 1 comment
Assignees

Comments

@padenot
Copy link
Contributor

padenot commented May 4, 2023

half-a-second-1ch-44100-aac-afconvert.mp4

Here's a file that is supposed to be exactly 0.5s long.

It has been produced by taking a wav file that's 0.5s long exactly and running this on a mac:

afconvert -s 3 -f mp4f -d aac half-a-second-44110-1ch.wav

It's got an elst saying the file has a start time of 2112 (typical for macOS AAC encoder), and a segment duration of 22050 (which is correct).

mp4parse-rust reports a duration of 24576, because it uses the duration of the track. mp4parse_get_fragment_info doesn't work because it doesn't look into the right box.

@kinetiknz kinetiknz self-assigned this Aug 24, 2023
@karlt
Copy link

karlt commented Sep 12, 2023

24576 is the duration indicated in the mdhd box.
The single edts entry indicates to edit to a duration of 22050, which is read into Track::edited_duration, but this does not find its way into the Mp4parseTrackInfo.

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

No branches or pull requests

3 participants