Receiving eventMetadata from AVPlayerItemMetadataOutput stops responding on iOS18 only

Case-ID: 9391388

Our application uses timed Metadata as part of a rating control system. We noticed a problem in production and diagnosis shows that we stop receiving timed Metadata on iOS18 only

Our live streams are primed with metadata at least once per second but we are seeing extended gaps in receiving this content, in excess of 10 minutes.

We have also observed that this happens more as the player climbs the bitrate ladder, and doesn't happen if we cap to a low resolution i.e. a preferredMaximumResolution of 768x432.

Furthermore, if we throttle network conditions after we stop receiving metadata the we start receiving them again.

Following is a simple example that demonstrates the above behaviour, unfortunately I cannot share the live stream endpoint which is primed with metadata publicly, but can provide privately to Apple to reproduce the problem.


import UIKit
import AVKit

class ViewController: UIViewController, AVPlayerItemMetadataOutputPushDelegate {
    var player: AVPlayer?
    var itemMetadataOutput: AVPlayerItemMetadataOutput?
        
    override func viewDidAppear(_ animated: Bool) {
        guard let url = URL(string: "endpoint redacted") else {
            return
        }
        
        let player = AVPlayer(url: url)
        let controller = AVPlayerViewController()
        controller.player = player
        self.player = player
        
        present(controller, animated: true) {
            player.play()
            let currentItem = player.currentItem
            let itemMetadataOutput = AVPlayerItemMetadataOutput(identifiers: nil)
            self.itemMetadataOutput = itemMetadataOutput
            self.itemMetadataOutput?.setDelegate(self, queue: .main)
            currentItem?.add(itemMetadataOutput)
        }
    }
    
    public func metadataOutput(_ output: AVPlayerItemMetadataOutput,
                               didOutputTimedMetadataGroups groups: [AVTimedMetadataGroup],
                               from track: AVPlayerItemTrack?) {
        print("received metadata \(Date())")
    }
}

Hello @joecrowley, thank you for your post. Your code looks correct, so this is likely not an implementation issue.

Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. I'd greatly appreciate it if you could open a bug report, include a sysdiagnose, and post the FB number here once you do.

If you have any questions about filing a bug report, take a look at Bug Reporting: How and Why?

I have opened a bug report, FB15426794

I'm experiencing a similar issue as well. Has there been any update on this?

Hello @Gyuspa, please use Feedback Assistant to also submit a bug report. This way you can track if the report is still being investigated, has a potential identifiable fix, or has been resolved in another way. The status appears beside the label "Resolution."

Receiving eventMetadata from AVPlayerItemMetadataOutput stops responding on iOS18 only
 
 
Q