Post

Replies

Boosts

Views

Activity

AVPlayerItemLegibleOutput contains Core Media attributes
When using AVPlayerItemLegibleOutput to obtain a sequence of subtitles from a video stream the results are returned as NSAttributedStrings through AVPlayerItemLegibleOutputPushDelegate method: func legibleOutput( _: AVPlayerItemLegibleOutput, didOutputAttributedStrings strings: [NSAttributedString], nativeSampleBuffers _: [Any], forItemTime itemTime: CMTime ) Inspecting the string's attributes I see that rather than NSAttributedString.Key values such as NSAttributedString.Key.font, NSAttributedString.Key.foregroundColor we have Core Media attributes such as CMFontFamilyName and CMForegroundColorARGB. As these attributes reflect the user's device accessibility settings for subtitles and closed-captions they should not be ignored. Unfortunately UILabel cannot render them. So my question is what is the correct approach to rendering these strings (when automatic player caption rendering isn't suitable)?
0
0
1.1k
Feb ’23
AVPlayerItem fails with -12889 CoreMediaErrorDomain "No response for media file in 4.096s"
Hi there, We are experiencing intermittent HLS playback failures with the following AVPlayerItemErrorLogEvent: ("https://somewhere.com/ausw/slices/156/e6cf0c55dac249f0a0f72e7c72e6f6cb/1560e743f9d441309eab162aa0c1c95d/H000000E6.ts?pbs=0c1c1ada7e1540dd80c41397753da0d2&cloud=aws&si=0") nil Optional("E0186CE2-D6D7-46A9-8DD8-E92D38F2C64F") -12889 CoreMediaErrorDomain Optional("No response for media file in 4.096s")` This typically occurs when seeking and can be reproduced by repeatedly skipping +10s forward through a video stream. Immediately prior to the playback failure we see a sequence of cancelled (“IO: Stream cancelled by CLIENT”) segment HTTP requests whose durations go from a “normal” few hundred ms to 10.01s which I interpret to be a timeout. The final request appears to retry and timeout ad infinitum. After the error the AVPlayer instance is broken and subsequent attempts to play a new AVPlayerItem instance result in the error immediately recurring. This issue affects iOS 14 and 13, but not iOS 12 or 11. Any suggestions on how to diagnose or fix this are appreciated! Many thanks /R
2
1
3.4k
Nov ’20