Post

Replies

Boosts

Views

Activity

Reply to AVAssetResourceLoaderDelegate and TS files error: Error Domain=CoreMediaErrorDomain Code=-12881 "custom url not redirect"
I have the same situation as the original author; I'm able to use the AVAssetResourceLoaderDelegate with a custom scheme to redirect my playlists (master, media, audio, iframe), but when it comes to the segments, I'm unable to redirect them. My usage scenario is that I need to attach OAuth tokens, and can't put them in the URL itself, I have to put them in the header. It's not clear to me why we can't redirect for the segment fetches, as can't byte ranges be respected in the requests? I've looked at the DataTasks mentioned, but they seem to for a different solution. We already have custom downloader (data task fetcher), URLCache, and Session and just need to redirect the mp4 fragment segments themselves. Currently we're forced to use a reverse proxy to handle the entire flow. I was hoping to flip it back to using the AVAssetResourceLoaderDelegate and was happy to see it's easy for the m3u playlists, but segments are a step backwards. How does the DataTask solution accomplish us just putting new auth headers on requests? How are we supposed to add auth headers to our AVURLAsset playlists and segments?
Topic: Media Technologies SubTopic: Streaming Tags:
May ’21
Reply to HLS AVPlayerItem producing unknown error, -15419
Awesome thanks, that's kind of what we expect, well not the error. Our manifest contains some spaced out events and we're using gaps to ensure the program dates line up with the CMTime positions within the playlists (so we can seek smoothly, predictably, between events by a UTC to CMTime translation based on the HLS playlist start time). Is there anything obvious that we could be doing to avoid the -15419 error? Additionally, we're seeing a significant performance degradation when playing playlists with GAPs like below vs our (same 6 hour ranged) streams that have data the entire way. Are there things we can do in this playlist that would improve our time to playback starting (first frame)? If GAPs are the problem, is there a way to know the valid UTC dates for segments within a playlist? Our services had been returning multiple inits (#EXT-X-MAP tags) but that was killing our initial performance since they all appear to be fetched while the assets are loading, prior to allowing playback, etc. Below is an example of our master, media, and audio HLS playlists (IFrame is similar), with the events spaced out. We don't request to play/seek during the GAPs, but it allows us to continuously seek between valid data events and have our seek's succeed. However, we've started to get the -15419 error recently, although everything seems to be working. Master #EXT-X-STREAM-INF:BANDWIDTH=1000000,AUDIO="default-audio-group" http://host/generateHlsMediaPlaylist?start_time=2021-05-12T11:41:58.161Z&end_time=2021-05-12T17:41:58.161Z&include_init_segment=true&type=MEDIA_TYPE_VIDEO&request_type=media_playlist #EXT-X-MEDIA:GROUP-ID="default-audio-group",NAME="audio",TYPE=AUDIO,DEFAULT=YES,AUTOSELECT=YES,URI="http://host/generateHlsMediaPlaylist?start_time=2021-05-12T11:41:58.161Z&end_time=2021-05-12T17:41:58.161Z&include_init_segment=true&type=MEDIA_TYPE_AUDIO&request_type=audio_playlist" #EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=125000,URI="http://host/generateHlsIFramePlaylist?start_time=2021-05-12T11:41:58.161Z&end_time=2021-05-12T17:41:58.161Z&include_init_segment=true&request_type=iframe_playlist" Media #EXTM3U #EXT-X-VERSION:8 #EXT-X-PLAYLIST-TYPE:VOD #EXT-X-INDEPENDENT-SEGMENTS #EXT-X-TARGETDURATION:30 #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-PROGRAM-DATE-TIME:2021-05-12T14:15:27.504Z #EXT-X-MAP:URI="http://host/fragments/0?request_type=media_segment",BYTERANGE="637@0" #EXTINF:2.433,0.m4v #EXT-X-BYTERANGE:645241@637 http://host/.../fragments/0?request_type=media_segment #EXTINF:27.875,1.m4v #EXT-X-BYTERANGE:6190168@637 http://host/.../fragments/1?request_type=media_segment #EXT-X-GAP #EXTINF:30, missing.m4s ...lots of 30s gaps... #EXT-X-GAP #EXTINF:8.567, missing.m4s #EXT-X-DISCONTINUITY #EXT-X-PROGRAM-DATE-TIME:2021-05-12T14:27:06.379Z #EXTINF:17.627,0.m4v #EXT-X-BYTERANGE:4263058@637 http://host/.../fragments/0?request_type=media_segment #EXT-X-GAP #EXTINF:30, missing.m4s ...lots of 30s gaps... #EXT-X-GAP #EXTINF:2.679, missing.m4s #EXT-X-DISCONTINUITY #EXT-X-PROGRAM-DATE-TIME:2021-05-12T14:29:26.685Z #EXTINF:3.803,0.m4v #EXT-X-BYTERANGE:904946@637 http://host/.../fragments/0?request_type=media_segment #EXTINF:9.566,1.m4v #EXT-X-BYTERANGE:2540650@637 http://host/.../fragments/1?request_type=media_segment #EXT-X-GAP #EXTINF:30, missing.m4s ...lots of 30s gaps... #EXT-X-GAP #EXTINF:18.106999, missing.m4s #EXT-X-DISCONTINUITY #EXT-X-PROGRAM-DATE-TIME:2021-05-12T14:41:58.161Z #EXTINF:23.968,0.m4v #EXT-X-BYTERANGE:6342949@637 http://host/.../fragments/0?request_type=media_segment #EXT-X-ENDLIST Audio #EXT-X-VERSION:8 #EXT-X-PLAYLIST-TYPE:VOD #EXT-X-INDEPENDENT-SEGMENTS #EXT-X-TARGETDURATION:30 #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-PROGRAM-DATE-TIME:2021-05-12T14:15:27.226Z #EXT-X-MAP:URI="http://host/.../fragments/0?include_segments=INIT_SEGMENT_ONLY&request_type=audio_segment" #EXTINF:0.12, http://host.../fragments/0?include_segments=MEDIA_SEGMENT_ONLY&request_type=audio_segment #EXT-X-GAP #EXTINF:0.313, missing.m4s #EXT-X-DISCONTINUITY #EXT-X-PROGRAM-DATE-TIME:2021-05-12T14:15:27.659Z #EXTINF:30.44, http://host/.../fragments/1?include_segments=MEDIA_SEGMENT_ONLY&request_type=audio_segment #EXT-X-GAP #EXTINF:30, missing.m4s ...lots of 30s gaps... #EXT-X-GAP #EXTINF:7.022, missing.m4s #EXT-X-DISCONTINUITY #EXT-X-PROGRAM-DATE-TIME:2021-05-12T14:27:05.121Z #EXTINF:18.84, http://host/.../fragments/0?include_segments=MEDIA_SEGMENT_ONLY&request_type=audio_segment #EXT-X-GAP #EXTINF:30, missing.m4s ...lots of 30s gaps... #EXT-X-GAP #EXTINF:2.727, missing.m4s #EXT-X-DISCONTINUITY #EXT-X-PROGRAM-DATE-TIME:2021-05-12T14:29:26.688Z #EXTINF:2.12, http://host/.../fragments/0?include_segments=MEDIA_SEGMENT_ONLY&request_type=audio_segment #EXTINF:11.2, http://host/.../fragments/1?include_segments=MEDIA_SEGMENT_ONLY&request_type=audio_segment #EXT-X-GAP #EXTINF:30, missing.m4s ...lots of 30s gaps... #EXT-X-GAP #EXTINF:18.139999, missing.m4s #EXT-X-DISCONTINUITY #EXT-X-PROGRAM-DATE-TIME:2021-05-12T14:41:58.148Z #EXTINF:23.96, http://host/.../fragments/0?include_segments=MEDIA_SEGMENT_ONLY&request_type=audio_segment #EXT-X-ENDLIST
Topic: Media Technologies SubTopic: Streaming Tags:
May ’21
Reply to HLS AVPlayerItem producing unknown error, -15419
Yeah, I think that's the issue we were having. We were issues attempting to bridge those gaps and maintain program date time. However, if we have jumps (i.e. use EXT-X-PROGRAM-DATE-TIME to skip the voids between data), how are we able to determine the CMTime for seeks based on program-date-time (UTC)? The only solution we've seen is to have a custom HLS parser to build up metadata on our side, and map out the CMTime based on UTC, etc. If we have gaps is there a way with AVPlayer/AVPlayerItem/AVAsset/AVAssetTrack.... to map CMTime and program date in a way that we can seek? So if we wanted to seek to UTC time X, how do we map that to CMTime? I should add, I know there is seekToDate, which I'm guessing is the answer. However, how do we scrub the iframe track with that given it doesn't accept before/after tolerances? Thanks.
Topic: Media Technologies SubTopic: Streaming Tags:
Jun ’21