Bug 251137 - Safari 16 throws error on encrypted video
Summary: Safari 16 throws error on encrypted video
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari 16
Hardware: Mac (Apple Silicon) macOS 13
: P1 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-01-24 22:05 PST by Vitaly
Modified: 2023-07-17 23:51 PDT (History)
3 users (show)

See Also:


Attachments
HTML/JS and media to deploy locally (5.60 MB, application/zip)
2023-01-24 22:05 PST, Vitaly
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vitaly 2023-01-24 22:05:59 PST
Created attachment 464644 [details]
HTML/JS and media to deploy locally

Certain videos encoded with Intel QSV in CBR mode and encrypted with CBCS 1:9 cause Safari 16.2 (both regular and TP) on macOS 13.1 on M1 Air to throw an error after a few seconds of playback.
I've used both my own encryptor and Shaka Packager - the result is the same. At the same time there are no errors on my old Intel-based MBP (mid 2012) / macOS 10.15.7 / Safari 15.6 as well as on iPad Air 2 / iPadOS 15.5, which leads me to believe the faulty link is Safari 16, maybe in combination with Apple silicon.

The demo is deployed here (it's pretty much Apple's own FairPlay sample code with castLabs DRMtoday license acquisition):
http://pop-av.icu:8898/
Comment 1 Vitaly 2023-01-24 22:22:39 PST
It's also worth mentioning it works perfectly fine with third-party decryptors/players: Chrome on any platform/hardware via MSE with ClearKey or Widevine or PlayReady, ffplay (ffplay -decryption_key 3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c3c out-2-encr.mp4, but not with the stable 5.1.2 as it has couple of bugs around 'trun' parsing which are fixed in main), etc
Comment 2 Radar WebKit Bug Importer 2023-01-25 17:17:21 PST
<rdar://problem/104674800>
Comment 3 Vitaly 2023-01-25 18:25:53 PST
Moved the demo to https://vitaly-castlabs.github.io/safari16-decr-issue
Comment 4 Vitaly 2023-05-10 22:45:46 PDT
ffmpeg Stable has been updated to 6.0 since, so "ffplay -decryption_key..." now works fine too
Comment 5 Vitaly 2023-07-12 23:53:51 PDT
Verbose MSE log:
[Debug] SourceBuffer::monitorBufferingRate(9FFAD41A0090001) 0.2638390404863951
[Debug] SourceBuffer::sourceBufferPrivateAppendComplete(9FFAD41A0090001) buffered = [{0/1 = 0}..{1477/1000 = 1.477}] 
[Debug] SourceBuffer::appendBufferInternal(9FFAD41A0090001) size = 19836, buffered = [{0/1 = 0}..{1477/1000 = 1.477}] 
[Debug] SourceBuffer::monitorBufferingRate(9FFAD41A0090001) 0.2649563195125863
[Debug] SourceBuffer::sourceBufferPrivateAppendComplete(9FFAD41A0090001) buffered = [{0/1 = 0}..{1495/1000 = 1.495}] 
[Error] SourceBuffer::sourceBufferPrivateDidReceiveRenderingError(9FFAD41A0090001) 0
[Log] MediaSource::streamEndedWithError(9FFAD41A0098DE6) decode
[Log] MediaSource::onReadyStateChange(9FFAD41A0098DE6) old state = open, new state = ended
[Debug] MediaSource::scheduleEvent(9FFAD41A0098DE6) scheduling 'sourceended'
[Log] MediaSource::detachFromElement(9FFAD41A0098DE6) 
[Log] MediaSource::onReadyStateChange(9FFAD41A0098DE6) old state = ended, new state = closed
[Debug] MediaSource::scheduleEvent(9FFAD41A0098DE6) scheduling 'sourceclose'
[Debug] MediaSource::removeSourceBuffer(9FFAD41A0098DE6) 
[Error] SourceBuffer::sourceBufferPrivateDidReceiveRenderingError(9FFAD41A0090001) 0