FairPlay Streaming

RSS for tag

Securely deliver streaming media to devices through the HTTP Live Streaming protocol using FairPlay Streaming (FPS).

Posts under FairPlay Streaming tag

199 Posts

Post

Replies

Boosts

Views

Activity

[iOS 16] AVAggregateAssetDownloadTask reports CoreMediaErrorDomain Code=-12640
I'm trying to download HLS assets using AVAggregateAssetDownloadTask. It's pretty stable on iOS < 16.0. But after updating to iOS 16 I'm getting randomly following error: Task <DB57343C-5D3A-4500-A886-A30FD16AD2C3>.<3> finished with error [-12640] Error Domain=CoreMediaErrorDomain Code=-12640 "(null)" UserInfo={_NSURLErrorRelatedURLSessionTaskErrorKey=(     "BackgroundAVAssetDownloadTask <DB57343C-5D3A-4500-A886-A30FD16AD2C3>.<3>" ), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundAVAssetDownloadTask <DB57343C-5D3A-4500-A886-A30FD16AD2C3>.<3>} Few retry attempts usually solve the issue. I have compared requests made by the app using proxy server and .m3u8 playlist does not differ between successful and failed download attempts. This is the network traffic when download fails. It stops on ...Audio_Selector.m3u8 playlist. And this is the network traffic when download successfully continues: Thanks!
4
3
2.8k
Feb ’23
App for FILMS AND TV
I need help with these question from apple. Does your app offer any paid service? Who are the users that will use the paid services in the app? Where can users purchase the services that can be accessed in the app? What specific types of previously purchased services can a user access in the app? What paid content, subscriptions, or features are unlocked within your app that do not use in-app purchase?
0
0
558
Feb ’23
AVFoundation to persist playlist , downloads two different video tracks.
Hi, I'm trying to download hls playlist video track by parsing specific bitrate / resolution. Downloads work perfectly fine. But we need to download specific video track variant from the manifest. So I parse bitrate & resolution via AVAssetDownloadTaskMinimumRequiredMediaBitrateKey & AVAssetDownloadTaskMinimumRequiredPresentationSizeKey. But AVAggregateAssetDownloadTask always downloads the specific ( parsed ) bitrate variant of the video track segments along with the lower resolution video track segments. This makes the download size to go higher than expected. Is this the expected behaviour or am I doing something wrong ? I tried the sample source from https://developer.apple.com/documentation/avfoundation/offline_playback_and_storage/using_avfoundation_to_play_and_persist_http_live_streams & it has the same behaviour. This is how my manifest file looks like. #EXT-X-VERSION:7 ## Created with Unified Streaming Platform (version=1.11.3-24483) #EXT-X-SESSION-KEY:METHOD=SAMPLE-AES,URI="skd://xxxxxxx",KEYFORMAT="com.apple.streamingkeydelivery",KEYFORMATVERSIONS="1" # AUDIO groups #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-96",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2",URI="vod-idx-audio_eng=96000.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-160",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2",URI="vod-idx-audio_eng=160000.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-ec-3-192",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="6",URI="vod-idx-audio_eng_1=192000.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-320",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="6",URI="vod-idx-audio_eng_2=320000.m3u8" # SUBTITLES groups #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="da",NAME="Dansk",DEFAULT=YES,AUTOSELECT=YES,URI="vod-idx-textstream_dan=1000.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="fi",NAME="Suomi",AUTOSELECT=YES,URI="vod-idx-textstream_fin=1000.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="no",NAME="Norsk",AUTOSELECT=YES,URI="vod-idx-textstream_nor=1000.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="sv",NAME="Svenska",AUTOSELECT=YES,URI="vod-idx-textstream_swe=1000.m3u8" # variants #EXT-X-STREAM-INF:BANDWIDTH=416000,CODECS="mp4a.40.2,avc1.4D4015",RESOLUTION=480x270,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-96",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=300000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=799000,CODECS="mp4a.40.2,avc1.4D401E",RESOLUTION=640x360,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-160",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1385000,CODECS="mp4a.40.2,avc1.4D401E",RESOLUTION=768x432,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=2021000,CODECS="mp4a.40.2,avc1.4D401F",RESOLUTION=960x540,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=3505000,CODECS="mp4a.40.2,avc1.64001F",RESOLUTION=1280x720,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=3000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=5837000,CODECS="mp4a.40.2,avc1.640032",RESOLUTION=1920x1080,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=5200000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=513000,CODECS="ec-3,avc1.4D4015",RESOLUTION=480x270,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=300000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=831000,CODECS="ec-3,avc1.4D401E",RESOLUTION=640x360,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1255000,CODECS="ec-3,avc1.4D401E",RESOLUTION=768x432,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1891000,CODECS="ec-3,avc1.4D401F",RESOLUTION=960x540,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=3375000,CODECS="ec-3,avc1.64001F",RESOLUTION=1280x720,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=3000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=5707000,CODECS="ec-3,avc1.640032",RESOLUTION=1920x1080,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=5200000.m3u8 # variants #EXT-X-STREAM-INF:BANDWIDTH=98000,CODECS="mp4a.40.2",AUDIO="audio-aacl-96",SUBTITLES="textstream" vod-idx-audio_eng=96000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=163000,CODECS="mp4a.40.2",AUDIO="audio-aacl-160",SUBTITLES="textstream" vod-idx-audio_eng=160000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=325000,CODECS="mp4a.40.2",AUDIO="audio-aacl-320",SUBTITLES="textstream" vod-idx-audio_eng_2=320000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=195000,CODECS="ec-3",AUDIO="audio-ec-3-192",SUBTITLES="textstream" vod-idx-audio_eng_1=192000.m3u8 # keyframes #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=40000,CODECS="avc1.4D4015",RESOLUTION=480x270,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=300000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=80000,CODECS="avc1.4D401E",RESOLUTION=640x360,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=600000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=133000,CODECS="avc1.4D401E",RESOLUTION=768x432,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=1000000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=212000,CODECS="avc1.4D401F",RESOLUTION=960x540,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=1600000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=398000,CODECS="avc1.64001F",RESOLUTION=1280x720,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=3000000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=689000,CODECS="avc1.640032",RESOLUTION=1920x1080,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=5200000.m3u8" And this is how I create the download task let preferredMediaSelection = asset.urlAsset.preferredMediaSelection if #available(iOS 14.0, *) {       guard let task =           assetDownloadURLSession.aggregateAssetDownloadTask(with: asset.urlAsset,                                     mediaSelections: [preferredMediaSelection],                                     assetTitle: asset.stream.name,                                     assetArtworkData: nil,                                     options:                                     [AVAssetDownloadTaskMinimumRequiredMediaBitrateKey:5200000, AVAssetDownloadTaskMinimumRequiredPresentationSizeKey: CGSize(width: 1920, height: 1080)])       else { return }       task.taskDescription = asset.stream.name       task.resume()     } Any help will be appreciated. thanks
1
0
1.4k
Feb ’23
AVURLAsset with custom request header
Hi, Can we use AVURLAssetHTTPHeaderFieldsKey as options on AVURLAsset init? It is mentioned that since this is private key, app might get rejected. Is there any Apple official way to have custom header key for each m3u8 file while creating AVURLAsset for LIVE stream? Ref: https://stackoverflow.com/questions/60116789/is-it-possible-to-configure-custom-headers-for-avplayeritem-urlrequest Thank you in advance!
0
0
1.6k
Jan ’23
Error Downloading FairPlay content using AVAggregateDownloadTask
During intermittent download attempts or deleting the existing download and retrying itm getting the following error: The operation couldn’t be completed. (CoreMediaErrorDomain error -12640.) Error Domain=CoreMediaErrorDomain Code=-12640 "(null)" UserInfo={_NSURLErrorRelatedURLSessionTaskErrorKey=(\n    "BackgroundAVAssetDownloadTask <6476CB53-96B1-4AE6-88C3-EFDA3FC47F2F>.<2>"\n), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundAVAssetDownloadTask <6476CB53-96B1-4AE6-88C3-EFDA3FC47F2F>.<2>} The method which throws the error: func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) While downloading the content we prefetch the persistent key using AVContentKeySession and save that locally. Once we got the key successfully we start the download using AVAggregateDownloadTask. Hence we are not getting any issue in obtaining key or with the key exipry. Issue comes only at download attempt of that content. Background History of the issue: This issue is a follow up of a previous major issue, which we understood is an encoding issue for fairplay content. The issue was occuring on downloading of the highest resolution of the content either if we select or let the aggregate task pick the hgihest by default on its own. We used to get the following error code in response of download attempt which always fails: (CoreMediaErrorDomain error -12660 - HTTP 403: Forbidden) Note: We have also managed session our streams to upto 1 minute if the attempt to play same link it will result in failure to access stream. We fixed the issue by reducing the hls file size from backend encoding. Now we are getting this follow up issue afterwards. The problem is we are not able to get much information about the error code anywhere on the internet or documentation and not much help on forums as well. Generally people are getting this error at the time of key retrieval process. But we are getting via AVContentKeySession properly beforehand here and error coming only on download attempt of the content intermittently.
0
2
1.6k
Dec ’22
AVPlayer Not Able to Handle Relative Path URL in HLS Streams
We are running into an issue that seems unique to AVPlayer. We've built a new architecture for our HLS streams which makes use of relative URLs. We can play these channels on a number of other players just fine, but when trying to build using AVPlayer, the channel gets 400 errors requesting either child manifests/segments with relative URLs. Using curl, we are able to get a 200 success by getting to a url like: something.com/segmentfolder/../../abcd1234/videosegment_01.mp4 Curl is smart enough to get rid of the ../../ and create a valid path so the actual request (which can be seen using curl -v) looks something like: something.com/abcd1234/videosegment_01.mp4 Great. But AVPlayer doesn't do this. So it makes the request as is, which leads to a 400 error and it can't download the segment. We were able to simulate this problem with Swift playground fairly easily with this code: let hlsurl = URL(string: "website.com/segmentfolder/../../abc1234/videosegment.mp4")! print(hlsurl) print(hlsurl.standardized) The first print shows the URL as is. Trying to GET that URL leads to a 400. The second print properly handles it by adding .standardized to the URL. This leads to a 200. The problem is, this only works for the top level/initial manifest, it doesn't work for all the child manifests and segments. let url = URL(string: "website.com/segmentfolder/../../abc1234/videosegment.mp4")! let task = URLSession.shared.dataTask(with: url.standardized) {(data, response, error) in guard let data = data else { return } print(String(data: data, encoding: .utf8)!) } So question, does AVPlayer support relative URLs? If so, why can't it handle the ../../ in the URL path like other players and curl can? Is there a special way to get it to trigger standardizing ALL URL requests? Any help would be appreciated. n the network log.n the network log.
0
1
1.6k
Dec ’22
VTT Special Characters not displaying properly sometimes
When choosing to display a foreign audio track on some videos, the text does not render correctly. instead of a musical note I see white boxes for instance. This issue does not occur for the same content on Safari for Mac or Safari for iPad. The issue does present itself for a native mobile app (AVPlayer) on the same iPad, Safari for iPhone and the native mobile app on iPhone. Below is an image of the issue, the left is what I see on a problematic device and the right is what I would expect. Are there any known issues or workaround for this?
0
0
1.5k
Dec ’22
iOS 16 HLS Fairplay HDMI casting regression
Hi, as stated in this radar https://feedbackassistant.apple.com/feedback/11601970, our customers are facing issues after having upgraded to iOS 16 casting video from our app to their TV using HDMI Adaptor. HDMI casting is ok using clear (non Fairplay) video content but not with HLS Fairplay. The sound is broken and playback freezes a lot. The same problem happens on iOS 16 beta 1 as well. As far as I've seen there is no AVFoundation API update for iOS 16 listed in the release note. Anyone else experiencing this issue ? Best regards Cédric
4
2
2.2k
Dec ’22
AVContentKeySession run while application is in background
Hello, I am queueing up download task on a AVAssetDownloadURLSession - if I queue up 6-7 downloads, not all of them start straight away in the foreground, some are actually queued up and will begin, run and complete while the app is in background mode. The HLS streams I am downloading are FairPlay protected, so I use AVContentKeySession to fetch the keys for each download I pass the AVURLAsset to the key session via addContentKeyRecipient since I don't have an skd. To my understanding, the key session won't actually kick in before I start the download , i.e. so it can download the manifest and find the skd and then I can go through the whole DRM flow - i.e. the asset download task needs to actually begin for all this to work. Problem is, if my app is in the background, the part of my code that calls addContentKeyRecipient is not executed, since the background session only notifies you when it has completed, or failed. My question is - how are we supposed to fetch licenses while in the background? Does content key session provide some background support? Apple's advice is to always preload keys, but it seems this is not always possible. Am I missing something? Thanks in advance for any assistance.
1
0
1.2k
Dec ’22
[FairPlay] Attack AVContentKey to CMSampleBuffer results in "NSLocalizedFailureReason=This app is not authorized to play this file"
I implemented an AVContentKeySessionDelegate that after calling processContentKeyRequest succeeds in producing a contentKey in the callback func contentKeySession(_: AVContentKeySession, didProvide _contentKey: AVContentKey) of the AVContentKeyRecipient that manages the decoding of CMSampleBuffers. However, when I store the AVContentKey from the contentKeySession callback and try to attach it to the CMSampleBuffer with AVSampleBufferAttachContentKey, I get the error: Error Domain=AVFoundationErrorDomain Code=-11836 "Cannot Open" UserInfo={NSLocalizedFailureReason=This app is not authorized to play this file., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x28303a220 {Error Domain=NSOSStatusErrorDomain Code=-12161 "(null)"}} Does anyone have some insight on why this is happening and how to solve it?
1
0
1.4k
Dec ’22
Can AVSampleBufferAttachContentKey be used without AVPlayer?
I have a current implementation that uses AVPlayer and AVContentKeySession that works perfectly fine. I am integrating a custom player into the current project and was wondering if FPS content would work. So my question is if AVSampleBufferAttachContentKey can be used to decrypt FPS-protected (HLS) content without AVPlayer? If yes, is there any documentation on how this should be used?
4
0
1.5k
Dec ’22
Create a New Certificate -- FairPlay Streaming Certificate -- Maximum number of certificates generated
Hi guys, I should create FP Streaming certificate on Appstore to provide secured content streaming. I have one registered FP Streaming certiticate already. when i tried to create one more, i couldn't do it as belows. is there any limitation? i cannot register two FP Streaming certiticates? One more thing, I tried to remove registered certificate but there was no way to do it as belows There is no [revoke] button. Does anybody know the reason? Many thanks June, Chung
0
1
1.1k
Nov ’22
Playback not happening in Apple devices when adding ac4 audio track to content
I have packaged a content having video resolutions 2160,1080,720,480,320 and 240 and audio formats such as EC4JOC, EC3, AC4 and AAC with shaka packager. In both DRM and Non-DRM case we found video is not playing in apple devices. Then I tried by removing random tracks, one at a time and re-pack the content. Surprisingly, it started playing in both non-drm and drm versions when I removed the ac-4 audio track from the packaging command. Note that we are trying with cmaf version. I have raised this to shaka's github and they suggested like it might be a problem of apple and we need to post this to apple. Thank You
1
0
812
Nov ’22
iOS 16.1 Safari/Chrome with video js player 7.18 fails with Fairplay DRM playback
On updating to iOS 16.1 we started having playback failure for all our drm content on safari/chrome for ios which uses fairplay. Versions below 16.0 or earlier do not have this issue. We have tried using video js player with minimum eme plugins required to play drm/fairplay and no player customizations, that still doesn't play back. We get the media decoder saying : VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) The media playback was aborted due to a corruption problem or because the media used features your browser did not support. MediaError {code: 3, message: "The media playback was aborted due to a corruption…media used features your browser did not support."} This issue looks localized to fairplay on ios 16.1. Has there been any changes to fairplay on ios browsers?.
0
1
3.5k
Nov ’22
How to create an SPC request for license renewal?
I managed to play FPS protected content on Safari. Then added lease/rental TLLV to manage simultanous playback. iOS worked fine by hardcoding expiryDuration and let AVAssetResourceLoadingRequest.contentInformationRequest does its job.Unfortunately, there is no such a feature on Safari. I could not find any possible function on WebKitMediaKeySession object.So, how to create an SPC request for license renewal?
10
0
6.2k
Nov ’22
FairPlay/CENC cbcs mode compliance
We want to protect media content in fmp4 format for HLS. The content are encoded in H.264 and H.265. Apple devices need to be supported. So FairPlay/CENC cbcs mode are key DRM methods. Following questions have emeged once we started the development work:1. For H.264 sample encryption, Apple's FairPlay spec says to leave the first 32 bytes of VCL NALU clear (1 byte for VCL NALU type + following 31 bytes). Then pattern (1:9) encryption starts. But in CENC spec (ISO-23001-7:2016), it requires to leave 1 byte for VCL NALU type + slice header to be clear. Then patern (1:9) encryption starts. Which spec should we follow to encrypt h.264 samples in fmp4 format? We think what Apple's FairPlay spec describes is a better method. But we will comply with the standard regardless;2. In Section 9.5.2.2 of ISO-23001-7:2016, it is mentioned that:"Encrypted slice headers were not prohibited in the first edition of this part of ISO/IEC 23001 butwere prohibited by application specifications. A “SHOULD” requirement to leave slice headers unencrypted for‘avc1’ allows possible legacy content with encrypted slice headers to remain conformant to this new edition.But, new content should not encrypt slice headers or it may not decode properly in secure video decoders."Our video codec type is "avc1". Does that mean we are allowed to enctypt the slice headers of video also?3. Where can we find the guidlines fot H.265 encryption by FairPlay/CENC cbcs mode?Thanks!
3
0
4.3k
Oct ’22
When is contentKeySession(_:shouldRetry:reason:) called?
This is a question about AVContentKeySessionDelegate. I want contentKeySession(_:didProvide:) to be called only once. I thought I could control this with contentKeySession(_:shouldRetry:reason:), but this method is not called. How can contentKeySession(_:shouldRetry:reason:) be called? I would be happy to share your knowledge with you.
Replies
0
Boosts
0
Views
626
Activity
Mar ’23
CoreMediaErrorDomain error -12971
Trying to play some non DRM video from HLS url but AVPlayer is not playing the video, Exactly getting this error :- "Player Item Error: Optional("The operation couldn’t be completed. (CoreMediaErrorDomain error -12971.)")" . No idea what is happening here and also what does error -12971 means exactly?
Replies
4
Boosts
0
Views
3.3k
Activity
Feb ’23
Fairplay Certificate is not trusted
Hi all, We have created the Fairplay Certificate, but now when we check it with keychain, we get the error certificate is not trusted can you help us, thank you
Replies
0
Boosts
0
Views
854
Activity
Feb ’23
[iOS 16] AVAggregateAssetDownloadTask reports CoreMediaErrorDomain Code=-12640
I'm trying to download HLS assets using AVAggregateAssetDownloadTask. It's pretty stable on iOS < 16.0. But after updating to iOS 16 I'm getting randomly following error: Task <DB57343C-5D3A-4500-A886-A30FD16AD2C3>.<3> finished with error [-12640] Error Domain=CoreMediaErrorDomain Code=-12640 "(null)" UserInfo={_NSURLErrorRelatedURLSessionTaskErrorKey=(     "BackgroundAVAssetDownloadTask <DB57343C-5D3A-4500-A886-A30FD16AD2C3>.<3>" ), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundAVAssetDownloadTask <DB57343C-5D3A-4500-A886-A30FD16AD2C3>.<3>} Few retry attempts usually solve the issue. I have compared requests made by the app using proxy server and .m3u8 playlist does not differ between successful and failed download attempts. This is the network traffic when download fails. It stops on ...Audio_Selector.m3u8 playlist. And this is the network traffic when download successfully continues: Thanks!
Replies
4
Boosts
3
Views
2.8k
Activity
Feb ’23
App for FILMS AND TV
I need help with these question from apple. Does your app offer any paid service? Who are the users that will use the paid services in the app? Where can users purchase the services that can be accessed in the app? What specific types of previously purchased services can a user access in the app? What paid content, subscriptions, or features are unlocked within your app that do not use in-app purchase?
Replies
0
Boosts
0
Views
558
Activity
Feb ’23
AVFoundation to persist playlist , downloads two different video tracks.
Hi, I'm trying to download hls playlist video track by parsing specific bitrate / resolution. Downloads work perfectly fine. But we need to download specific video track variant from the manifest. So I parse bitrate & resolution via AVAssetDownloadTaskMinimumRequiredMediaBitrateKey & AVAssetDownloadTaskMinimumRequiredPresentationSizeKey. But AVAggregateAssetDownloadTask always downloads the specific ( parsed ) bitrate variant of the video track segments along with the lower resolution video track segments. This makes the download size to go higher than expected. Is this the expected behaviour or am I doing something wrong ? I tried the sample source from https://developer.apple.com/documentation/avfoundation/offline_playback_and_storage/using_avfoundation_to_play_and_persist_http_live_streams & it has the same behaviour. This is how my manifest file looks like. #EXT-X-VERSION:7 ## Created with Unified Streaming Platform (version=1.11.3-24483) #EXT-X-SESSION-KEY:METHOD=SAMPLE-AES,URI="skd://xxxxxxx",KEYFORMAT="com.apple.streamingkeydelivery",KEYFORMATVERSIONS="1" # AUDIO groups #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-96",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2",URI="vod-idx-audio_eng=96000.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-160",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2",URI="vod-idx-audio_eng=160000.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-ec-3-192",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="6",URI="vod-idx-audio_eng_1=192000.m3u8" #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio-aacl-320",LANGUAGE="en",NAME="eng",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="6",URI="vod-idx-audio_eng_2=320000.m3u8" # SUBTITLES groups #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="da",NAME="Dansk",DEFAULT=YES,AUTOSELECT=YES,URI="vod-idx-textstream_dan=1000.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="fi",NAME="Suomi",AUTOSELECT=YES,URI="vod-idx-textstream_fin=1000.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="no",NAME="Norsk",AUTOSELECT=YES,URI="vod-idx-textstream_nor=1000.m3u8" #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="textstream",LANGUAGE="sv",NAME="Svenska",AUTOSELECT=YES,URI="vod-idx-textstream_swe=1000.m3u8" # variants #EXT-X-STREAM-INF:BANDWIDTH=416000,CODECS="mp4a.40.2,avc1.4D4015",RESOLUTION=480x270,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-96",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=300000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=799000,CODECS="mp4a.40.2,avc1.4D401E",RESOLUTION=640x360,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-160",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1385000,CODECS="mp4a.40.2,avc1.4D401E",RESOLUTION=768x432,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=2021000,CODECS="mp4a.40.2,avc1.4D401F",RESOLUTION=960x540,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=3505000,CODECS="mp4a.40.2,avc1.64001F",RESOLUTION=1280x720,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=3000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=5837000,CODECS="mp4a.40.2,avc1.640032",RESOLUTION=1920x1080,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-aacl-320",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=5200000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=513000,CODECS="ec-3,avc1.4D4015",RESOLUTION=480x270,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=300000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=831000,CODECS="ec-3,avc1.4D401E",RESOLUTION=640x360,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1255000,CODECS="ec-3,avc1.4D401E",RESOLUTION=768x432,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=1891000,CODECS="ec-3,avc1.4D401F",RESOLUTION=960x540,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=1600000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=3375000,CODECS="ec-3,avc1.64001F",RESOLUTION=1280x720,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=3000000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=5707000,CODECS="ec-3,avc1.640032",RESOLUTION=1920x1080,FRAME-RATE=25,VIDEO-RANGE=SDR,AUDIO="audio-ec-3-192",SUBTITLES="textstream",CLOSED-CAPTIONS=NONE vod-idx-video=5200000.m3u8 # variants #EXT-X-STREAM-INF:BANDWIDTH=98000,CODECS="mp4a.40.2",AUDIO="audio-aacl-96",SUBTITLES="textstream" vod-idx-audio_eng=96000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=163000,CODECS="mp4a.40.2",AUDIO="audio-aacl-160",SUBTITLES="textstream" vod-idx-audio_eng=160000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=325000,CODECS="mp4a.40.2",AUDIO="audio-aacl-320",SUBTITLES="textstream" vod-idx-audio_eng_2=320000.m3u8 #EXT-X-STREAM-INF:BANDWIDTH=195000,CODECS="ec-3",AUDIO="audio-ec-3-192",SUBTITLES="textstream" vod-idx-audio_eng_1=192000.m3u8 # keyframes #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=40000,CODECS="avc1.4D4015",RESOLUTION=480x270,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=300000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=80000,CODECS="avc1.4D401E",RESOLUTION=640x360,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=600000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=133000,CODECS="avc1.4D401E",RESOLUTION=768x432,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=1000000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=212000,CODECS="avc1.4D401F",RESOLUTION=960x540,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=1600000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=398000,CODECS="avc1.64001F",RESOLUTION=1280x720,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=3000000.m3u8" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=689000,CODECS="avc1.640032",RESOLUTION=1920x1080,VIDEO-RANGE=SDR,URI="keyframes/vod-idx-video=5200000.m3u8" And this is how I create the download task let preferredMediaSelection = asset.urlAsset.preferredMediaSelection if #available(iOS 14.0, *) {       guard let task =           assetDownloadURLSession.aggregateAssetDownloadTask(with: asset.urlAsset,                                     mediaSelections: [preferredMediaSelection],                                     assetTitle: asset.stream.name,                                     assetArtworkData: nil,                                     options:                                     [AVAssetDownloadTaskMinimumRequiredMediaBitrateKey:5200000, AVAssetDownloadTaskMinimumRequiredPresentationSizeKey: CGSize(width: 1920, height: 1080)])       else { return }       task.taskDescription = asset.stream.name       task.resume()     } Any help will be appreciated. thanks
Replies
1
Boosts
0
Views
1.4k
Activity
Feb ’23
AVURLAsset with custom request header
Hi, Can we use AVURLAssetHTTPHeaderFieldsKey as options on AVURLAsset init? It is mentioned that since this is private key, app might get rejected. Is there any Apple official way to have custom header key for each m3u8 file while creating AVURLAsset for LIVE stream? Ref: https://stackoverflow.com/questions/60116789/is-it-possible-to-configure-custom-headers-for-avplayeritem-urlrequest Thank you in advance!
Replies
0
Boosts
0
Views
1.6k
Activity
Jan ’23
developer
When WKWebView uses getUserMedia, the following authorization prompt will pop up every time you exit the app (as shown below). How to solve this problem? thank you.(https://obs-ogt.obs.cn-east-3.myhuaweicloud.com:443/tinymce/1672364537956-%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20221230094106.png)
Replies
0
Boosts
0
Views
726
Activity
Dec ’22
Error Downloading FairPlay content using AVAggregateDownloadTask
During intermittent download attempts or deleting the existing download and retrying itm getting the following error: The operation couldn’t be completed. (CoreMediaErrorDomain error -12640.) Error Domain=CoreMediaErrorDomain Code=-12640 "(null)" UserInfo={_NSURLErrorRelatedURLSessionTaskErrorKey=(\n    "BackgroundAVAssetDownloadTask <6476CB53-96B1-4AE6-88C3-EFDA3FC47F2F>.<2>"\n), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundAVAssetDownloadTask <6476CB53-96B1-4AE6-88C3-EFDA3FC47F2F>.<2>} The method which throws the error: func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) While downloading the content we prefetch the persistent key using AVContentKeySession and save that locally. Once we got the key successfully we start the download using AVAggregateDownloadTask. Hence we are not getting any issue in obtaining key or with the key exipry. Issue comes only at download attempt of that content. Background History of the issue: This issue is a follow up of a previous major issue, which we understood is an encoding issue for fairplay content. The issue was occuring on downloading of the highest resolution of the content either if we select or let the aggregate task pick the hgihest by default on its own. We used to get the following error code in response of download attempt which always fails: (CoreMediaErrorDomain error -12660 - HTTP 403: Forbidden) Note: We have also managed session our streams to upto 1 minute if the attempt to play same link it will result in failure to access stream. We fixed the issue by reducing the hls file size from backend encoding. Now we are getting this follow up issue afterwards. The problem is we are not able to get much information about the error code anywhere on the internet or documentation and not much help on forums as well. Generally people are getting this error at the time of key retrieval process. But we are getting via AVContentKeySession properly beforehand here and error coming only on download attempt of the content intermittently.
Replies
0
Boosts
2
Views
1.6k
Activity
Dec ’22
AVPlayer Not Able to Handle Relative Path URL in HLS Streams
We are running into an issue that seems unique to AVPlayer. We've built a new architecture for our HLS streams which makes use of relative URLs. We can play these channels on a number of other players just fine, but when trying to build using AVPlayer, the channel gets 400 errors requesting either child manifests/segments with relative URLs. Using curl, we are able to get a 200 success by getting to a url like: something.com/segmentfolder/../../abcd1234/videosegment_01.mp4 Curl is smart enough to get rid of the ../../ and create a valid path so the actual request (which can be seen using curl -v) looks something like: something.com/abcd1234/videosegment_01.mp4 Great. But AVPlayer doesn't do this. So it makes the request as is, which leads to a 400 error and it can't download the segment. We were able to simulate this problem with Swift playground fairly easily with this code: let hlsurl = URL(string: "website.com/segmentfolder/../../abc1234/videosegment.mp4")! print(hlsurl) print(hlsurl.standardized) The first print shows the URL as is. Trying to GET that URL leads to a 400. The second print properly handles it by adding .standardized to the URL. This leads to a 200. The problem is, this only works for the top level/initial manifest, it doesn't work for all the child manifests and segments. let url = URL(string: "website.com/segmentfolder/../../abc1234/videosegment.mp4")! let task = URLSession.shared.dataTask(with: url.standardized) {(data, response, error) in guard let data = data else { return } print(String(data: data, encoding: .utf8)!) } So question, does AVPlayer support relative URLs? If so, why can't it handle the ../../ in the URL path like other players and curl can? Is there a special way to get it to trigger standardizing ALL URL requests? Any help would be appreciated. n the network log.n the network log.
Replies
0
Boosts
1
Views
1.6k
Activity
Dec ’22
VTT Special Characters not displaying properly sometimes
When choosing to display a foreign audio track on some videos, the text does not render correctly. instead of a musical note I see white boxes for instance. This issue does not occur for the same content on Safari for Mac or Safari for iPad. The issue does present itself for a native mobile app (AVPlayer) on the same iPad, Safari for iPhone and the native mobile app on iPhone. Below is an image of the issue, the left is what I see on a problematic device and the right is what I would expect. Are there any known issues or workaround for this?
Replies
0
Boosts
0
Views
1.5k
Activity
Dec ’22
iOS 16 HLS Fairplay HDMI casting regression
Hi, as stated in this radar https://feedbackassistant.apple.com/feedback/11601970, our customers are facing issues after having upgraded to iOS 16 casting video from our app to their TV using HDMI Adaptor. HDMI casting is ok using clear (non Fairplay) video content but not with HLS Fairplay. The sound is broken and playback freezes a lot. The same problem happens on iOS 16 beta 1 as well. As far as I've seen there is no AVFoundation API update for iOS 16 listed in the release note. Anyone else experiencing this issue ? Best regards Cédric
Replies
4
Boosts
2
Views
2.2k
Activity
Dec ’22
AVContentKeySession run while application is in background
Hello, I am queueing up download task on a AVAssetDownloadURLSession - if I queue up 6-7 downloads, not all of them start straight away in the foreground, some are actually queued up and will begin, run and complete while the app is in background mode. The HLS streams I am downloading are FairPlay protected, so I use AVContentKeySession to fetch the keys for each download I pass the AVURLAsset to the key session via addContentKeyRecipient since I don't have an skd. To my understanding, the key session won't actually kick in before I start the download , i.e. so it can download the manifest and find the skd and then I can go through the whole DRM flow - i.e. the asset download task needs to actually begin for all this to work. Problem is, if my app is in the background, the part of my code that calls addContentKeyRecipient is not executed, since the background session only notifies you when it has completed, or failed. My question is - how are we supposed to fetch licenses while in the background? Does content key session provide some background support? Apple's advice is to always preload keys, but it seems this is not always possible. Am I missing something? Thanks in advance for any assistance.
Replies
1
Boosts
0
Views
1.2k
Activity
Dec ’22
[FairPlay] Attack AVContentKey to CMSampleBuffer results in "NSLocalizedFailureReason=This app is not authorized to play this file"
I implemented an AVContentKeySessionDelegate that after calling processContentKeyRequest succeeds in producing a contentKey in the callback func contentKeySession(_: AVContentKeySession, didProvide _contentKey: AVContentKey) of the AVContentKeyRecipient that manages the decoding of CMSampleBuffers. However, when I store the AVContentKey from the contentKeySession callback and try to attach it to the CMSampleBuffer with AVSampleBufferAttachContentKey, I get the error: Error Domain=AVFoundationErrorDomain Code=-11836 "Cannot Open" UserInfo={NSLocalizedFailureReason=This app is not authorized to play this file., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x28303a220 {Error Domain=NSOSStatusErrorDomain Code=-12161 "(null)"}} Does anyone have some insight on why this is happening and how to solve it?
Replies
1
Boosts
0
Views
1.4k
Activity
Dec ’22
Can AVSampleBufferAttachContentKey be used without AVPlayer?
I have a current implementation that uses AVPlayer and AVContentKeySession that works perfectly fine. I am integrating a custom player into the current project and was wondering if FPS content would work. So my question is if AVSampleBufferAttachContentKey can be used to decrypt FPS-protected (HLS) content without AVPlayer? If yes, is there any documentation on how this should be used?
Replies
4
Boosts
0
Views
1.5k
Activity
Dec ’22
Create a New Certificate -- FairPlay Streaming Certificate -- Maximum number of certificates generated
Hi guys, I should create FP Streaming certificate on Appstore to provide secured content streaming. I have one registered FP Streaming certiticate already. when i tried to create one more, i couldn't do it as belows. is there any limitation? i cannot register two FP Streaming certiticates? One more thing, I tried to remove registered certificate but there was no way to do it as belows There is no [revoke] button. Does anybody know the reason? Many thanks June, Chung
Replies
0
Boosts
1
Views
1.1k
Activity
Nov ’22
Playback not happening in Apple devices when adding ac4 audio track to content
I have packaged a content having video resolutions 2160,1080,720,480,320 and 240 and audio formats such as EC4JOC, EC3, AC4 and AAC with shaka packager. In both DRM and Non-DRM case we found video is not playing in apple devices. Then I tried by removing random tracks, one at a time and re-pack the content. Surprisingly, it started playing in both non-drm and drm versions when I removed the ac-4 audio track from the packaging command. Note that we are trying with cmaf version. I have raised this to shaka's github and they suggested like it might be a problem of apple and we need to post this to apple. Thank You
Replies
1
Boosts
0
Views
812
Activity
Nov ’22
iOS 16.1 Safari/Chrome with video js player 7.18 fails with Fairplay DRM playback
On updating to iOS 16.1 we started having playback failure for all our drm content on safari/chrome for ios which uses fairplay. Versions below 16.0 or earlier do not have this issue. We have tried using video js player with minimum eme plugins required to play drm/fairplay and no player customizations, that still doesn't play back. We get the media decoder saying : VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) The media playback was aborted due to a corruption problem or because the media used features your browser did not support. MediaError {code: 3, message: "The media playback was aborted due to a corruption…media used features your browser did not support."} This issue looks localized to fairplay on ios 16.1. Has there been any changes to fairplay on ios browsers?.
Replies
0
Boosts
1
Views
3.5k
Activity
Nov ’22
How to create an SPC request for license renewal?
I managed to play FPS protected content on Safari. Then added lease/rental TLLV to manage simultanous playback. iOS worked fine by hardcoding expiryDuration and let AVAssetResourceLoadingRequest.contentInformationRequest does its job.Unfortunately, there is no such a feature on Safari. I could not find any possible function on WebKitMediaKeySession object.So, how to create an SPC request for license renewal?
Replies
10
Boosts
0
Views
6.2k
Activity
Nov ’22
FairPlay/CENC cbcs mode compliance
We want to protect media content in fmp4 format for HLS. The content are encoded in H.264 and H.265. Apple devices need to be supported. So FairPlay/CENC cbcs mode are key DRM methods. Following questions have emeged once we started the development work:1. For H.264 sample encryption, Apple's FairPlay spec says to leave the first 32 bytes of VCL NALU clear (1 byte for VCL NALU type + following 31 bytes). Then pattern (1:9) encryption starts. But in CENC spec (ISO-23001-7:2016), it requires to leave 1 byte for VCL NALU type + slice header to be clear. Then patern (1:9) encryption starts. Which spec should we follow to encrypt h.264 samples in fmp4 format? We think what Apple's FairPlay spec describes is a better method. But we will comply with the standard regardless;2. In Section 9.5.2.2 of ISO-23001-7:2016, it is mentioned that:"Encrypted slice headers were not prohibited in the first edition of this part of ISO/IEC 23001 butwere prohibited by application specifications. A “SHOULD” requirement to leave slice headers unencrypted for‘avc1’ allows possible legacy content with encrypted slice headers to remain conformant to this new edition.But, new content should not encrypt slice headers or it may not decode properly in secure video decoders."Our video codec type is "avc1". Does that mean we are allowed to enctypt the slice headers of video also?3. Where can we find the guidlines fot H.265 encryption by FairPlay/CENC cbcs mode?Thanks!
Replies
3
Boosts
0
Views
4.3k
Activity
Oct ’22