Zeugma440 / atldotnet

Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets
MIT License
461 stars 61 forks source link

Fragmented MP4s appear with double length in iTunes #61

Closed Zeugma440 closed 2 years ago

Zeugma440 commented 4 years ago

Follow-up question from #60


On MacOS and iOS these files appear to be double the length of the file, so the audio plays, then half way is silent for the remainder. I.E., a 5 minute audio file with show as 10 minutes, with the second half silent.

I suspect this is because the native audio players (QuickTime on MacOS and AVPlayer on iOS) see 2 tracks, one for video that does not exist and another for the audio. That's my theory at least.

Can your library remove these video meta tags - essentially "cleaning up" the file?


I've been able to reproduce that issue by opening the original with iTunes. All other players I have (foobar, VLC, Winamp, AIMP, MusicBee, Media player classic) open it with the correct duration but have issues when trying to jump in the middle of the track.

Imho, the potential issue is not a video vs. audio track issue, as it has one unique audio track.

By examining it closely (with AtomicParsler), it has something very different than the usual MP4's I'm used to working with : instead of one "physical data" mdat atom, it has a bunch of them, interleaved with moof atoms, which makes it a fragmented MP4. I'll do some more research and keep you informed on a separate issue, as this one is solved.

Zeugma440 commented 4 years ago

Related issue : https://github.com/ytdl-org/youtube-dl/issues/5048

Zeugma440 commented 4 years ago

Did a check of all the segmented moof atoms of the file (using MP4 Explorer) and recalculated its duration using the samples' duration -> result is the correct duration of the file. At least the problem does not come from the data of the segmented atoms.

Zeugma440 commented 2 years ago

Looking at the linked issue and the ones linked to it, the consensus seems to be that YouTube handles a specific format that isn't compatible with standard MP4. => That problem can't be fixed.