AVAsset with mp4 has incorrect duration

Originator:lateef.0.sanford
Number:rdar://46510748 Date Originated:5 December, 2018
Status:Open Resolved:No
Product:AVFoundation Product Version:iOS 12.1
Classification:Bug Reproducible:Yes
 
Summary: 
Creating an AVAsset from an mp4 has an incorrect duration. The attached documents include two screenshots showing the duration difference. An example mp4 is also attached.  

Steps to Reproduce:
AVAsset *customPlayerAsset = [AVURLAsset URLAssetWithURL:target options:@{
    AVURLAssetPreferPreciseDurationAndTimingKey : @(YES)
}];
AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:customPlayerAsset];
/* later, once asset is fully loaded */
CMTimeGetSeconds(playerItem.duration); // typically about double the correct amount

Expected Results:
The duration reflects the length of the audio file

Actual Results:
The duration is reported to be about twice the length, and playing the asset results in no audio after the correct mark.

Version/Build:
iOS 12.1, macOS 10.14.2

Configuration:
Incorrect on any iOS config. macOS' QuickTime, and Safari show incorrect information too. Google Chrome, and part of QuickLook show correct information on macOS.

Additional Info: https://gist.github.com/leptos-null/052156a3ea4a2d8191afab9ac0eca22a

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!