Closed Bug 1726202 Opened 3 years ago Closed 3 years ago

Add cbcs clearkey test cases

Categories

(Core :: Audio/Video: Playback, task, P2)

task

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: bryce, Assigned: bryce)

References

Details

Attachments

(1 file)

Bug 1516673 has landed cbcs support in clearkey. We should get some test cases in place. These will cover that we're parsing cbcs data correctly.

cbcs is mp4 only at this stage, webm uses a scheme analogous to the cenc scheme. So our test cases should be mp4 specific.

We should cover different patterns for cbcs. E.g. 1:9, 5:5, 10:0. Patterns often sum to 10, but don't have to, so we could include some odd ones too.

Working on this. I plan to include audio tracks in the test too. FYI, the spec forbids using a pattern with audio tracks

ISO/IEC 23001-7 on cbcs:

Tracks other than video are protected using whole-block full-sample encryption as specified in 9.7 and
hence skip_byte_block SHALL be 0

So encrypted audio will typically not have the same pattern as the encrypted video track, even if you tell packers to use the same pattern.

My notes for creating test files follow. I create manifests below as it's useful for my own manual testing, but these manifests won't be needed for the in tree tests and will be omitted when I submit a patch.

Create shorter bipbop:
ffmpeg.exe -i bipbop.mp4 -t 2s -c copy bipbop_2s.mp4

Create test files using shaka packager (I'm using a windows executable, replace the exe with the appropriate binary for your platform)

./packager-win.exe 'in=bipbop_2s.mp4,stream=audio,init_segment=bipbop_cbcs_1_9_audio_init.mp4,segment_template=bipbop_cbcs_1_9_audio_$Number$.m4s' 'in=bipbop_2s.mp4,stream=video,init_segment=bipbop_cbcs_1_9_video_init.mp4,segment_template=bipbop_cbcs_1_9_video_$Number$.m4s' --protection_scheme cbcs --enable_raw_key_encryption --keys label=:key_id=7e571d047e571d047e571d047e571d21:key=7e5744447e5744447e5744447e574421 --iv 11223344556677889900112233445566 --clear_lead 0 --crypt_byte_block 1 --skip_byte_block 9 --generate_static_live_mpd --mpd_output bipbop_cbcs_1_9.mpd

./packager-win.exe 'in=bipbop_2s.mp4,stream=audio,init_segment=bipbop_cbcs_5_5_audio_init.mp4,segment_template=bipbop_cbcs_5_5_audio_$Number$.m4s' 'in=bipbop_2s.mp4,stream=video,init_segment=bipbop_cbcs_5_5_video_init.mp4,segment_template=bipbop_cbcs_5_5_video_$Number$.m4s' --protection_scheme cbcs --enable_raw_key_encryption --keys label=:key_id=7e571d047e571d047e571d047e571d21:key=7e5744447e5744447e5744447e574421 --iv 11223344556677889900112233445566 --clear_lead 0 --crypt_byte_block 5 --skip_byte_block 5 --generate_static_live_mpd --mpd_output bipbop_cbcs_5_5.mpd

./packager-win.exe 'in=bipbop_2s.mp4,stream=audio,init_segment=bipbop_cbcs_10_0_audio_init.mp4,segment_template=bipbop_cbcs_10_0_audio_$Number$.m4s' 'in=bipbop_2s.mp4,stream=video,init_segment=bipbop_cbcs_10_0_video_init.mp4,segment_template=bipbop_cbcs_10_0_video_$Number$.m4s' --protection_scheme cbcs --enable_raw_key_encryption --keys label=:key_id=7e571d047e571d047e571d047e571d21:key=7e5744447e5744447e5744447e574421 --iv 11223344556677889900112233445566 --clear_lead 0 --crypt_byte_block 10 --skip_byte_block 0 --generate_static_live_mpd --mpd_output bipbop_cbcs_10_0.mpd

./packager-win.exe 'in=bipbop_2s.mp4,stream=audio,init_segment=bipbop_cbcs_7_7_audio_init.mp4,segment_template=bipbop_cbcs_7_7_audio_$Number$.m4s' 'in=bipbop_2s.mp4,stream=video,init_segment=bipbop_cbcs_7_7_video_init.mp4,segment_template=bipbop_cbcs_7_7_video_$Number$.m4s' --protection_scheme cbcs --enable_raw_key_encryption --keys label=:key_id=7e571d047e571d047e571d047e571d21:key=7e5744447e5744447e5744447e574421 --iv 11223344556677889900112233445566 --clear_lead 0 --crypt_byte_block 7 --skip_byte_block 7 --generate_static_live_mpd --mpd_output bipbop_cbcs_7_7.mpd

./packager-win.exe 'in=bipbop_2s.mp4,stream=audio,init_segment=bipbop_cbcs_9_8_audio_init.mp4,segment_template=bipbop_cbcs_9_8_audio_$Number$.m4s' 'in=bipbop_2s.mp4,stream=video,init_segment=bipbop_cbcs_9_8_video_init.mp4,segment_template=bipbop_cbcs_9_8_video_$Number$.m4s' --protection_scheme cbcs --enable_raw_key_encryption --keys label=:key_id=7e571d047e571d047e571d047e571d21:key=7e5744447e5744447e5744447e574421 --iv 11223344556677889900112233445566 --clear_lead 0 --crypt_byte_block 9 --skip_byte_block 8 --generate_static_live_mpd --mpd_output bipbop_cbcs_9_8.mpd

Add several test cases to cover our cbcs path. These test a number of different
patterns. These patterns are

  • 1:9, 5:5, 10:0. These are more conventional patterns.
  • 7:7, 9:8. These are not conventional. Both go against the spec by not summing
    to 10. This tests we can appropriately handle unconventional cases.

Note that the spec says patterns should only be applied to video tracks. So in
all cases the audio actually use 0:0 (full encryption). So these test cases also
cover the 0:0 case.

Pushed by bvandyk@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/820a165f2cf5
Add cbcs clear key test cases. r=jolin
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: