Streaming

RSS for tag

Deep dive into the technical specifications that influence seamless playback for streaming services, including bitrates, codecs, and caching mechanisms.

Streaming Documentation

Post

Replies

Boosts

Views

Activity

HLS+FairPlay stream playback sometimes fails with Safari on macOS when variants are not ordered by increasing bitrate
While setting up our premium video-on-demand workflow in AWS, using AWS MediaConvert and MediaPackager and licence delivery from drmToday we encountered an issue with HLS+FairPlay playback (only) in Safari on macOS. The issue is that sometimes (more than 50% on the same video) the videoplayer initialization fails (with simple event of type=”error” in onerror callback). We are using Shaka player in our web application, so we first assumed that this (random) issue could be due to Shaka. However, we also tested with direct playback via the player and we observed the same issue, with same frequency. Since we have some content for which this problem does not occur and other content when the problem occurs very frequently, we tried to understand what could explain this difference. We noticed that for assets where the problem never occurs the order of the video submanifest was increasing, whereas for assets where the problem occurs frequently the order is decreasing. To isolate the issue we created a standalone page for a 2-minute asset and we are able to demonstrate that on this asset, when the bitrates are in decreasing order the playback with Safari on macOS fails more than 50% of the time. Test page using tag: KO: https://ntg-test-public-scr.s3.eu-west-1.amazonaws.com/aws-video.html OK: https://ntg-test-public-scr.s3.eu-west-1.amazonaws.com/aws-video.html?ok=1 Test page using Shaka: KO: https://ntg-test-public-scr.s3.eu-west-1.amazonaws.com/aws-shaka.html OK: https://ntg-test-public-scr.s3.eu-west-1.amazonaws.com/aws-shaka.html?ok=1 Notes: the issue is only reproducible with Safari on macOS (not with Safari on iOS) same HLS content + FairPlay plays OK 100% on tvOS the issue is only reproducible for HLS content with FairPlay (OK if no DRM)
0
0
606
Apr ’24
tsrecompressor (LL-HLS) input file option & 4K source
Now I'm preparing LL-HLS demonstration by using HLS tools. Generated pattern and screen capture are okay. But input file option does not work. Please check whether it's possible to use explicit input file as source. In case of screen recording, the max resolution of multi variant manifest is FHD even though the display resolution is 3840x2160. Please check whether it's possible to set 4K UHD resolution.
1
0
339
Apr ’24
Implementing FairPlayStreaming and getting error code -42671
Hi guys, I'm implementing FairPlay support for a video streaming application. I've managed to get as far as generating the SPC and acquiring a license from the license server. However when it comes to parsing the license (CKC) returned from the server, the FPS module returns error code -42671. Has anyone else faced this before and / or knows what the fix is? I thought passing it the license should be enough unless additional data is required?
0
0
509
Mar ’24
How to encode MV-HEVC spatial videos using HLS tool correctly?
Hi all, I am a graduate student who is looking into making MV-HEVC videos streamable. May I ask that is it possible to encode mv-hevc videos with the HLS (Http Live Streaming) protocol? I've been trying to use the HLS tool by Apple to encode a spatial video recored by VP. mediafilesegmenter -iso-fragmented -t 4 -f sp_video-1-vp spatial-video-by-vp.MOV But the output HLS playlist file doesn't look like the format that Apple proposes in the WWDC video. For example, the attribute EXT-X-VERSION is 7 instead of 12, and no attr REQ-VIDEO-LAYOUT=CH-STEREO which should be the key indicator of the spatial video type. From what the WWDC video showcased, I assume Apple's HLS tool supports it. Maybe my usage is not correct. Just curious what you guys think about it, thank you!
1
1
666
Mar ’24
Safari Fairplay WebKitMediaKeyError (code: 6, systemCode: 4294955417)
Hi Apple Team, we are observing following error intermittently when trying to playback FairPlay protected HLS streams. The error happens immediately after loading the certificate. Playback with same certificate on same device(Mac, iPhone) works most of time but intermittently this error is observed with following codes. The code=6 means MEDIA_KEYERR_DOMAIN but I did not find any information on what does systemCode=4294955417 mean? Is there a way to check what does this system code mean and what could be causing this intermittent behaviour? { "code": 6, "systemCode": 4294955417 }
1
0
595
Dec ’23
180VR streaming expectations
I have a VisionOS app that streams 180VR video to create immersive experiences, similar to the Apple TV+ immersive content. These videos are 8k60fps. When looking at "video encoding requirements" (1.25) in the hls authoring specifications, there are only specifications for up to 4k30fps for MV-HEVC. Using the "power of .75 rule" I think that 160000kbps could be close to the 8k60fps recommendation. For launching my app, I did my best guess in creating the following multivariant playlist, with a generous low end and very generous high end, with 6 second segment durations for all variants. However, in practice, users seem to be to only be picking up the lower quality bandwidth content (80000kbps) even when speed tests are showing 5x that on the device. This leads to a lot artifacts in the content during playback, since its lower quality. If I hard code a higher bit rate variant (like 240000kbps) it does playback, but obviously has a bit more lag to start up. Now that I have my Vision Pro, I've been able to see the Apple TV+ immersive content. I could be wrong, but it doesn't feel like its varying playback - when watch by tethering to my phone vs on high speed wifi, the content looks the same just a little slower to load on the phone. I'm looking for 3 points of guidance: Are there hls recommendations for 8k60fps video? For both bitrates and target duration for the segments? Any guesses as to why I am not able to pick up the high bitrates? (this could simply be that the higher ends are still too high) While 180VR is just stereo video on a larger canvas, the viewing experience is quite different due to the immersion. Are there special recommendations for 180VR video? (Such as having only one variant and specified bitrate since a changing bitrate/video quality could be jarring to the viewer) Example HLS multivariant playlist: #EXTM3U #EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=80632574,BANDWIDTH=82034658,VIDEO-RANGE=SDR,CODECS="mp4a.40.2,hvc1.1.60000000.L183.B0",RESOLUTION=4096x4096,FRAME-RATE=59.940,CLOSED-CAPTIONS=NONE https://myurl.com/stream/t4096p_080000_kbps_t6/prog_index.m3u8 #EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=160782750,BANDWIDTH=162523567,VIDEO-RANGE=SDR,CODECS="mp4a.40.2,hvc1.1.60000000.L186.B0",RESOLUTION=4096x4096,FRAME-RATE=59.940,CLOSED-CAPTIONS=NONE https://myurl.com/stream/t4096p_160000_kbps_t6/prog_index.m3u8 #EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=240941602,BANDWIDTH=243997537,VIDEO-RANGE=SDR,CODECS="mp4a.40.2,hvc1.1.60000000.L186.B0",RESOLUTION=4096x4096,FRAME-RATE=59.940,CLOSED-CAPTIONS=NONE https://myurl.com/stream/t4096p_240000_kbps_t6/prog_index.m3u8 #EXT-X-STREAM-INF:AVERAGE-BANDWIDTH=321061516,BANDWIDTH=325312545,VIDEO-RANGE=SDR,CODECS="mp4a.40.2,hvc1.1.60000000.H255.B0",RESOLUTION=4096x4096,FRAME-RATE=59.940,CLOSED-CAPTIONS=NONE https://myurl.com/stream/t4096p_320000_kbps_t6/prog_index.m3u8
2
0
736
Feb ’24
How to achieve license renewal case in safari based on ContentKeyDuration
Dear Apple Engineers, I have downloaded the FairPlay Streaming SDK 4.4 - In which i could able to make use of the fps_safari_hls_example.html file to make a successful playback of fairplay protected content in safari, by pointing our fairplay license server, .m3u8 file & certificate. Now that, i'm trying to achieve the renewal concept, so i tried to use the fps_safari_hls_key_renewal.html file also setting up the ContentKeyDuration to 20sec in FP license server backend. But client didn't make any subsequent FP license request around when nearing 20th sec or post 20th sec. I wonder if this use case be achieved in safari, the only extra functionality i could see in renewal html file is below piece of code await runAndWaitForLicenseRequest(session, keyURI, () => { session.update(stringToUInt8Array("renew")) }); Based on the above piece, i assume that we are making sure that client to aware the when to renew the license. But in my case, there were no FP request is made , in-fact, this piece of code got executed immediate after the 1st FP license request call & protected media continues to play despite setting the ContentKeyDuration to 20sec with LIMITED as contentkeyType . Could you please suggest on how to achieve the subsequent renewal request from client based on the ContentKeyDuration send in the CKC response using this sample renewal html file..? Is there any tewaks to be made in html file, kindly suggest.
0
0
445
Mar ’24
FPS key-rotation: use-case
We are aiming to apply KeyRotation for FPS service for our content streaming service. It is not clear from the spécifications how "FairPlay Streaming Programming Guide.pdf" How to apply this feature and let the "FPS DRM key server KSM " send multiple-keys at a time in one licence :(CKC) in the key rotation moment. without using the Renting and Leasing key features. Note that we don't use Offline Playback capabilities for our streams.
2
0
454
Feb ’24
verify_ckc no longer works
Hello there, I understand most components of the FairPlay Streaming Server SDK haven't been updated in about a decade, but the verify_ckc tool no longer works, and it's really helpful. It throws errors when trying to import the Crypto library...probably something to do with this whole Python 2 vs Python 3 thing. I don't know anything about Python or I'd try to fix it myself but...I'm just bringing this up in case anyone from the FairPlay team reads these things! Thx
0
0
407
Feb ’24
SK..R1 integrity bytes do not match the value in SKR1 Integrity tag
Hi I am trying to implement D Function in python. import hashlib from Crypto.Cipher import AES from Crypto.Hash import SHA from Crypto.Util.Padding import pad as padding from Crypto.PublicKey import RSA PRIME = 813416437 NB_RD = 16 def dfunction(R2, ASk): tmp = bytearray(20) pad = bytearray(64) MBlock = [0] * 14 P = PRIME if len(R2) >= 56: return -1 # kDRMSKDServerParamErr # Padding until a multiple of 56B pad[:len(R2)] = R2 pad[len(R2)] = 0x80 pad[len(R2) + 1:56] = [0] * (56 - len(R2) - 1) # Create 14 32b values for i in range(14): MBlock[i] = (pad[4 * i] << 24) ^ (pad[4 * i + 1] << 16) ^ (pad[4 * i + 2] << 8) ^ pad[4 * i + 3] # Reunify into 2 32 bits values #MBlock[0] += sum(MBlock[1:7]) #MBlock[1] = 0 #MBlock[1] += sum(MBlock[7:]) # Reunify into 2 32 bits values for i in range(1, 7): MBlock[0] += MBlock[i] MBlock[1] = 0 for i in range(7): MBlock[1] += MBlock[i + 7] # Apply the function (C_r) for i in range(2): for r in range(NB_RD): if MBlock[i] & 1: MBlock[i] >>= 1 else: MBlock[i] = (3 * MBlock[i] + 1) % P # Append to M for i in range(4): pad[56 + i] = (MBlock[0] >> (8 * i)) & 0xFF pad[60 + i] = (MBlock[1] >> (8 * i)) & 0xFF h = hashlib.sha1() h.update(pad) hh = h.digest()[:16] cipher = AES.new(ASk, AES.MODE_ECB) DASk = cipher.encrypt(padding(hh, AES.block_size)) return DASk Then, i am trying to match integrities and they does not match. I think there is an mistake in D Function implementation. Any clue whats wrong? Thank you
0
0
401
Feb ’24
How to retrieve the playback state
Per FP Streaming programming guide, The SPC includes a specific TLLV to provide the state of the media content playback. And total value length of this is 16 in decimals. Here i'm trying to retrieve the Playback State. which is of 20-23 ByteRange. byte[] mediaPlaybackStateBlock = getBlock(MEDIA_PLAYBACK_STATE).getValueData(); playbackState = Arrays.copyOfRange(mediaPlaybackStateBlock, 20, 24); I'm endup in issue - arraycopy: length -4 is negative. I'm bit confused on how to retrieve the playback state from 20-23 ByteRange when its length jus 16.. Kindly clarify
0
0
376
Jan ’24