shaka-project / shaka-packager

A media packaging and development framework for VOD and Live DASH and HLS applications, supporting Common Encryption for Widevine and other DRM Systems.
https://shaka-project.github.io/shaka-packager/
Other
2.01k stars 511 forks source link

duplicate EXT-X-METHOD with --protection_systems Fairplay #1431

Open SteveR-PMP opened 2 months ago

SteveR-PMP commented 2 months ago

System info

Operating System: Shaka Packager Version: <3.2.0>

Issue and steps to reproduce the problem

Packager Command:

'in=./shaka-packager/packager/media/test/data/bear-1280x720.mp4,stream=video,init_segment=/tmp/shaka/init.m4v,segmenttemplate=/tmp/shaka/seg$Number$.m4s,drm_label=sd,dash_roles=main' \ --enable_raw_key_encryption --keys label=audio:key_id=12345678901234567890123456789012:key=12345678901234567890123456789012:iv=12345678901234567890123456789012,label=sd:key_id=12345678901234567890123456789012:key=12345678901234567890123456789012:iv=12345678901234567890123456789012,label=hd:key_id=12345678901234567890123456789012:key=12345678901234567890123456789012:iv=12345678901234567890123456789012 \ --protection_systems Fairplay,Widevine,PlayReady \ --protection_scheme cbcs \ --pssh 00000020707373680000000029701FE43CC74A348C5BAE90C7439A4700000000 \ --clear_lead 0 --segment_duration 6 --hls_master_playlist_output /tmp/shaka/master.m3u8

What is the expected result? HLS manifest should contain only 1 reference to the fairplay key.

What happens instead? HLS contains 2 references to the fairplay key.

EXT-X-KEY:METHOD=SAMPLE-AES,URI="skd://EjRWeJASNFZ4kBI0VniQEg==",KEYFORMATVERSIONS="1",KEYFORMAT="com.apple.streamingkeydelivery"

EXT-X-KEY:METHOD=SAMPLE-AES,URI="data:text/plain;charset=UTF-16;base64,vgEAAAEAAQC0ATwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGUAYQBkAGUAcgAiACAAdgBlAHIAcwBpAG8AbgA9ACIANAAuADMALgAwAC4AMAAiAD4APABEAEEAVABBAD4APABQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsASQBEAFMAPgA8AEsASQBEACAAQQBMAEcASQBEAD0AIgBBAEUAUwBDAEIAQwAiACAAVgBBAEwAVQBFAD0AIgBlAEYAWQAwAEUAaABLAFEAVgBqAFIANABrAEIASQAwAFYAbgBpAFEARQBnAD0APQAiAD4APAAvAEsASQBEAD4APAAvAEsASQBEAFMAPgA8AC8AUABSAE8AVABFAEMAVABJAE4ARgBPAD4APAAvAEQAQQBUAEEAPgA8AC8AVwBSAE0ASABFAEEARABFAFIAPgA=",IV=0x12345678901234567890123456789012,KEYFORMATVERSIONS="1",KEYFORMAT="com.microsoft.playready"

EXT-X-KEY:METHOD=SAMPLE-AES,URI="data:text/plain;base64,AAAAXHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAADwSEBI0VniQEjRWeJASNFZ4kBISEBI0VniQEjRWeJASNFZ4kBISEBI0VniQEjRWeJASNFZ4kBJI88aJmwY=",KEYID=0x12345678901234567890123456789012,IV=0x12345678901234567890123456789012,KEYFORMATVERSIONS="1",KEYFORMAT="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"

EXT-X-KEY:METHOD=SAMPLE-AES,URI="skd://EjRWeJASNFZ4kBI0VniQEg==",KEYFORMATVERSIONS="1",KEYFORMAT="com.apple.streamingkeydelivery"

This only happens when using both --protection_systems Fairplay AND -pssh.

xavierlaffargue commented 2 months ago

I think that when you specify a protection system argument you don't need to specify a pssh

In the documentation : https://shaka-project.github.io/shaka-packager/html/tutorials/drm.html#raw-key-encryption-options

Use –pssh to provide custom protection systems or use –protection_systems to generate protection systems automatically.